2009-12-26 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / metadata / ChangeLog
blob829b4a0e65f31f02d71418c3a1fad47f5576af92
1 2009-12-25  Mark Probst  <mark.probst@gmail.com>
3         * class-internals.c: Add mono_class_inflate_generic_method_full_checked and make
4         mono_class_inflate_generic_method_full internal.
6         * class.c (inflate_generic_context): Now takes a MonoError argument.
8         * class.c (mono_class_inflate_generic_method_full): Now calls the _checked and abort on
9         errors.
11 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
13         * generic-sharing.c (instantiate_other_info): Avoid creating jump trampolines since
14         they cannot be patched. Partly fixes #564408.
16 2009-12-24  Mark Probst  <mark.probst@gmail.com>
18         * metadata-internals.h, reflection.c: Use the
19         MonoDynamicImage.handleref hash table only with unmanaged keys,
20         and add a managed hash table handleref_managed for managed keys.
22 2009-12-24  Mark Probst  <mark.probst@gmail.com>
24         * sgen-gc.c: Unset to-space bumper between collections.  It might
25         become invalid due to degraded allocations.
27 2009-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
29         * loader.c (mono_method_get_signature_full): Check if the returned signature is compatible
30         with the one from the original method.
32         * metadata-verify.c (mono_verifier_is_sig_compatible): New function to verify signature
33         compatibility.
35         * verify-internals.h: Add new function to the internal API.
37 2009-12-18  Dimitar Dobrev  <dpldobrev@yahoo.com>
39         * culture-info-tables.h: regenerated it to include the Georgian culture.
41 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
43         * sgen-gc.c: Include mono/utils/memcheck.h.
45         * reflection.c (mono_reflection_get_type_internal_dynamic): Use assembly->domain
46         instead of the current domain, since the two might not match if this is called
47         from the debugger.
49         * metadata-internals.h (MonoDynamicAssembly): Add a 'domain' field to specify the
50         domain which created this assembly.
52 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
54         * debug-helpers.c (dis_one): Avoid a glib assert on empty strings.
56 2009-12-17  Mark Probst  <mark.probst@gmail.com>
58         * sgen-gc.c: Managed implementation of the specialized generic
59         store write barrier.
61 2009-12-17  Rodrigo Kumpera  <rkumpera@novell.com>
63         * icall.c (ves_icall_Type_GetMethodsByName): Don't pin virtual methods if they are newslot.
64         A private virtual newslot method is used to implement an interface method without exposing
65         it to users. When querying for public instance methods, such method would hide a public one
66         on a parent type.
68         Fixes #564379.
70 2009-12-17  Zoltan Varga  <vargaz@gmail.com>
72         * reflection.c (resolve_object): Fix the encoding of unmanaged calling
73         conventions.
75 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
77         * reflection.c (mono_type_get_object): Guard against NULL generic param owner.
79 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
81         * class-internals.h (MonoDynamicGenericClass): Kill property and event related fields
82         as they are no longer used.
83         
84          * metadata.c (free_generic_class_dependents): Remove reference to previous fields
86         * reflection.c (mono_reflection_generic_class_initialize): Ditto.
88 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
90         * reflection.c (mono_type_get_object): If the type is VAR or MVAR check
91         if the owner class has not been finished before returning reflection_info.      
93         Fixes #565127.
95 2009-12-16  Zoltan Varga  <vargaz@gmail.com>
97         * reflection.c (mono_custom_attrs_from_param): Avoid a crash if a dynamic
98         param doesn't have custom attributes. Fixes #565117.
100         * class.c (mono_bounded_array_class_get): Make these classes PUBLIC. Fixes
101         #565120.
103 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
105         * class.c (mono_class_setup_fields): Fail valuetypes that are bigger than 1Mb.
107 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
109         * pedump.c: Add partial-md mode that doesn't perform full metadata verification. It does the
110         same amount done by a core-clr enabled runtime.
112 2009-12-15  Marek Habersack  <mhabersack@novell.com>
114         * appdomain.c (mono_make_shadow_copy): make sure access mode of
115         the target files is reset to writable by owner and readable by
116         everyone else to prevent problems when updating shadow copies of
117         files whose source is read-only. Fixes bug #556884
119 2009-12-15  Mark Probst  <mark.probst@gmail.com>
121         * class.c (mono_generic_class_get_class): Allocate the generic
122         class via malloc again, so that it can be freed when any one of
123         the images of its constituent types is closed.
125         * metadata.c: When closing an image, don't free generic insts and
126         generic classes right away, but put them into a list for later
127         freeing.
129         * image.c, metadata-internals.h: Store the free list and in the
130         second pass of closing an image, free it.
132 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
134         * reflection.c (mono_generic_class_get_object): Assert if this is ever called.
136         * reflection.c (mono_reflection_register_with_runtime): Only register dynamic
137         types in type_hash.
139         * reflection.c (resolve_object): Call ensure_complete_type on the inflated field.
141 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
143         * reflection.c (mono_reflection_type_get_handle): Properly fail in case of a broken
144         user type.
146         * reflection.c (mono_reflection_register_with_runtime): Throws in case a bad user type
147         is used.
149 2009-12-14  Miguel de Icaza  <miguel@novell.com>
151         * verify.c (mono_method_verify): The Unused opcodes produce an
152         InvalidProgramException on .NET
154 2009-12-14  Sebastien Pouliot  <sebastien@ximian.com>
156         * loader.c (mono_method_get_header): Move assert after the verifier
157         has been called on the method header.
159 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
161         * object-internals.h: Remove useless field from MonoReflectionGenericClass.
163         * appdomain.c: Bump corlib version.
165 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
167         To properly support user types, MonoGenericClass has to be used for regular, non SRE,
168         types as well since otherwise generic instances would not return UT as arguments but
169         their undelying system type.
171         * object-internals.h: Change field types of MonoGenericClass and *OnTypeBuilderInst
172         to reflect the fact that they can have now multiple different types.
174         * reflection.c (mono_image_get_field_on_inst_token): Handle MonoField.
176         * reflection.c (mono_image_get_ctor_on_inst_token): Handle MonoCMethod.
178         * reflection.c (mono_image_get_method_on_inst_token): Handle MonoMethod.
180         * reflection.c (mono_reflection_register_with_runtime): Init super types
181         if the image is not dynamic.
183         * reflection.c (mono_reflection_bind_generic_parameters): In case of a MonoGenericClass,
184         check if the generic type definition is a TypeBuilder.
186         * reflection.c (mono_reflection_generic_class_initialize): If the generic type definition
187         doesn't belong to a dynamic image, skip initialization.
189         * reflection.c (resolve_object): Properly handle *OnTypeBuilderInst types where their
190         base definition is not a dynamic type.
192 2009-12-11  Marek Habersack  <mhabersack@novell.com>
194         * object.c (mono_ldstr, mono_ldstr_metadata_sig): added calls to
195         mono_profiler_string_allocation
197         * string-icalls.c (ves_icall_System_String_InternalAllocateStr):
198         if string profiling is enabled, call
199         mono_profiler_string_allocation
201         * profiler.h: added two MonoProfileFlags -
202         MONO_PROFILE_IOMAP_EVENTS and MONO_PROFILE_STRING_ALLOC as well as
203         installation functions for the hooks below.
205         * profiler-private.h, profiler.c: added two hooks:
206         mono_profiler_string_allocation called whenever a string is
207         allocated by InternalAllocateStr and mono_profiler_iomap called
208         whenever IOMAP code performs an adjustement on a file path.
210 Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <lupus@ximian.com>
212         * boehm-gc.c: fixed race condition while getting the target of a
213         disappearing link (bug #522233).
215 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
217         * class.c (mono_type_get_full): Produce warning instead of simply swallowing
218         the error.
220 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
222         * reflection.c: Add mono_reflection_register_with_runtime icall to
223         allow a MonoGenericClass to register itself as the managed mirror of
224         a given generic instance.
225         This is a temporary workaround until all MGC instantiation happens in
226         managed code.
228         * object-internals.h: Ditto.
230         * icall-def.h: Ditto.
232 2009-12-10  Mark Probst  <mark.probst@gmail.com>
234         * sgen-gc.c (find_in_remsets): Also search the generic store
235         remsets.
237 2009-12-10  Mark Probst  <mark.probst@gmail.com>
239         * sgen-gc.c: Don't access class names in debugging code when
240         unloading a domain, because they might not be valid anymore.
242 2009-12-10  Mark Probst  <mark.probst@gmail.com>
244         * domain.c, domain-internals.h: New function mono_domain_unset().
246         * appdomain.c (unload_thread_main): Detach the thread again at the
247         end.
249         * threads.c: When a thread exists or is detached, unset its domain
250         so that it's NULL when, for example, a pthread destructor runs.
252         * sgen-gc.c: Assert that there is no domain set after a thread is
253         done.
255 2009-12-10  Mark Probst  <mark.probst@gmail.com>
257         * class.c (mono_generic_class_get_class),
258         metadata.c (free_generic_class): Allocate generic MonoClass's from
259         the image mempool, not via malloc.  The problem with malloc is
260         that when unloading a domain those classes are freed before
261         clearing the heap and SGen needs the classes.  Rewriting the
262         unloading code to do the free later would be more work and there's
263         no point in using malloc anyway.
265 2009-12-09  Sebastien Pouliot  <sebastien@ximian.com>
267         * loader.c (mono_method_signature): Always call mono_loader_unlock 
268         before returning.
270 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
272         * metadata-verify.c: Add mono_verifier_verify_string_signature to check
273         user string blobs.
275         * verify-internals.h: Add new function to the internal API.
277         * verify.c (do_ldstr): Call into mono_verifier_verify_string_signature to
278         check if it's a valid string.
280         * object.c (mono_ldstr): Ditto.
282         Fixes #561943.
284 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
286         * icall.c (ves_icall_GetCurrentMethod): Drop all generic arguments
287         from a method before returning it. This is the expected behavior.
289 2009-12-08  Rodrigo Kumpera  <rkumpera@novell.com>
291         * reflection.c (inflate_method): Handle the case of a regular system type.
293 2009-12-08  Mark Probst  <mark.probst@gmail.com>
295         * sgen-gc.c, sgen-pinning-stats.c, sgen-gray.c: More statistics
296         gathering code.
298         * mempool.c, mempool-internals.h: New function
299         mono_mempool_get_bytes_allocated().
301         * Makefile.am: sgen-pinning-stats.c added.
303 2009-12-08  Mark Probst  <mark.probst@gmail.com>
305         * sgen-gc.c (create_allocator): Only use the fast path if the
306         object size is within the small object size limit.
308 2009-12-07  Mark Probst  <mark.probst@gmail.com>
310         * sgen-gc.c: Make sure section->data is aligned to 8 bytes by
311         possibly adding padding to sizeof (GCMemSection).
313 2009-12-07  Mark Probst  <mark.probst@gmail.com>
315         * sgen-gc.c (mono_gc_wbarrier_nostore): Skip the remset if the
316         reference is not in the nursery.
318 2009-12-07  Rodrigo Kumpera  <rkumpera@novell.com>
320         * class.c (mono_class_from_typeref): Bounds check idx against the 
321         assemblyref table.
323 2009-12-07  Mark Probst  <mark.probst@gmail.com>
325         * sgen-gc.c, sgen-pinning.c: When pinning, make only one pass
326         through the potential roots, then sort the results and find the
327         pinned objects from there.
329         * Makefile.am: sgen-pinning.c added.
331 2009-12-07  Mark Probst  <mark.probst@gmail.com>
333         * sgen-gc.c: Record generic stores in specialized remset buffers.
335 2009-12-06  Mark Probst  <mark.probst@gmail.com>
337         * sgen-gc.c: Make pinned chunks the same size as major heap
338         sections, and align them as well, so that we can check whether an
339         object is in a pinned chunk or a major section in constant time.
341 2009-12-06  Mark Probst  <mark.probst@gmail.com>
343         * sgen-gc.c (build_nursery_fragments): Don't leak fragments.
345 2009-12-06  Mark Probst  <mark.probst@gmail.com>
347         * sgen-gc.c: Make all major heap sections the same size (currently
348         128k) and allocate them on aligned addresses.  Small heap sections
349         give us better granularity with pinned objects - we can free up
350         much more memory.
352 2009-12-06  Mark Probst  <mark.probst@gmail.com>
354         * string-icalls.c (ves_icall_System_String_GetLOSLimit): Debug
355         output removed.
357 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
359         Applied patch from Laurent Etiemble (laurent.etiemble@gmail.com).
361         * mono/metadata/assembly.c: When opening an assembly image, pass the real
362         names in addition to the runtime generated one.
364         * mono/metadata/image.h: Add a function to take the real name of the assembly
365         image.
367         * mono/metadata/image.c: If a real name has been passed to load an assembly,
368         use it instead of the runtime generated one.
370         Code is contributed under MIT/X11 license.
372 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
374         * marshal.c (emit_marshal_vtype): Do the klass == date_time_class checks
375         before the other checks to prevent problems if the DateTime class is blittable.
376         Hopefully fixes #559600.
378 2009-12-05  Mark Probst  <mark.probst@gmail.com>
380         * string-icalls.c, string-icalls.h, icall-def.h: New icall that
381         returns the largest string length that will not be put into the
382         LOS.
384         * sgen-gc.c, gc-internal.h: New function that returns the largest
385         object size that will not be put into the LOS.
387         * appdomain.c: Bump corlib version.
389 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
391         * class-internals.h: Add MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
393         * generic-sharing.c: Handle MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
395 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
397         * reflection.c (inflate_method): Fix signature.
399         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Reflect change
400         in managed code.
402 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
404         * reflection.c (inflate_method): Make this method work with TypeBuilder as well.
406 2009-12-03  Mark Probst  <mark.probst@gmail.com>
408         * sgen-gc.c: Abstract to-space handling.
410 2009-12-03  Rodrigo Kumpera  <rkumpera@novell.com>
412         * loader.c (find_method_in_class): Ignore methods with broken signatures.
414         Fixes #559906.
416 2009-12-03  Mark Probst  <mark.probst@gmail.com>
418         * sgen-gc.c: Only add references from outside the nursery to
419         within the nursery to the global remset list.
421 2009-12-03  Mark Probst  <mark.probst@gmail.com>
423         * appdomain.c (create_exceptions): Set the domain temporarily if
424         necessary to avoid cross-domain references.
426 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
428         * verify.c (get_stack_type): Return that the type is invalid instead of
429         asserting.
431         * verify.c (mono_method_verify): Verify that all locals and arguments
432         have valid stack types.
434         Fixes #559913.
436 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
438         * verify.c (mono_method_verify): Bounds check the filter offset. Make all
439         bounds checking overflow aware.
441         Fixes #559910.
443 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
445         * verify.c (do_invoke_method): Check for invalid method signatures.
447         Fixes #553450.
449 2009-12-02  Jb Evain  <jbevain@novell.com>
451         * appdomain.c (MONO_CORLIB_VERSION): bump.
452         * icall-def.h (get_base_definition): renamed to get_base_method
453         and add a boolean argument indicating we want the original
454         method definition, or the immediate base method.
455         * icall.c: apply the get_base_definition to get_base_method change.
457 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
459         * class.c (mono_class_setup_fields): Fail an enum without an instance field.
461         Fixes #558042.
463 Wed Dec 2 16:35:49 CET 2009 Paolo Molaro <lupus@ximian.com>
465         * class.c: remove asserts for invalid type token in
466         mono_class_name_from_token(), mono_assembly_name_from_token() and
467         mono_class_create_from_typedef () (fixes bug #553318).
469 Wed Dec 2 15:48:19 CET 2009 Paolo Molaro <lupus@ximian.com>
471         * metadata.c, class.c, loader.c: remove assert after bsearch() for
472         incorrect assemblies (bug #553322).
474 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
476         * metadata.c (mono_metadata_inflate_generic_inst): Add MonoError parameter.
478         * metadata-internals.h: Change signature of mono_metadata_inflate_generic_inst. 
480         * class.c (inflate_generic_type): Use new version of mono_metadata_inflate_generic_inst.
482         * class.c (inflate_generic_context): Ditto.
484         * loader.c (method_from_methodspec): Ditto.
486         Fixes #558230.
488 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
490         * class.c (mono_type_retrieve_from_typespec): Use MonoError machinery to report errors.
492         * class.c (mono_class_create_from_typespec): Ditto.
494         * class.c (mono_class_get_full): Fix for change on the above 2 functions.
496         * class.c (mono_type_get_full): Fix for change on the above 2 functions.
498         Fixes #558184.
500 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
502         * verify.c (mono_class_has_default_constructor): Check fror broken signatures.
504         * verify.c (verify_delegate_compatibility): Ditto.
506         * verify.c (do_newobj): Ditto.
508         Fixes #558046.
510 2009-12-02  Mark Probst  <mark.probst@gmail.com>
512         * sgen-gc.c: Use a gray queue instead of requiring that gray
513         objects are in a contiguous region.
515         * sgen-gray.c: The gray queue implementation.
517         * Makefile.am: sgen-gray.c added.
519 2009-12-02  Mark Probst  <mark.probst@gmail.com>
521         * appdomain.c: When unloading a domain, zero its static data and
522         perform a minor collection when using SGen.  That will get rid of
523         all the remsets pointing into that domain's static data.
525         * sgen-gc.c: Allow remsets into static data.  By doing this we
526         need less checks so we're more efficient.
528 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
530         * verify.c (mono_method_verify): Check for catch clauses with broken
531         types.
533         Fixes #558465.
535 2009-12-01  Jb Evain  <jbevain@novell.com>
537         * class.c (make_generic_param_class): set the namespace of
538         the generic parameter class from its owner, if available.
540 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
542         * verify.c (code_bounds_check): Do proper overflow checking.
544         * verify.c (mono_method_verify): The number of switch entries is
545         an unsigned int. Properly bounds check it.
547         Fixes #558594.
549 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
551         * metadata.c: Kill mono_metadata_get_param_attrs_checked. Add
552         mono_metadata_method_has_param_attrs which only checks if a given param
553         list has a non zero flags entry.
555         * metadata.c (mono_metadata_get_param_attrs): Add param_count parameter
556         to inform how many params should we expect to decode.
558         * loader.c (mono_method_signature): Use mono_metadata_method_has_param_attrs
559         as it's faster than mono_metadata_get_param_attrs.
561         * metadata-internals.h: Fix mono_metadata_get_param_attrs signature and
562         add mono_metadata_method_has_param_attrs.
564 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
566         * class.c (mono_class_setup_vtable_general): Check for mono_method_get_vtable_slot
567         failures.
569         * class.c (mono_method_get_vtable_slot): Don't assert if the computed method slot
570         is -1 but its class is broken.
572         Fixes #558522.
574 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
576         * metadata.c: Introduce mono_metadata_get_param_attrs_checked which checks
577         for parameter overflow.
579         * metadata.c (mono_metadata_parse_method_signature_full): Use checked version
580         of mono_metadata_get_param_attrs.
582         * metadata-internals.h: Add mono_metadata_get_param_attrs_checked to the internal
583         API.
585         * loader.c (mono_method_signature): Use checked version of mono_metadata_get_param_attrs.
587 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
589         * class.c (mono_class_setup_fields): Check for fields with broken types.
591         Fixes #558741.
593 2009-11-28  Rodrigo Kumpera  <rkumpera@novell.com>
595         * reflection.c (ensure_generic_class_runtime_vtable): Split this function in 2
596         so we can avoid calling ensure_runtime_vtable multiple times for the GTD during
597         its TypeBuilder::CreateType ().
599         * reflection.c (ensure_generic_class_runtime_vtable): Avoid initializing interfaces
600         if not needed.
602         * reflection.c: Every time we change the interface array, set interfaces_packed to NULL
603         to make setup_interface_offsets happy.
605         * reflection.c (remove_instantiations_of_and_ensure_contents): Fix instances again as corlib
606         compilation now works.
608 2009-11-28  Zoltan Varga  <vargaz@gmail.com>
610         * appdomain.c (create_exceptions): New helper function extracted from
611         mono_runtime_init () to precreate objects used during exception handling.
612         (mono_runtime_init): Call it.
613         (mono_domain_create_appdomain_internal): Ditto. Fixes #555264.
615 2009-11-27  Rodrigo Kumpera  <rkumpera@novell.com>
617         * reflection.c (remove_instantiations_of_and_ensure_contents): Temp hack to fix corlib
618         compilation until the proper one is found.
620 2009-11-27  Zoltan Varga  <vargaz@gmail.com>
622         * class.c (mono_class_setup_vtable_general): Cache the result of
623         get_virtual_methods () since it can be slow because of the metadata
624         optimization.
626         * metadata-internals.h (_MonoImage): Change 'method_cache' to a GHashTable
627         from a MonoValueHashTable for now, since the later is based on an earlier
628         version of hpj's internal probing code and seems to have serious collision
629         issues.
631         * loader.c (mono_get_method_full): Update after the change above.
633 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
635         * class-internals.h (MonoCachedClassInfo): Add 'is_generic_container' field.
637 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
639         * reflection.c (get_field_on_inst_generic_type): Try to fallback using the field from
640         the GTD instead of the DGC instead of crashing.
642         * reflection.c (ensure_generic_class_runtime_vtable): Only reinflate stuff that is
643         required. Inflate fields if needed.
645         * reflection.c (remove_instantiations_of): Ensure generic instances are properly
646         finished. Renamed.
648 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
650         * class.c (check_interface_method_override): Check for NULL signatures and fail
651         the type.
653         * debug-helpers.c (mono_signature_get_desc): Return a fixed string for NULL signatures.
655         Fixes #553428.
657 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
659         * class.c (mono_class_get_virtual_methods): Call decode_row_col to obtain
660         the MONO_METHOD_FLAGS column instead of decoding the whole row.
662 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
664         * loader.c (field_from_memberref): Resolve the class first then the field
665         signature. Remove a lot of duplicated code and make sure we don't pass valid
666         values to mono_loader_set_error_field_load.
668         Fixes #553306.
670 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
672         * class.c (inflate_generic_type): Change code to use new signature of
673         mono_error_set_bad_image.
675         Fixes #558124.
677 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com> 
679         * verify.c (mono_method_verify): Don't free ctx.params items if 
680         we aborted while inflating the ctx.locals. Complete previous fix
682 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com>
684         * verify.c (mono_method_verify): Use the uninflated type name, 
685         when the inflated is null, to report errors. Also take care when
686         freeing, not to free everything since, in case of an error, some
687         stuff would be copies (i.e. not allocated by the function itself)
688         Fix bug #558145
690 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
692         * verify.c (stack_push, stack_pop, stack_pop_safe): Assert if we underflow
693         or overflow. The caller must have done this check explicitly. This guard us
694         from accessing invalid memory.
696         * verify.c (do_push_static_field): Check for stack overflow.
698         Fixes #553333.
700 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
702         * loader.c (find_method_in_class): Don't crash if the signature cannot
703         be resolved.
705         * metadata.c (mono_metadata_parse_generic_param): Return NULL instead
706         of asserting for the case of invalid params.
708         Fixes #553304.
710 2009-11-24  Sebastien Pouliot  <sebastien@ximian.com>
712         * image.c (mono_image_load_module): Fix crash when a bad assembly
713         has no module at all (fix bug #553412) and also replace the 
714         g_assert with a return NULL (documented return value for failure)
716 2009-11-23  Zoltan Varga  <vargaz@gmail.com>
718         * debug-helpers.c (mono_type_get_desc): Handle typedbyref.
720 2009-11-23  Miguel de Icaza  <miguel@novell.com>
722         * file-io.c: Change FindFirst/FindNext/FindClose API to return the
723         file attribute to managed code and avoid doing the mask/attribute
724         checks here. 
726 2009-11-22  Miguel de Icaza  <miguel@novell.com>
728         * file-io.c: Surface a smart FindFirst/FindNext/FindClose API to
729         the managed world.
731         * icall-def.h: New entry points.
732         
733 2009-11-19  Mark Probst  <mark.probst@gmail.com>
735         * process.c: Don't put references to managed objects into a
736         g_ptr_array.
738 2009-11-18  Sebastien Pouliot  <sebastien@ximian.com>
740         * class.c (can_access_internals): Allow CoreCLR to participate in
741         allowing (or not) [InternalsVisibleTo] between assemblies.
742         * security-core-clr.c|h: Make sure that only trusted code (a 
743         superset of platform code) can access the internals of platform
744         code.
746 Mon Nov 16 16:28:11 CET 2009 Paolo Molaro <lupus@ximian.com>
748         * reflection.c: use the correct base class to get the virtual method
749         "get_UnderlyingSystemType" and speed up the icall. Fixes bug #555013.
751 2009-11-16  Sebastien Pouliot  <sebastien@ximian.com>
753         * security-core-clr.c (get_caller_no_reflection_related): 
754         [Mono]Type.InvokeMember is outside System.Reflection[.Emit] but
755         it's still reflection and must be filtered correctly.
757 2009-11-16  Mark Probst  <mark.probst@gmail.com>
759         * object.c (compute_class_bitmap): Fix for large bitmaps.
761 2009-11-15  Zoltan Varga  <vargaz@gmail.com>
763         (mono_gc_get_suspend_signal): Fix the build with a system libgc.
765         * boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
766         koush@koushikdutta.com). Disable GC_no_dls on android.
768 2009-11-12  Mark Probst  <mark.probst@gmail.com>
770         * sgen-gc.c (find_tlab_next_from_address): Handle the case where
771         tlab_next points outside the TLAB because the allocator was
772         interrupted.
774 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
776         * reflection.c (mono_image_module_basic_init): Handle exceptions correctly.
778 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
780         * object-internals.h: Change signature for mono_string_to_utf8_image.
782         * object.c (mono_string_to_utf8_image): Change signature to take a MonoError
783         argument.
785         * reflection.c: Take care of mono_string_to_utf8_image change and avoid raising
786         exceptions due to mono_string_to_utf8.
788 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
790         * object-internals.h: Change signature for mono_string_to_utf8_mp.
792         * object.c (mono_remote_class): Make sure all resources are released before
793         raising an exception.
795         * object.c (mono_print_unhandled_exception): Avoid raising an exception.
797 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
799         * mono-perfcounters.c (network_get_impl): Change variable initialization
800         ordering to fix potential memory leak in case of exceptions.
802         * mono-perfcounters.c (mono_perfcounter_create): Properly handle badly
803         encoded strings.
804         
805 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
807         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): Change
808         variable initialization ordering to fix potential memory leak in case
809         of exceptions.
811 2009-11-09  Zoltan Varga  <vargaz@gmail.com>
813         * icall.c (mono_ArgIterator_Setup): Remove the MONO_ARCH_REGPARMS stuff, its not
814         needed.
816 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
818         * appdomain.c: Fix shadow path code to better deal with exceptions.
820 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
822         * appdomain.c: Use checked version of mono_string_to_utf8 to avoid raising an
823         exception in the middle of the runtime code.
825 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
827         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): Don't
828         leak memory with broken envvar value.
830 2009-11-06  Mark Probst  <mark.probst@gmail.com>
832         * reflection.c (mono_reflection_setup_internal_class): Because
833         nested classes are not added to the name cache, we must put them
834         in the reflection_info_unregister_classes list.
836 2009-11-05  Sebastien Pouliot  <sebastien@ximian.com>
838         * class.c: When CoreCLR is enabled don't call mono_init_com_types
839         if MONO_CLASS_IS_IMPORT return true unless the type reside in 
840         platform (trusted) code. Instead we return a TypeLoadException to
841         be thrown later. This is the exception thrown by Silverlight 2 if
842         a type, inside application (user) code is marked with [ComImport]
844 2009-11-05  Zoltan Varga  <vargaz@gmail.com>
846         * icall.c (ves_icall_System_Diagnostics_Debugger_IsAttached_internal): Call
847         mono_is_debugger_attached () too.
849         * mono-debug.c (mono_is_debugger_attached): New helper function.
850         (mono_set_is_debugger_attached): Ditto.
852 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
854         * object-internals.h: Add mono_string_to_utf8_checked.
856         * object.c: Implement mono_string_to_utf8_checked.
858 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
860         * class.c: Add missing check for load errors after every
861         call to mono_class_setup_fields
863         Fixes #552282.
865 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
867         metadata-verify.c (verify_tables_schema): Fix the error message.
869 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
871         * metadata.c: Change event table schema to use TDOR for event type
872         as this is what it's meant to be.
874         * metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
875         to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
876         entry.
878         * metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
879         longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
880         rows in MONO_TABLE_GENERICPARAM.
882         Fixes #552289.
884 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
886         * class.c (mono_image_add_to_name_cache): Assert on duplicate
887         insertion.
889         * reflection.c (mono_reflection_setup_internal_class): Avoid
890         registering a gc root the same MonoClass multiple times.
891         Don't register nested types on the global scope as they should
892         not be available there.
894 2009-11-05  Rolf Bjarne Kvinge  <RKvinge@novell.com>
896         * culture-info-tables.h: regenerated.
898 2009-11-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
900         * debug-helpers.c: avoid g_strdup() in mono_type_full_name().
902 2009-11-04  Sebastien Pouliot  <sebastien@ximian.com>
904         * string-icalls.c|h: Remove string internal calls that are not 
905         used anymore by the class libraries.
906         * icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
907         which is not used in the class librairies.
908         * icall-def.h: Update tables.
910 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
912         * class.h: Move mono_class_inflate_generic_type_checked...
914         * class-internals.h: to here and make it internal. We don't want to
915         further expose MonoGenericContext. 
917 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
919         * verify.c (mono_method_verify): Improve error message.
921 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
923         * reflection.c (fieldref_encode_signature): If field_image is NULL then
924         the token is already properly encoded. Fixs 4.0 build.
926 2009-11-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>
928         * locales.c (construct_number_format): Check if the number index is
929         valid before trying to use it, if not, just return.
930         
931 2009-11-04  Zoltan Varga  <vargaz@gmail.com>
933         * marshal.c (mono_marshal_get_runtime_invoke): Don't reset abort exceptions,
934         since that loses the abort state. Fixes #539394.
936 2009-11-03  Zoltan Varga  <vargaz@gmail.com>
938         * marshal.c (mono_marshal_get_native_wrapper): For icall wrappers, add an
939         explicit this argument to the call signature.
940         (mono_marshal_get_icall_wrapper): Ditto.
942 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
944         * reflection.c (fieldref_encode_signature): Add new field_image parameter
945         to indicate which assembly to use when resolving a custom-mod.
947         Fixes handling of volatile fields used across assemblies as reported in #551513.
949 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
951         * loader.c: Improve error messages.
953 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
955         * class.c (mono_class_setup_methods): Only give a slot for virtual methods
956         of interfaces. Fixes IKVM.
958         * class.c (mono_class_setup_vtable_general): Improve debug spew.
960 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
962         * verify.c (verifier_inflate_type): Return the inflated type on success.
964 2009-11-02  Zoltan Varga  <vargaz@gmail.com>
966         * debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.
968         * threads.c (mono_thread_attach): Call the profiler thread start callback.
970         * object-internals.h (_MonoThreadInternal): Add a 'flags' field.
972         * threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
973         flag set.
975         * profiler.c: Add new profiler callbacks for runtime invoke.
977         * object.c (mono_runtime_invoke): Call the runtime invoke callbacks.
979 2009-11-01  Mark Probst  <mark.probst@gmail.com>
981         * sgen-gc.c: Keep track of the reason for a major collection and
982         write it to the heap-dump file.
984 2009-10-31  Miguel de Icaza  <miguel@novell.com>
986         * threads.c: refactor the code that initializes the
987         thread_start_args into a reusable function and use this in the two
988         methods that start up threads.
990 2009-10-31  Zoltan Varga  <vargaz@gmail.com>
992         * appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
993         Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
995 2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
997         * mono-perfcounters.c: add the "_Total" instance for CPU counters.
998         Until now, we only had the per-cpu(core) counters.
1000 2009-10-28  Mark Probst  <mark.probst@gmail.com>
1002         * gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
1003         mono_gc_get_suspend_signal(), which returns the suspend signal
1004         number used by the GC.
1006 2009-10-25  Zoltan Varga  <vargaz@gmail.com>
1008         * threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.
1010         * threads.c (start_wrapper): Call mono_profiler_thread_start () later after
1011         signalling start_notify.
1013 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
1015         * appdomain.c: do not test the st_mode field for shadow-copies.
1016         Fixes bug #545276.
1018 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
1020         * threadpool.[ch]: added hooks for thread start/finish and item
1021         processing begin/end. For monotouch use only.
1023 2009-10-24  Zoltan Varga  <vargaz@gmail.com>
1025         * threads.c (mono_thread_get_name): New helper function.
1027         * reflection.c (resolve_object): Set handle_class for strings too.
1028         (mono_reflection_create_custom_attr_data_args): New helper function to decode
1029         a cattr blob into a set of arrays and structures without creating the custom
1030         attributes themselves.
1031         (create_custom_attr_data): Simplify using create_custom_attr_data_args.
1033         * mono-debug.c (mono_debug_il_offset_from_address): New helper function.
1035         * debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
1036         function.
1038 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1040         * verify.c: Replace calls to mono_class_inflate_generic_type with
1041         mono_class_inflate_generic_type_checked. Fixes #480005.
1043 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1045         * class.c (mono_class_inflate_generic_type_with_mempool): Clear the error
1046         object since not all paths lead to callees initing it.
1048 2009-10-23  Alp Toker  <alp@nuanti.com>
1050         Fix embedding API breakage from r144688. mono-compiler.h is an internal
1051         header and should not be shipped:
1053         * class.h: Back out MONO_DEPRECATED change. Currently depends on config.h
1054         which is specific to the mono build. Not going to work.
1056 2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
1058         * security-manager.c: Report if core-clr is active from
1059         ves_icall_System_Security_SecurityManager_get_SecurityEnabled
1060         to allow Moonlight BCL to behave appropriately (both in browser
1061         and outside, e.g. smcs)
1063 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
1065         * mono-config.c: ignore UTF-8 BOM and report parser errors.
1066         Fixes bug #549108.
1068 2009-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1070         * class.c: fix typo.
1072 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
1074         * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
1075         a MonoError parameter.
1077         * class.h: Mark mono_class_inflate_generic_type deprecated, add new mono_class_inflate_generic_type_checked
1078         version that can does proper error handling.
1080         * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
1082         * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
1084         * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.
1086 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
1088         * debug-helpers.c (dis_one): Fix the disassembly of empty strings when
1089         NO_UNALIGNED_ACCESS is defined.
1091 2009-10-22  Zoltan Varga  <vargaz@gmail.com>
1093         * marshal.c (mono_string_builder_to_utf16): Applied patch from
1094         Hib Eris  <hib@hiberis.nl>. Return empty string for empty string builders.
1095         Fixes #549173.
1097 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1099         * sgen-gc.c: Shorten sections whenever possible.
1101 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1103         * sgen-gc.c: Use our portable semaphore #defines.
1105 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1107         * sgen-gc.c: A debug option for dumping the heap layout to a file
1108         after each collection.
1110 2009-10-21  Mark Probst  <mark.probst@gmail.com>
1112         * sgen-gc.c: Make managed write barriers atomic via
1113         thread-restarts.
1115 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
1117         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
1118         methods. Fixes #543021.
1120 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
1122         * socket-io.[ch]: fix VS build.
1124 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
1126         * icall-def.h:
1127         * socket-io.[ch]: implemented SendFile.
1129 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
1131         * class.c (mono_class_create_from_typedef): Initialize class->element_class
1132         before the interfaces to avoid crashes later if class initialization fails.
1133         Fixes #548417.
1135         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
1136         Fixes #548276.
1138 2009-10-20  Marek Safar  <marek.safar@gmail.com>
1140         * domain.c: Bump 4.0 version.
1142 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
1144         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
1145         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
1146         check since 'pubkey' can't be NULL at this stage
1147         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
1148         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
1149         initialization of 'iter'
1151 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
1153         * cominterop.c : Search the interface parts of vtable to find 
1154           method matches.  Fixes 547030.
1156         Code is contributed under MIT/X11 license.
1158 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
1160         * marshal.c: BeginInvoke cannot be called on multicast delegates with
1161         multiple targets. Fixes bug #574426.
1163 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
1165         * profiler.h: Put here the definition of
1166         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
1167         (and fix the build...).
1169 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
1171         * profiler.c, profiler.h, profiler-private.h:
1172         Added support for different ways of getting call chains in stat mode.
1174 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1176         * object.c, object-internals.h: New function for computing the
1177         size of an array, factored out of mono_array_new_full().  Use
1178         SGen's functions for allocating arrays and vectors.
1180         * sgen-gc.c, gc-internal.h: Special functions for allocating
1181         arrays and vectors without race conditions.  A managed array
1182         allocator method.
1184         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
1186 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1188         * object.c, object.h, icall.c: Write barriers do the copying now,
1189         as well, so no need for an additional memcpy.
1191         * sgen-gc.c: Lock when storing remsets.  Do the memory
1192         copying/moving in the write barriers.
1194         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
1196         * reflection.c: Added an assert.
1198 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1200         * threads.c, process.c: A few missing write barriers.
1202 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
1204         * mono-perfcounters.c, mono-perfcounters-def.h: Add
1205         network performance counters for bytes sent per second, bytes
1206         received per second, and bytes total per second.
1208         Code is contributed under MIT/X11 license.
1210 2009-10-09  Mark Probst  <mark.probst@gmail.com>
1212         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
1213         Fix warning.
1215 2009-10-09  Mark Probst  <mark.probst@gmail.com>
1217         * threads.c, object-internals.h, object.c: Move code for
1218         transferring an object to a different domain (via
1219         serialization/remoting) to object.c.
1221         * object.c (call_unhandled_exception_delegate): If the exception
1222         is in a different domain than the delegate, transfer the exception
1223         to that domain.
1225 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
1227         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
1228         Fixes #322934.
1230 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
1232         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
1234 2009-10-06  Mark Probst  <mark.probst@gmail.com>
1236         * object.c (mono_method_return_message_restore): Handle the case
1237         where the argument is an instance of a generic type.  Fixes
1238         #544446.
1240 2009-10-06  Mark Probst  <mark.probst@gmail.com>
1242         * object.c (set_value): Write barrier fix - we must pass the
1243         count, not the size.
1245 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
1247         * domain.c (mono_init_internal): Print a useful error message when encountering
1248         an old mscorlib, instead of crashing. Fixes #544307.
1250 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
1252         * appdomain.c (copy_app_domain_setup): Fix a warning.
1254         * debug-helpers.c (dis_one): Ditto.
1256 2009-10-04  Mark Probst  <mark.probst@gmail.com>
1258         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
1259         into the new domain, instead of referencing the original one.
1261         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
1262         non-static.
1264         * appdomain.c: Corlib version bump.
1266 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1268         * threadpool.c: one more...
1270 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1272         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
1273         threads to die because we're shutting down. delgate5.exe works again.
1275 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
1277         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
1278           ccw_interface_hash table when a ccw is finalized.
1280         Code is contributed under MIT/X11 license.
1282 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1284         * assembly.c, domain.c, image.c, metadata-internals.h: Split
1285         domain and image unloading into two steps.  We must do this
1286         because clearing the domain in SGen requires the class metadata to
1287         be intact, but we need to free the mono_g_hash_tables in case a
1288         collection occurs during domain unloading and the roots would trip
1289         up the GC.
1291 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1293         * object-internals.h: Remove serialized culture fields from
1294         MonoInternalThread.
1296         * icall-def.h, thread-types.h, threads.c: Remove serialized
1297         culture icalls.
1299         * appdomain.c: Corlib version bump.
1301 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
1303         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
1304         Fixes #543133.
1306 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1308         * sgen-gc.c: Try to shorten the new section after a major
1309         allocation to avoid ever-growing sections.
1311 2009-10-13  Martin Baulig  <martin@ximian.com>
1313         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
1314         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
1315         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
1316         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
1318         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
1320 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
1322         * threadpool.c: fixed the order in which 'completed' and the wait
1323         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
1324         No need to use the wait_handle field of ASyncCall. Make sure the
1325         threadpool is active when adding a job or queueing an idle thread.
1327 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
1329         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
1331         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
1332         when using --compile-all.
1334 2009-09-27  Mark Probst  <mark.probst@gmail.com>
1336         * metadata.c (free_generic_class): Unregister the field_objects
1337         roots if we're using SGen.
1339 2009-09-27  Mark Probst  <mark.probst@gmail.com>
1341         * reflection.c (mono_dynamic_image_free): Deregister the GC root
1342         for GenericParamTableEntry.gparam.
1344 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
1346         * marshal.c: don't create the handle when calling. It is created later
1347         if needed.
1349 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1351         * sgen-gc.c: Warning fixes.
1353 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1355         * sgen-gc.c: New debug option "xdomain-checks", which scans the
1356         whole heap for cross-domain references before each collection.
1358         * sgen-scan-object.h: The scan action can now use SCAN to scan the
1359         object.
1361         * threadpool-internals.h, threadpool.c: New function
1362         mono_thread_pool_is_queue_array() for checking whether a given
1363         array is used as a (cross-domain) queue by the thread pool code.
1365 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1367         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
1368         searches the whole heap for objects containing a specific
1369         reference.  Only for debugging.
1371 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1373         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
1375         * icall-def.h, threads.c, threads-types.h: New icalls for copying
1376         byte arrays between domains.
1378 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1380         * threadpool.c:
1381         * class-internals.h:
1382         * mono-perfcounters-def.h:
1383         * mono-perfcounters.c:
1384         -There is a list of idle threads
1385         -Each of those idle threads wait on their own WaitHandle instead
1386         of all of them using the same semaphore. When a new work item is
1387         added, the job is assigned directly to an idle thread or a newly
1388         created one if possible and then the handle for that thread is
1389         signaled. Compare that to the current approach where all the
1390         threads in the pool compete to dequeue a job from the same
1391         queue.
1392         -New struct ThreadPool that brings together the bunch of static
1393         variable for each threadpool (IO and regular).
1394         -New performance counters: # of items added and its rate per
1395         threadpool. The rate will be used later, perhaps together with
1396         other perf. counters, to decide when idle threads should exit.
1398 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
1400         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
1401         Fix typo on Windows build.      
1402         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
1403         
1404         Code is contributed under MIT/X11 license.
1406 2009-09-25  Mark Probst  <mark.probst@gmail.com>
1408         * object-internals.h: The Thread class is split up into Thread and
1409         InternalThread now.  We have exactly one InternalThread per
1410         thread, and at most one Thread per appdomain per thread.  Most
1411         data is stored in InternalThread.  All InternalThread objects live
1412         in the root domain.
1414         * class-internals.h: Add internal_thread_class to MonoDefaults.
1416         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
1417         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
1418         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
1419         resulting from the split of the Thread class.
1421         * gc-internal.h: Prototype for new function for checking whether a
1422         thread is the finalizer thread.
1424         * appdomain.c: Corlib version bump.
1426 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
1428         * appdomain.c|h: Add a mono_domain_try_unload method which is
1429         equivalent to mono_domain_unload, except that it returns an exception
1430         instead of throwing it. Make mono_domain_unload use the
1431         mono_domain_try_unload method to avoid code-duplication.
1433 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
1435         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
1436         a problem.
1438 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
1440         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
1441         aborting when a conversion is not implemented.
1443 2009-09-23  Miguel de Icaza  <miguel@novell.com>
1445         * verify.c: when comparing culture strings, use g_ascii_strcmp
1447         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
1448         when comparing public key tokens to use memcmp on 16 bytes.   I do
1449         not believe this ever worked as advertised in the past.
1451         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
1452         which would have always failed earlier.
1454 2009-06-25  Miguel de Icaza  <miguel@novell.com>
1456         * gc.c: Raise a NullArgumentException if the object passed is
1457         null.
1459 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
1461         * image.c (mono_image_close): Atomically decrement the reference count and
1462         remove the image from the hash tables, to prevent another thread from seeing a
1463         dying MonoImage. Fixes #541194.
1465 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1467         * threadpool.c: actually use the minimum number of 'completion ports'
1468         (for us is just a potential worker thread).
1470 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1472         * threadpool.c: remove ares_htable. It does not make sense any more
1473         since the same objects are now stored in GC-tracked arrays while they are
1474         in the queue.
1476 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1478         * threadpool.c: increase the minimum length of the queues to 128.
1479         Remove warning.
1481 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
1483         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
1484         return the modified signature used by string ctors.
1486 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
1488         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
1489         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
1490         method, to be used by full-aot.
1492 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
1494         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
1495         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
1496         be known to be good.
1498         * class.c (mono_class_init): Fail array types if their element type fails initialization
1499         as well.
1501         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
1502         initialization, additionally we request the element_type vtable to be initialized as well.
1504         This is fine and should not increase the working set in any meaningful way since it's reasonable
1505         to assume       that most code will create an array and eventually populate it, which will require the
1506         type's vtable to be initialized.
1508         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
1510 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
1512         * normalization-tables.h : regenerated.
1514 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
1516         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
1517         a leb128 encoding can take up to 5 bytes.
1519 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
1521         * class.c (verify_class_overrides): Remove useless argument.
1523         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
1524         before interface enumeration as this is no longer required.
1526 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
1528         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
1529         used under mono_class_init context. This functions avoid any code path that
1530         calls mono_class_init, which leads it to be slow as some things like the interface
1531         bitmap are not available.
1533         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
1534         of it's own broken version. Fixes the verifier part of #538588.
1536         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
1537         API.
1539 2009-09-15  Mark Probst  <mark.probst@gmail.com>
1541         * class.c (mono_class_init): Always set an exception in a class if
1542         vtable setup fails.  Fixes #538577.
1544         * generic-sharing.c: Raise an exception if mono_class_vtable()
1545         returns NULL.
1547 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
1549         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
1550         methods of vtypes, as they could be incorrectly shared with static methods
1551         taking an IntPtr argument.
1553 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
1555         * domain.c:
1556         * object.c:
1557         * class-internals.h: renamed waithandle_class to
1558         manualresetevent_class.
1559         * marshal.c: propagate the exception if a remoting BeginInvoke call
1560         fails.
1562 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1564         * object.c: Properly handle vtable failures.
1566 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1568         * socket-io.c: Assert on vtable failure.
1570         * mono-mlist.c: Assert on vtable failure.
1572 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1574         * marshal.c: Assert on vtable failure.
1576 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1578         * icall.c: Properly handle vtable failures.
1580 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1582         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
1584 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1586         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
1588         * console-unix.c (do_console_cancel_event): Same.
1590 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1592         * class-internals.h: Add mono_class_vtable_full function that allows control
1593         if an exception should be raised or not.
1595         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
1596         to do what its documentation say, that is to return NULL and set exception_type on
1597         failure.
1599         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
1600         and change the code to honor it.
1602 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1604         * verify.c: Fix typo in error message.
1606 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
1608         * security-core-clr.c: Fix default_platform_check so it can run
1609         the runtime coreclr tests (without an infinite recursion when
1610         throwing an exception).
1612 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1614         object.c (mono_delegate_ctor_with_method): Guard against null method.
1616 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1618         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
1619         that should be replaced with error handling later.
1621 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1623         * marshal.c (mono_delegate_end_invoke): Fix warning.
1625 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1627         * loader.c (mono_field_from_token): Properly handle invalid
1628         dynamic tokens.
1630 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1632         * pedump.c (verify_image_file): Skip types that can't be
1633         decoded.
1635 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1637         * verify.c: Look for recursive valuetypes only against the
1638         type been initialized as this is a lot simpler and works.
1640 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1642         * verify.c: Ensure that fields are properly loaded before
1643         checking them.
1645 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
1647         * object.c (mono_object_get_virtual_method) : Call 
1648           mono_cominterop_get_invoke if the object is a COM object.
1650         Code is contributed under MIT/X11 license.
1652 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
1654         * verify.c: Check for recursive valuetype definitions.
1656 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
1658         Use inheritance-aware interface offsets. Inherited types use the same offsets
1659         of their parents. This reduce offset duplication in case more than one type in
1660         the inheritance tree explicitly implements the same interface.
1662         This also removes a source of vtable bubbles found in #532409. An abstract type
1663         isn't required to provide abstract methods to all interfaces it implements, which
1664         resulted in a bubble with the previous scheme as the child would get a non-full
1665         vtable from its parent. We fail all concrete types with vtable bubbles, so this
1666         should be fixed.
1668         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
1669         it's expected to not cause any significant increase beyond that.
1671         * class.c (setup_interface_offsets): Compute super class iface offsets
1672         first to force sharing.
1674         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
1675         dumping only the relevant ones.
1677         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
1678         methods a new slot regardless if they belong to an interface or not. This allows
1679         an inherited type to override the iface method separately from the class one.
1681 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
1683         * threadpool.c: make the Sleep() alertable to prevent delays exiting
1684         applications that take less than 2s to execute.
1685         Bug #524984 fixed.
1687 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
1689         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
1691         * object.c (mono_get_runtime_callbacks): New helper function to return
1692         the runtime callbacks.
1694         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
1695         mono_get_runtime_build_info () as the display name.
1696         
1697 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
1699         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
1700         argument, since NEWARR expects a native int. Fixes #481559.
1702 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
1704         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
1705         against broken SRE methods.
1707 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
1709         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
1710         a NULL variable. Abort early on failure.
1712 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
1714         * class.c (can_access_type): Fail visibility test for non nested
1715         types with nested visibility.
1717 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
1719         * assembly.c (parse_public_key): Avoid allocating (and not 
1720         freeing) the public key array when it's not requested by the 
1721         caller.
1722         * threads.c (mono_thread_manage, mono_thread_create_internal, 
1723         ves_icall_System_Threading_Thread_Thread_internal): Free 
1724         allocated memory on error.
1726 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
1728         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
1730 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
1732         * class.c (mono_class_setup_fields): Remove duplicated local variable
1733         named gklass.
1734         Rename gklass to gtd to reflect the fact that it points to the generic
1735         type definition.
1736         Remove the duplicated call to mono_class_setup_fields on gtd and move
1737         the error check to the beginning.
1739 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
1741         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
1742         Remove cruft of the previous patch.
1744 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1746         * metadata-verify.c (verify_method_table): Check for abstract + final.
1747         Fixes #534175.
1749 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1751         * verify.c (verify_class_fields): Check for duplicate fields.
1753 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1755         * metadata-verify.c: Verify the typeref table for duplicates.
1757 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
1759         This reverts r140936 and properly handles interfaces with static methods. The
1760         right fix is to ensure vtables without bubles which is an easier to verify
1761         constraint. We should avoid such special cases as of the reverted patch as those
1762         only make the runtime more brittle.
1764         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
1765         static methods on interfaces.
1767         * class.c (setup_interface_offsets): Use the number of virtual methods when
1768         calculating interface offsets instead of the number of methods. This way we
1769         avoid bubles on the layout.
1771 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
1773         * metadata-verify.c (verify_metadata_header): Some very smart
1774         obfuscators like to add extra stream headers. Ignore them.
1776 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
1778         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
1779         methods correctly.
1781 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
1783         * metadata-verify.c: Verify for duplicated types.
1785 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
1787         * metadata-verify.c (verify_typedef_table): Verify for nested types
1788         without an entry on the nested class table.
1790 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
1792         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
1793         <tom_hindle@sil.org>. Add locking around hash table accesses.
1795 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1797         * verify.c (mono_verifier_verify_class): Verify all interface if
1798         really are interfaces. Fixes #534184.
1800 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
1802         * pedump.c: Initialize all types during metadata validation so we report
1803         errors only detected as part of class initialization.
1805 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
1807         * metadata-verify.c (verify_method_table): PInvoke requires method to
1808         be static. Fixes #534189
1810 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
1812         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
1813         being NULL.
1815 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1817         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
1818         for holes or bad methods. Fixes #525314.
1820 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1822         * class.c (setup_interface_offsets): Don't allocate slot
1823         for the same interface multiple times. This creates bubbles
1824         that waster space and make vtable verification harder.
1826         The same interface get a slot multiple times since we need
1827         to get the closure of all implemented interfaces, which means
1828         the same interface is reported multiple times.
1830 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1832         * verify.c (mono_verifier_verify_class): Don't check the fields
1833         of generic instances since the context on which they got expanded
1834         might lead to false positives.
1836         Such thing happens when a generic type is inflated in the context
1837         of a generic method and the inflated type of a field turns into a
1838         generic method argument, which causes the checking code to think
1839         it's an invalid class when it's not.
1841 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
1843         * verify.c (mono_type_is_valid_in_context): Verify if type
1844         is NULL and remove duplicate test.
1846 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1848         * verify.c (mono_verifier_verify_class): Check fields for
1849         invalid generic arguments.
1851 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1853         * class.c (verify_class_overrides): Verify if for static
1854         and non virtual methods.
1856 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1858         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
1859         Check for errors after retrieving the vtable.
1861 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1863         * class.c (mono_class_setup_vtable_general): Verify
1864         if method overrides are valid before processing them.
1866 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1868         * marshal.c (mono_array_to_lparray): Fix minimal build with
1869         cominterop disabled.
1871         * marshal.c (mono_free_lparray): Same.
1873 2009-08-21  Mark Probst  <mark.probst@gmail.com>
1875         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
1876         the hash function for the ares_htable.
1878 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
1880         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
1881         bit for assembly flags. MS is ok with it but there is no spec anywhere
1882         on its mean
1884 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1886         * class.c (mono_class_create_from_typedef): Emit profiler events
1887         in all cases.
1889 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1891         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
1892         Release memory on failure.
1894 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1896         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
1897         to the internal API.
1899         * metadata.c (get_constraints): Use a single-linked table as we don't
1900         traverse it backward. Fail and return FALSE if only of the contraint types
1901         is not found.
1903         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
1904         to mono_metadata_load_generic_param_constraints except for having a return value.
1905         This has to be done since the later is part of the public API.
1907         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
1908         and fail the type.
1910         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
1911         and fail the method.
1913 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1915         * metadata-verify.c (is_valid_method_header): Add work-around to deal
1916         with MS broken behavior of emmitting EH section sizes without the
1917         header size added.
1919 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1921         * metadata.c (mono_type_create_from_typespec): Don't allocate image
1922         memory until we're sure that we'll need it. This avoids leaking for
1923         broken types or duplicated instantiation.
1925 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1927         * metadata-verify.c (is_valid_method_header): Fix stupid formating
1928         mistake.
1930 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1932         * metadata-verify.c (is_valid_method_header): Fix number of clauses
1933         and expected size calculation.
1935 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1937         * class.c (mono_class_get_field_idx): Add fixme for broken
1938         behavior for types with multiple fields with the same name.
1939         I would rather fix it, but have no idea on how to generate
1940         such artifact for testing.
1942 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1944         * verify.c (verifier_load_field): We should allow references to
1945         fields to be made using the generic type definition. It's up to
1946         the loader system to fail invalid ops.
1948         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
1949         are invalid.
1951 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1953         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
1955         * metadata-internals.h: Fix declaration of 
1956         mono_metadata_interfaces_from_typedef_full.
1958         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
1959         heap_alloc_result parameter that controls if the result should be
1960         g_malloc'd.
1962         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
1963         array be g_malloc'd and properly document this public API function.
1965 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1967         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
1968         remove METHOD_HEADER_TINY_FORMAT1.
1970         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
1972         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
1974         Both spec and MS uses only 2 bits to enumerate the kind of header.
1975         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
1976         is superfluous, only used for tiny headers with odd code lengths.
1978         This change also make sure that mono doesn't wronly interpret bit 2
1979         of fat header flags, which is currently reserved.
1981 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1983         * metadata.c (do_mono_metadata_parse_type): Do error
1984         checking for element types. Don't abort if presented
1985         with a broken type kind.
1987 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1989         * metadata.c (mono_metadata_parse_method_signature_full):
1990         Gracefully fail bad vararg signatures.
1992 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1994         * profiler.c:
1995         * class.c: Fix warnings for uninitialized variables.
1997 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1999         * icall.c: Fix _NSGetEnviron method declaration warning.
2001 2009-08-18  Christian Hergert  <chris@dronelabs.com>
2003         * icall.c:
2004         * reflection.c: Make bitwise checks explicit.
2006 2009-08-18  Christian Hergert  <chris@dronelabs.com>
2008         * debug-helpers.c:
2009         * marshal.c: Fix printf warnings.
2011 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
2013         * reflection.c (encode_cattr_value): Fix a warning.
2015 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2017         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
2018         of array bounds.
2020 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2022         * loader.c (mono_method_signature): Don't assert on broken
2023         signature. Print a more useful error message.
2025 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2027         * loader.c (mono_method_get_marshal_info): Assert if
2028         signature is invalid. Bounds check stores to the
2029         mspecs array;
2031 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2033         * loader.c (field_from_memberref): Fix warning.
2035 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2037         * loader.c (mono_method_get_param_names): Check if signature
2038         is null. Don't store beyond the size of the name array.
2040 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2042         * loader.c (mono_get_method_constrained): Check if signature
2043         is null.
2045 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2047         * loader.c (mono_loader_set_error_bad_image): Improve
2048         error messages.
2050 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2052         * loader.c (mono_get_method_full): Convert an assertion
2053         into a loader error.
2055 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2057         * class-internals.h, class.c: Better naming and documentation.
2059 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
2061         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
2062         obj is NULL.
2064 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2066         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
2067         parsing fails.
2069 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2071         * loader.c (mono_loader_error_prepare_exception): Handle missing field
2072         errors with no class set.
2074         * loader.c (field_from_memberref): If the field signature is of the wrong
2075         type fail with a MissingFieldException instead of a BadImageException as
2076         this is the behavior observed on MS. 
2078 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2080         * loader.c (field_from_memberref): Don't crash if either the field
2081         signature or the typespec class are invalid.
2083 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2085         * verify.c (verifier_load_field): Don't allow field related
2086         ops to reference fields on generic type definition.
2088 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2090         * metadata-verify.c: Add new warning level for errors specified
2091         by ECMA 335 but that MS ignores.
2093         * metadata-verify.c (verify_method_table): Make compiler controled
2094         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
2095         this check is safe because the end result will only be some visibility
2096         exceptions been thrown.
2098 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2100         * verify.c (get_boxable_mono_type): Don't allow the
2101         use of the generic type definition on boxed type positions.
2103         Fixes #531237.
2105 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2107         * threadpool.c: Make sure no cross-domain references remain in
2108         ares_htable or the arrays that are thrown away when resizing.
2110 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2112         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
2113         list of classes for which we have to unregister reflection_info
2114         with the GC and which are not in the namespace cache.
2116         * reflection.c (mono_reflection_initialize_generic_parameter): Add
2117         the class to the list.
2119 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2121         * domain.c (mono_domain_free): Unregister the GC roots in
2122         MonoDomain.
2124 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
2126         * reflection.c (mono_reflection_type_get_handle): Fix typo.
2128 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
2130         * class.c: Add mono_class_get_field_from_name_full which does
2131         the same as mono_class_get_field_from_name but does check field
2132         signature as well.
2134         * class-internals.h: Export mono_class_get_field_from_name_full as
2135         part of the internal API.
2137         * loader.c (field_from_memberref): Search fields by name and signature
2138         as it's valid to have two fields with same name but different types.
2140         Fixes #528055.
2142 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
2144         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
2146         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
2148         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
2149         System.Type.
2151 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
2153         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
2155         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
2157 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2159         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
2160         to sgen-scan-object.h, which can be included and parameterized via
2161         macros.
2163         * Makefile.am: sgen-scan-object.h added.
2165 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2167         * gc.c: #define GC_dont_gc if we're compiling with SGen.
2169 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2171         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
2172         before clearing a domain in the GC.
2174 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2176         * exception.c (mono_exception_from_name_domain): Actually create
2177         the exception in the specified domain.
2179         * appdomain.c (mono_domain_create_appdomain_internal): Create the
2180         OutOfMemoryException a bit later so that the domain is inialized
2181         "enough" that it works.
2183 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2185         * threads.c (thread_cleanup): Clean up the cached_culture_info
2186         array to prevent cross-domain references.
2188 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
2190         * metadata.c: more documentation for MonoType accessors.
2192 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
2194         Fix incorrect size definitions where the tail array isn't a list
2195         of pointers
2196         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
2197         define size.
2198         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
2199         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
2200         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
2202 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2204         * reflection.h:
2205         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
2207 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2209         * metadata.c:
2210         * loader.c:
2211         * metadata-internals.h:
2212         * method-builder.c:
2213         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
2215 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2217         * cominterop.c:
2218         * metadata.c:
2219         * metadata.h:
2220         * loader.c:
2221         * marshal.c:
2222         * reflection.c: #define for sizeof in MonoType and
2223         MonoMethodSignature.
2225 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2227         * domain.c:
2228         * domain-internals.h: add and use #define's instead of sizeof()
2229         for MonoJitInfo and MonoJitInfoTable.
2231 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2233         * object.c:
2234         * class.h: use #define instead of sizeof() for MonoRemoteClass.
2236 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
2238         * metadata.c:
2239         * metadata.h:
2240         * object.c:
2241         * class-internals.h:
2242         * generic-sharing.c:
2243         * marshal.c: use a #define instead of sizeof() for a few
2244         structures that use a zero-length array.
2246 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
2248         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
2249         to handle inflated generic methods.
2251         * appdomain.c: Bump corlib version.
2253         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
2254         instances.
2256         * reflection.c (fixup_method): Same
2258         * reflection.c (resolve_object): Same.
2260         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
2261         g_error and a decent message.
2263 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
2265         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
2266         from the object because it could not yet be available globally
2267         (it happens if the profiler tries to create a gchandle on the
2268         MonoThread object of a thread that is still registering itself
2269         with the runtime).
2271 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
2273         * reflection.c (mono_generic_class_get_object): Initialized the
2274         managed type arguments array.
2276         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
2278         * appdomain.c: Bump corlib version.
2280 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
2282         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
2283         #527902.
2285 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
2287         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
2288         Avoid a crash if synch_cs is not set.
2289         
2290         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
2291         Handle the case when the handle is 0.
2293         * appdomain.c: Bump corlib version.
2295 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
2297         * reflection.c (mono_type_get_object): Fix a warning.
2299 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2301         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
2302         descriptor here.  We assume it's already been computed.
2304         * generic-sharing.c (instantiate_other_info): Compute the GC
2305         descriptor for info type MONO_RGCTX_INFO_KLASS.
2307 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2309         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
2310         type, so don't use MONO_OBJECT_SETREF to set a field.
2312 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2314         * gc.c: We were missing one case where invoking a finalizer would
2315         not reset the domain.  Also, in the finalizer thread loop, assert
2316         that we're in the root domain.
2318 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2320         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
2321         if the type is not an array.
2323 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2325         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
2326         method bound to the declaring type of the method. Raise an exception
2327         if the type is not a generic param.
2329 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2331         * class.c (print_unimplemented_interface_method_info): Print the
2332         full type name.
2334         * class.c (mono_class_setup_vtable_general): When dealing with a
2335         generic instance first check if the generic type definition is
2336         not broken.
2338 2009-02-11 Tom Hindke <tom_hindle@sil.org>
2340         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
2342         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
2344         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
2346         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
2348         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
2350         Code is contributed under MIT/X11 license
2352 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
2354         * verify.c: Fix naming of stelem and ldelem.
2356 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2358         * generic-sharing.c: Replace the templates lock with the loader
2359         lock because of very hard to resolve deadlock issues.
2361 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
2363         * icall.c (ves_icall_Type_GetMethodsByName): Use 
2364         mono_class_get_vtable_size () instead of accessing klass->vtable_size
2365         directly. Fixes #525338.
2367         * class.c (mono_class_get_vtable_size): New helper function.
2369         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
2370         the field belongs to the type. Fixes #525733.
2372 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2374         * sgen-gc.c: When we stop a thread and its stack top is not within
2375         its allocated stack (because it's in an altstack signal handler),
2376         restart it and stop it again, until it is.
2378 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2380         * sgen-gc.c: Take a thread's stack top and registers from the
2381         sigcontext in the suspend signal handler.
2383         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
2384         stuff to sgen-archdep.h.
2386         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
2387         caller, because have code in sgen-archdep.h to acquire that data.
2389 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
2391         * profiler.c, profiler.h, profiler-private.h:
2392         Added support for keeping track of code chunks and buffers.
2394 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
2396         * metadata-verify.c: Fix endianness problems on decoding functions.
2397         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
2399 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2401         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
2402         schema for vectors and one dimension SZARRAY.
2404 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2406         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
2407         schema for vectors and one dimension SZARRAY.
2409 2009-07-27  Mark Probst  <mark.probst@gmail.com>
2411         * icall-def.h, thread-types.h, threads.c: New separate icalls for
2412         Interlocked.(Compare)Exchange with object arguments, which invoke
2413         write barriers.
2415 2009-07-26  Miguel de Icaza  <miguel@novell.com>
2417         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
2418         passed invalid arguments.   Fixes another crasher in the
2419         Silverlight test suite.
2421         * class.c (mono_class_array_element_size): Return 0 for the size
2422         of the class;  This fixes the crasher exposed by :
2424         typeof (void).MakeArrayType ();
2426         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
2427         if there is no method to dereference.    Put all the code that
2428         depends on this inside the if (method) block.
2430         This fixes the crasher exposed by Microsoft's Silvelright CLR test
2431         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
2433         With this change, we pass the test.
2434         
2435         * reflection.c (mono_reflection_sighelper_get_signature_local):
2436         Only dereference the assembly if it has been set.    Fixes a
2437         crasher exposed by #525328
2439 2009-07-25  Mark Probst  <mark.probst@gmail.com>
2441         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
2442         don't perform the store in mono_gc_wbarrier_generic_nostore().
2443         Remove the second argument (value), which is not needed.
2445 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
2447         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
2448         the build.
2450         * boehm-gc.c: Ditto.
2451         
2452 2009-07-24  Mark Probst  <mark.probst@gmail.com>
2454         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
2455         not perform the store itself.  Introduce
2456         mono_gc_wbarrier_generic_nostore(), which is the same as
2457         mono_gc_wbarrier_generic_store(), except it doesn't perform the
2458         store.
2460 2009-07-24  Mark Probst  <mark.probst@gmail.com>
2462         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
2463         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
2464         we still need the memcpy().
2466 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2468         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
2469         so that big arrays are handled correctly.  Always use
2470         safe_object_get_size() to calculate array object sizes, which
2471         takes bounds into account.
2473 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2475         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
2476         GC descriptor is computed before we use it.
2478 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2480         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
2481         write barrier if necessary.
2483 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2485         * icall-def.h, icall.c, thread-types.h: New separate icall for
2486         VolatileWrite(object&,object) that uses a write barrier.
2488         * console-unix.c, file-io.c, icall.c, threads.c: Use write
2489         barriers in icalls which write to "ref" or "out" arguments.
2491 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
2493         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
2494         handler in a separate icall, to reduce the size of the wrappers.
2496 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2498         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
2500 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2502         * metadata-verify.c (parse_field): Allow byref field.
2504         * metadata-verify.c (parse_locals_signature): Allow byref locals.
2506         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
2508 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2510         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
2511         Fixes #522784.
2513 2009-07-20  Robert Jordan  <robertj@gmx.net>
2515         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
2516         Fix invalid IL in valuetype handling (STOBJ must push the
2517         corresponding class). Fixes bug #523149.
2519         Code is contributed under MIT/X11 license.
2521 2009-07-20  Geoff Norton  <gnorton@novell.com>
2523         * gc.c: Use proper semaphores where available on posix and darwin.
2525 2009-07-19  Geoff Norton  <gnorton@novell.com>
2527         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
2529 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
2531         * refletion.c (is_sre_usertype): Change name to is_usertype and
2532         invert it's result so it returns true if the type is an user type
2533         and not the opposite.
2535         * reflection.c (is_*_type): Change all of those to use new macro
2536         check_corlib_type_cached that cached the type lookup so we don't
2537         need to do string comparisons all the type. Changed the signature
2538         to take a MonoClass instead.
2540         * reflection.c: Change mono_image_create_token and resolve_object
2541         to use is_sre_* functions.
2543 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2545         * sgen-gc.c: Check for writes to the stack in the managed
2546         wbarrier as well.
2548 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2550         * sgen-gc.c: When a thread is unregistered, don't free its remsets
2551         but put them on a list which is processed with the other thread's
2552         remsets.
2554 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2556         * sgen-gc.c: Fix and enable the internal allocator instead of
2557         using malloc/free (which causes deadlocks).
2559 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
2561         * refletion.c: Fix builds with SRE disabled by adding a minimal
2562         implementation of mono_reflection_type_get_handle.
2564 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2566         * refletion.c: Make mono_reflection_type_get_handle non static.
2568         * object-internals.h: Export mono_reflection_type_get_handle.
2570         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
2571         unmanaged handle using mono_reflection_type_get_handle.
2573 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2575         * refletion.c: Replace all reads of MonoReflectionType::type with
2576         calls to mono_reflection_type_get_handle. Only the functions that
2577         deal with constructing TypeBuilder::type have not been changed
2578         because they have to deal with NULL values.
2580         This is a first step into supporting reflection types that don't
2581         map directly into their unmanaged counterpart.
2583 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
2585         * metadata-verify.c (parse_locals_signature): Don't complain
2586         on signature with zero locals since MS generates it and doesn't
2587         bother with.
2589 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
2591         * reflection.c (mono_image_get_array_token): Resolve return
2592         type using mono_reflection_type_get_handle.
2594         * reflection.c (mono_image_get_array_token): Resolve array method
2595         parent type using mono_reflection_type_get_handle.
2597 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
2599         * reflection.c (mono_image_basic_init): Applied patch from
2600         <Dax@daxxfiles.net>. Set the public key token from the assembly
2601         builder. Fixes #518909.
2603         * appdomain.c: Bump corlib version.
2605 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
2607         * class.c (mono_class_needs_cctor_run): Make this return false if
2608         the class has no cctor.
2610 2009-07-13  Mark Probst  <mark.probst@gmail.com>
2612         * sgen-gc.c: When the minor GC needs to allocate a new section,
2613         invoke the major GC afterwards.
2615 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
2617         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
2618           Applying the window_style field to the SHELLEXECUTEINFO struct.
2620         Code is contributed under MIT/X11 license.
2622 2009-07-13  Mark Probst  <mark.probst@gmail.com>
2624         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
2625         locking earlier.  Fix it in the managed allocator by making sure
2626         that no thread is stopped there before the GC runs.  If we do stop
2627         a thread there, we restart it and let it run a but, until it stops
2628         somewhere else.
2630         * gc-internal.h, gc.c: Function for getting the IP from a signal
2631         context via a function registered by mini.
2633 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
2635         * object-internals.h (MonoIntPtr): New structure describing a boxed
2636         IntPtr.
2638         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
2639         returns. Fixes #519953.
2641         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
2643 2009-07-09  Mark Probst  <mark.probst@gmail.com>
2645         * class-internals.h, generic-sharing.c: New RGCTX info type for
2646         getting a remoting invoke with check wrapper.
2648 2009-07-07  Geoff Norton  <gnorton@novell.com>
2650         * icall-def.h: Fix the enable-minimal build.
2652 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2654         * object-internals.h: Add MonoReflectionDerivedType.
2656         * reflection.c: Implement support for PointerType.
2657         Fixed tons of warnings.
2659 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2661         * object-internals.h: Add MonoReflectionByRefType.
2663         * reflection.c: Implement support for ByRefType.
2665 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2667         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
2669         * object-internals.h: Add MonoReflectionArrayType and
2670         mono_reflection_create_unmanaged_type.
2672         * reflection.c: Implement support for ArrayType.
2674 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
2676         * metadata-verify.c (is_valid_method_header): Parse EH block
2677         flags correctly.
2679 2009-07-03  Mark Probst  <mark.probst@gmail.com>
2681         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
2682         processing the disappearing links, and process disappearing links
2683         in a loop until no new objects are copied.
2685 2009-07-03  Mark Probst  <mark.probst@gmail.com>
2687         * object.c (handle_enum): Invoke the write barrier when copying
2688         value type instances.
2690         * sgen-gc.c: Register remsets for unmanaged write barriers only
2691         when the address written to is actually on the heap.  This makes
2692         set_value() in object.c work without requiring that the result be
2693         on the heap.
2695 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
2697         The runtime wrappers are all bound to a given type that must
2698         exist in the same image. For regular images we use the <Module>
2699         type, which is required to exist for all images.
2701         The <Module> type can't be used for dynamic images because it
2702         might not exist at the time the wrapper is required, so we create
2703         a synthetic type to use instead.
2705         The current code works because of the 2 stage setup of MonoClass,
2706         but once this is gone it will no longer work.
2708         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
2710         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
2712         * object-internals.h: Export mono_image_set_wrappers_type icall
2713         as part of the internal API.
2715         * marshal.c (get_wrapper_target_class): If the image is dynamic,
2716         use MonoDynamicImage::wrappers_type instead of the <Module> type.
2718         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
2719         image wrappers_type to the provided value.
2721 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
2723         * appdomain.c (deregister_reflection_info_roots): No need
2724         to use the image lock here.
2726 2009-07-02  Mark Probst  <mark.probst@gmail.com>
2728         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
2730 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
2732         * threads.c: Store the thread start argument in a hash table instead of
2733         registering it as a root, as libgc doesn't support unregistering roots
2734         under windows, leading to 'too many root sets' errors when many threads
2735         are created.
2737         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
2738         shutdown, they can still be referenced by the other dying objects.
2739         Fixes #514506.
2741 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2743         * socket-io.c: DontLinger does not allow LingerOptions.
2745 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2747         * metadata-verify.c: The spec doesn't mention that it's possible to add
2748         custom attribute to a generic parameter. Fixed.
2750 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2752         * class.c (inflate_generic_type): Don't crash while trying to output a message
2753         on why we're aborting.
2755 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
2757         * socket-io.c: DontLinger can take an int or a boolean too.
2759 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
2761         * gc.c: check for a null argument to SuppressFinalize () and
2762         ReRegisterForFinalize ().
2764 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2766         * loader.c (method_from_methodspec): Call into the verifier to check
2767         the signature.
2769         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
2771         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
2772         part of the internal API.
2774 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2776         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
2777         the signature.
2779         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
2781         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
2782         part of the internal API.
2784 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2786         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
2787         the signature.
2789         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
2790         blob verification.
2792         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
2793         part of the internal API.
2795 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2797         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
2798         when doing basic verification. 
2800         This check must be done since the runtime peeks into signatures in much
2801         more places than it does decoding so it makes sense to ensure that all
2802         pointers to blob objects are well formed.
2804 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2806         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
2807         Use proper overflow dectection. Fix usage of it.
2809 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2811         * loader.c (field_from_memberref): Call into the verifier to check
2812         the signature.
2814         * loader.c (mono_method_get_signature_full): Same.
2816         * loader.c (method_from_memberref): Same.
2818         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
2820         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
2821         part of the internal API.
2823 2009-06-25  Mark Probst  <mark.probst@gmail.com>
2825         * threadpool.c (mono_thread_pool_add): If the domain is unloading
2826         or unloaded, still return an AsyncResult, but don't add it to the
2827         threadpool.
2829 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
2831         * threads.c: fix missing colon when DEBUG is defined.
2833 2009-06-25  Mark Probst  <mark.probst@gmail.com>
2835         * threadpool.c: Don't add new calls to a threadpool if the domain
2836         of the call is unloading or unloaded.  When dequeuing a job, null
2837         the reference in the queue.
2839 2009-06-25  Mark Probst  <mark.probst@gmail.com>
2841         * sgen-gc.c (null_link_in_range): Add the dislink for the old
2842         generation if an object was moved.
2844 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
2846         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
2847           parameters of type SAFEARRAY[VARIANT].
2849         * reflection.c (encode_marshal_blob): Properly generate element type
2850           (SafeArraySubType marshal attribute option).
2852         Code is contributed under MIT/X11 license.
2854 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
2856         * reflection.c: in mono_method_clear_object () really ensure all the
2857         objects are removed.
2859 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2861         * loader.c (mono_method_signature): Call into the verifier to check
2862         the method signature.
2864         * metadata-verify.c (verify_method_table): Move signature verification
2865         to verify_method_table_full.
2867         * metadata-verify.c: Add mono_verifier_verify_method_signature.
2869         * verify-internals.h: Export mono_verifier_verify_method_signature as
2870         part of the internal API.
2872 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2874         * loader.c (mono_method_get_header): Call into the verifier to
2875         check the method header.
2877         * metadata-verify.c: Add mono_verifier_verify_method_header.
2879         * verify-internals.h: Export mono_verifier_verify_method_header as
2880         part of the internal API.
2882 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2884         * class.c (mono_class_find_enum_basetype): Call into the verifier to
2885         check the field signature. Replace an assert with an explicit check.
2887         * class.c (mono_class_setup_fields): Call into the verifier to check
2888         the field signature.
2890         * metadata-verify.c: Add mono_verifier_verify_field_signature.
2892         * verify-internals.h: Export mono_verifier_verify_field_signature as
2893         part of the internal API.
2895 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2897         * class.c (mono_class_find_enum_basetype): Simplify this function
2898         by moving code outside of the loop and not decoding static fields.
2900 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2902         * metadata-verify.c (verify_typedef_table): Check the extends
2903         token here. Move to here a flags check from verify_typedef_table_full.
2905 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
2907         * metadata-verify.c (is_valid_method_header): Fix a warning.
2909         * metadata-internals.h (MonoImage): Remove the unused 
2910         static_rgctx_invoke_wrapper_cache.
2912         * image.c marshal.c: Ditto.
2914 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2916         * image.c (do_mono_image_load): Enable table data verification.
2918 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2920         * metadata-verify.c (is_valid_constant): Fix nullref check.
2922 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2924         * metadata-verify.c (is_valid_constant): Fix string bounds check.
2926 2009-06-22  Mark Probst  <mark.probst@gmail.com>
2928         * sgen-gc.c: Managed allocation with pthreads TLS.
2930         * threads.c, threads-types.h: Functions for the JIT to tell the
2931         runtime whether it supports the MONO_TLS opcode.
2933 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2935         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
2936         without methods.
2938 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2940         * metadata-verify.c (is_valid_constant): Fix the string length check.
2941         Use safe overflow checking. Add decent error messages.
2943 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2945         * metadata-verify.c: Move remaininh blob checks to the offline
2946         verification path.
2948 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2950         * metadata-verify.c: Move more blob checks to the offline verification
2951         path.
2953 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
2955         * object-internals.h : Adding interrupt_on_stop field.
2957         * threads.c (mono_thread_request_interruption) : On Windows exit the
2958           thread if interrupt_on_stop is set.
2960         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
2961          Removing old interrupt logic and setting the interrupt_on_stop for the
2962          thread when calling accept.
2964         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
2965          setting the interrupt_on_stop for the thread when calling accept.
2967         Contributed under MIT/X11 license.
2969 2009-06-20  Martin Baulig  <martin@ximian.com>
2971         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
2973 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
2975         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
2976         running in no-exec mode.
2978 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2980         * metadata-verify.c (verify_method_table): Move header
2981         checking to verify_method_table_full.
2983         * metata-verify.c (mono_verifier_verify_full_table_data):
2984         Call verify_method_table_full.
2986 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2988         * metadata-verify.c (verify_field_table): Move signature
2989         checking to verify_field_table_full.
2991         * metata-verify.c (mono_verifier_verify_full_table_data):
2992         Call verify_field_table_full.
2994 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2996         * metadata-verify.c (verify_typedef_table): Move remaining
2997         stuff to verify_typedef_table_full.
2999 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3001         * metadata-verify.c: Kill is_corlib from VerifyContext.
3002         It is only used by the offline mode.
3003         So we better remove it from the runtime path.
3005 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3007         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
3008         function that perform the offline metadata verification steps.
3010         * metadata-verify.c (verify_typedef_table): Move some checks to
3011         verify_typedef_table_full and make it been called by new function
3012         mono_verifier_verify_full_table_data.
3014         * pedump.c: Call mono_verifier_verify_full_table_data.
3016         * verify-internals.h: Export mono_verifier_verify_full_table_data as
3017         part of the internal API.
3019 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3021         * metadata-verify.c (typedef_is_system_object): Fix System.Object
3022         check.
3024         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
3025         flags bits. SupportLastError was confused as bit 7 instead of 6.
3027         * metadata-verify.c (verify_implmap_table): Fix import scope verification
3028         to check against the module ref table instead of module.
3030         * metadata-verify.c (verify_implmap_table): Fix corlib check.
3032         * pedump.c: Call mono_image_load_names.
3034 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3036         * image.c: Extract mono_image_load_names from do_mono_image_load.
3038         * metadata-internals.h: Export mono_image_load_names as part of
3039         the internal API.
3040         
3041 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
3043         * metadata.c (mono_metadata_cleanup): Free the generic method cache
3044         first, as it could reference data in the other caches.
3046 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
3048         * metadata-verify.c: Finished with method header verification.
3050 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
3052         * metadata-verify.c: Added more header verification code.
3053         Now only EH clauses are missing.
3055 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
3057         * marshal.c (get_runtime_invoke_type): Don't share primitive types
3058         for return values.
3060 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
3062         * metadata-verify.c: Initial method header verification.
3064 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
3066         * metadata-verify.c (verify_import_table): The IAT contents
3067         might end been patched by the windows DL when running with
3068         coree enabled.
3070 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
3072         * class.c (mono_class_from_typeref): If the enclosing type is not
3073         found return null instead of crashing. Fixes #508487.
3075 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
3077         * normalization-tables.h : updated to the latest unicode charcter
3078           data.
3079         * appdomain.c : bump corlib version.
3081 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
3083         * class.c (mono_class_from_name): Fix support for assembly references
3084         in the EXPORTEDTYPE table. Fixes #511704.
3086 2009-06-13  Geoff Norton  <gnorton@novell.com>
3088         * domain.c: Ensure that mono_domain_assembly_open actually opens the
3089         assembly in the target domain.
3091 2009-06-12  Robert Jordan  <robertj@gmx.net>
3093         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
3094         because "this" of the managed signature has become an
3095         ordinary parameter in the unmanaged signature.
3097 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
3099         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
3100         field for owner-less generic containers.
3102         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
3103         image field of the owner-less generic containers created here.
3105         * metadata.c (mono_metadata_load_generic_params): Ditto, the
3106         contain is ownerless until the caller sets its owner.
3108         * metadata.c (type_in_image): Handle owner-less generic containers
3109         correctly.
3110         
3111 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
3113         * image.c (mono_image_close): Support debug_assembly_unload for
3114         dynamic images too.
3116 2009-06-11 Andrés G. Aragoneses  <aaragoneses@novell.com>
3118         * class.c: Fix some typos in comments.
3120 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
3122         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
3124         * threads.c (mono_thread_execute_interruption): Avoid creating the
3125         abort exception object while holding the synch_cs lock.
3127 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3129         * metadata-verify.c: Verify basic cattr content.
3131 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
3133         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
3134         nested types.
3135         
3136         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
3137         support for nested types. Fixes #511704.
3139 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3141         * metadata-verify.c: Verify methodspec signatures.
3143 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3145         * metadata-verify.c: Verify typespec signatures.
3147 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
3149         * metadata.c (free_inflated_method): Call 
3150         mono_marshal_free_inflated_wrappers (), which was missed earlier.
3152 2009-06-08  Miguel de Icaza  <miguel@novell.com>
3154         * mono-config.c: Small change to report the PPC64/ILP32 model.
3156 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3158         * metadata-verify.c (parse_type): Check szarray.
3160 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3162         * metadata-verify.c (parse_type): Check fnptr.
3164 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3166         * metadata-verify.c (parse_type): Check generic instances.
3168 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3170         * metadata-verify.c (parse_type): Check array shape.
3172 2009-06-05  Robert Jordan  <robertj@gmx.net>
3174         * class.c (mono_class_create_from_typedef): Check only for
3175         mscorlib's System.Array.
3177 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3179         * metadata-verify.c (parse_type): Check pointer, class/valuetype
3180         and generic params. 
3182         * metadata-verify.c (parse_field): Check the signature.
3184 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3186         * metadata-verify.c: Implement locals signature check.
3188 2009-06-04  Marek Safar  <marek.safar@gmail.com>
3190         * domain.c: Add .NET 4.0 Beta 1 version.
3192 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
3194         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
3195           For QueryInterface on CCWs consider the base class
3196           interfaces as well.
3198         Code is contributed under MIT/X11 license.
3200 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
3202         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
3204         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
3205         used.
3207         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
3208         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
3210         * generic-sharing.c (inflate_other_data): Ditto.
3211         
3212 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3214         * metadata-verify.c: Implement property signature check.
3216 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3218         * sgen-gc.h: Register saving support for PPC.
3220 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3222         * sgen-gc.c: Fixed a pthread TLS screwup.
3224 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3226         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
3227         supported.
3229 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3231         * sgen-gc.c: Disable TLA and managed allocation if the __thread
3232         keyword is not supported.
3234 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
3236         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
3237         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
3238         the inflated method is freed. Fixes #508389.
3240         The code is contributed under the MIT/X11 license.
3241         
3242 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
3244         * marshal.c (get_wrapper_target_class): New helper function.
3245         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
3246         the <Module> class of the image. Fixes #509049.
3248 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3250         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
3251         Check if the thread was interrupted and proccess it straight away.
3252         Makes abortion much more responsive.
3254 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3256         * threads.c (mono_thread_execute_interruption): Use atomic cas with
3257         MonoThread::interruption_requested to match it's counterpart.
3259         Fixes a hang in abort-stress-1 on a 2 core x86.
3261         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
3262         Fix warning.
3264 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3266         Change MonoImage::name_cache to be protected by the image lock
3267         instead of the loader lock.
3269         * appdomain.c (deregister_reflection_info_roots): Protect access
3270         to name_cache.
3272         * class.c (mono_image_init_name_cache): Change from the loader lock
3273         to the image lock. Check if the cache wasn't already created.
3275         * class.c: Change from the loader to the image lock.
3277         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
3278         the code to hold the image lock while iterating over name_cache and
3279         not go into mono_array_new holding it.
3281         * metadata-internals.h: Add a comment about this change.
3283 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3285         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
3286         Under the 2.0 profile raise the loader error.
3288         Fixes #508532.
3290 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3292         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
3293         of ldind opcode for generic instances so we don't fail for direct wrappers.
3294         This only affect direct calls.
3296 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
3298         * reflection.c (create_dynamic_mono_image): Fix warnings.
3300         * generic-sharing.c (other_info_equal): Ditto.
3301         
3302 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3304         * metadata-verify.c: Implement field signature check.
3306 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3308         * metadata-verify.c: Implement standalone signature check.
3310 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3312         * metadata-verify.c: Implement methodref signature check.
3314 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
3316         * object-internals.h (MonoRuntimeCallbacks): New structure containing
3317         callbacks supplied by the runtime.
3319         * object.c (mono_install_callbacks): New internal function to install
3320         the callbacks.
3322         * object.c (mono_create_ftnptr): Move the implementation of this to
3323         mini/.
3325         * object.c (mono_get_addr_from_ftnptr): Ditto.  
3327 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3329         * metadata-verify.c (parse_return_type): Proper byref check.
3330         * metadata-verify.c (is_valid_method_signature): Check for zero arity
3331         generic signatures and method params.
3333 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3335         * metadata-verify.c (decode_signature_header): Fix bounds check.
3337         * metadata-verify.c (parse_custom_mods): Check custom mods.
3339         * metadata-verify.c (parse_type): Do initial basic verification
3340         of valid values.
3341         
3342         * metadata-verify.c (is_valid_method_signature): Parse the generic
3343         param count.
3345 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
3347         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
3348         discarded based on their most specific definition so we set the method_slots
3349         array before checking if the method is acceptable or not.
3351         Fixes #506757.
3353 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3355         * icall.c: Free the old array when resizing a mono_ptr_array.
3357 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3359         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
3360         for the hashes whose keys are managed objects.
3362 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3364         * object-internals.h, threads.c: Set the execution context on
3365         thread start here, not in corlib.
3367         * appdomain.c: Bump corlib version.
3369 2009-05-27  Martin Baulig  <martin@ximian.com>
3371         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
3372         if `_mono_debug_using_mono_debugger' is set to make things work
3373         properly when embedding Mono.
3375 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
3377         * class.c (mono_class_setup_fields): Don't mark simd types as having
3378         16 bytes alignment as the whole runtime doesn't support.
3380 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
3382         * metadata-verify.c (safe_read): Use endian safe read macros.
3384 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
3386         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
3387         it is read-only when using full aot.
3389 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3391         * metadata-verify.c (is_valid_method_signature): Verify parts
3392         of the return type. Provide an error message in case of failure.
3394 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3396         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
3398 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3400         * metadata-verify.c: Include the size prefix in the bounds check.
3402 2009-05-22  Miguel de Icaza  <miguel@novell.com>
3404         * icall.c: Remove warnings.
3406         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
3407         prevent auto-detection based on GCC defines.
3409         Add PS3
3411         * metadata-verify.c: Do not include signal.h
3413         * generic-sharing.c, marshal.c: Add returns to avoid some warning
3414         messages.  Not sure why the g_assert_not_reached is not enough to
3415         quiet the compiler.
3416         
3418         * appdomain.c: Remove code that is not used when
3419         DISABLE_SHADOW_COPY is set.
3421         * image.c: use g_getenv
3423 2009-05-21  Miguel de Icaza  <miguel@novell.com>
3425         * reflection.c: Remove code that it not used with
3426         DISABLE_REFLECTION_EMIT is defined.
3428 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
3430         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
3431         invoke wrappers.
3433 2009-05-20  Miguel de Icaza  <miguel@novell.com>
3435         * socket-io.c
3436         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
3437         the ifdef here and instead put that on io-layer
3439 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3441         * metadata-verify.c: Verify the generic param constraint table.
3443 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3445         * metadata-verify.c (verify_generic_param_table): Fix
3446         thinko on the valid flags bits for generic params.
3448 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3450         * metadata-verify.c: Verify the methodspec table.
3452 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3454         * metadata-verify.c: Verify the generic param table.
3456 2009-05-19  Mark Probst  <mark.probst@gmail.com>
3458         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
3460 2009-05-19  Mark Probst  <mark.probst@gmail.com>
3462         * sgen-gc.c: Use generation enum more consistently and use the
3463         correct generation in mono_gc_register_for_finalization().
3465 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3467         * metadata-verify.c: Verify the nested class table.
3469 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3471         * metadata-verify.c: Verify the manifest resource table.
3473 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
3475         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
3477 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
3479         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
3480         wrappers, this is now done in the JIT.
3481         
3482         * class.c (mono_set_generic_sharing_supported): New internal function.
3483         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
3485 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3487         * metadata-verify.c: Verify the exported type table.
3489 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3491         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
3493 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3495         * metadata-verify.c: Verify the file table.
3497 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3499         * metadata-verify.c (verify_assembly_table): Fix an error message.
3501         * metadata-verify.c: Verify the assemblyref table.
3503 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3505         * metadata-verify.c (verify_assembly_table): Fix the valid
3506         bits mask for flags.
3508 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
3510         * debug-helpers.c (mono_method_full_name): Print generic parameters of
3511         generic methods as well.
3513 2009-05-15  Geoff Norton  <gnorton@novell.com>
3515         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
3516         use-case and is significantly more performant than the wapi layer.
3518 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3520         * metadata-verify.c: Verify the assembly table.
3522 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3524         * metadata-verify.c: Fix rows limit check.
3526 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3528         * metadata-verify.c: Verify the fieldrva table.
3530 2009-05-13  Mark Probst  <mark.probst@gmail.com>
3532         * sgen.c: Speed up weak links and finalizers by grouping them by
3533         generation.
3535 2009-05-13  Mark Probst  <mark.probst@gmail.com>
3537         * marshal.c (delegate_hash_table_add): When overwriting an entry,
3538         free the old GCHandle (only applies to SGen).
3540 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
3542         * loader.c (mono_get_method_from_token): Avoid the expensive call to
3543         mono_metadata_load_generic_params () for non-generic methods.
3545 2009-05-12  Mark Probst  <mark.probst@gmail.com>
3547         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
3548         New function for returning a monitor's weak link if it has one.
3550         * sgen-gc.c: Remove an object's monitor's weak link (if it has
3551         one) when clearing a domain.  These can still be around because
3552         the object might not have been collected.
3554 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
3556         * gc.c: Fix a warning.
3558 2009-05-12  Kornél Pál  <kornelpal@gmail.com>
3560         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
3561         prevous wait that resulted in a deadlock on Windows when initializing
3562         the runtime form DllMain. Also results in improved startup time.
3563         (finalizer_thread): Get rid of thread_started_event.
3564         * threads.c, threads-types.h (mono_thread_create_internal): Return the
3565         resulting MonoThread.
3567         Contributed under MIT/X11 license.
3569 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
3571         * metadata-verify.c: Verify the implmap table.
3572         Don't require that #US and #Strings be present.
3574 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
3576         * security-core-clr.c: Delegate checks are done at creation time,
3577         not a invocation time. Fix exception for Telerik Silverlight demo
3579 2009-05-11  Mark Probst  <mark.probst@gmail.com>
3581         * sgen-gc.c (need_remove_object_for_domain): Remove the special
3582         case for the Thread class.
3584         * threads.c: Do clean-up of abort exception/state in
3585         thread_cleanup() instead of Thread.free_internal().  Also clean up
3586         current_appcontext.  The reason we have to do that is because
3587         those references might point into another domain and if that
3588         domain is unloaded before the thread is finalized, they point to
3589         invalid data.
3591 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
3593         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
3594         stub signatures.
3595         
3596         Contributed unter MIT/X11 license.
3598 2009-05-09  Miguel de Icaza  <miguel@novell.com>
3600         * verify.c, metadata-verifier.c: Add support for disabling the
3601         verifier in some builds.
3603         [ Sorry, my previous commit accidentally commited some work in
3604         progress ]
3606 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
3608         * class.c (mono_class_setup_fields): Set class->field.first for
3609         generic instances.
3611 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
3613         * metadata-verify.c: Verify the typespec table.
3615 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
3617         * metadata-verify.c: Verify the module table.
3619 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3621         * metadata-verify.c: Verify the methodimpl table.
3623 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3625         * metadata-verify.c: Verify the property table.
3627 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
3629         * debug-helpers.c (mono_method_desc_match): Add support for generic
3630         glob patterns.
3632 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
3634         * metadata-verify.c: Verify the propertymap table.
3636 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
3638         * metadata-verify.c: Verify the event table.
3640         * metadata-verify.c (search_sorted_table): Fix offset
3641         calculation.
3643 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
3645         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
3647 2009-05-01  Mark Probst  <mark.probst@gmail.com>
3649         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
3650         because mono_delegate_free_ftnptr() needs it.
3652 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3654         * metadata-verify.c: Verify the eventmap table.
3656 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3658         * metadata-verify.c: Verify the standalonesig table.
3660 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3662         * metadata-verify.c: Verify the field layout table.
3664 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3666         * class.c (mono_type_get_name_recurse): Don't crash
3667         for ownerless generic params.
3669         * debug-helpers.c (mono_type_get_desc): Correct the format
3670         for ownerless generic params.
3672 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3674         * metadata-verify.c: Verify the class layout table.
3676 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3678         * metadata-verify.c: Verify the decl security table.
3680 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3682         * domain.c (mono_domain_set_internal_with_options): Don't do
3683         anything if the old domain is the same as the old one.  Fixes
3684         #499326.
3686 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3688         * appdomain.c: Deregister the reflection_info roots when unloading
3689         a domain.
3691         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
3692         memory allocated by a domain and frees its disappearing links.
3694         * boehm-gc.c, null-gc.c: Empty implementation of
3695         mono_gc_clear_domain().
3697 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3699         * appdomain.c (clear_cached_vtable): Free the static fields memory
3700         block.
3702 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3704         * gc.c: Set the correct domain when invoking finalizers.
3706         * appdomain.c: Set the correct domain when creating threads.
3708 2009-04-30  Mark Probst  <mark.probst@gmail.com>
3710         * sgen-gc.c: Fix skip size for vectors.
3712 2009-05-03  Martin Baulig  <martin@ximian.com>
3714         * mono-debug-debugger.c
3715         (mono_debugger_check_breakpoints): Check class init handlers even
3716         if we don't have any method load handers.
3718 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
3720         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
3721         returning refonly assemblies if refonly is FALSE. Fixes #499013.
3723 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
3725         * metadata-verify.c: Verify the field marshal table.
3727 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
3729         * metadata-verify.c: Verify the custom attribute table.
3731 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3733         * metadata-verify.c: Verify the constant table.
3735 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3737         * metadata-verify.c: Verify the memberef table.
3739 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3741         * metadata-verify.c (get_coded_index_token): Remove
3742         dead argument.
3744 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3746         * metadata-verify.c: Verify the interfaceimpl table.
3748 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
3750         * verify.c: Improve error message.
3752         * debug-helpers.c (mono_type_get_desc): Harden the code that
3753         deals with VAR and MVAR.
3755 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
3757         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
3758         part of #498692.
3760 2009-04-23 Tom Hindle <tom_hindle@sil.org>
3762         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
3763         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
3765 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
3767         * security-core-clr.c: Avoid redundant checks for platform code, 
3768         e.g. check for method and for class (very common) and check
3769         for class and outer class (less common)...
3771 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
3773         * reflection.c: Avoid returning random cattrs for synthetic methods.
3774         Fixes #498545.
3776 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
3778         * assembly.c: assemblies in the GAC should never be shadow-copied.
3780 2009-04-26  Mark Probst  <mark.probst@gmail.com>
3782         * domain.c, domain-internals.h: Disable
3783         track_resurrection_{objects,handles}_hash in MonoDomain if using
3784         SGen.
3786 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3788         * metadata-verify.c: Verify the param table.
3790 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3792         * metadata-verify.c (verify_typedef_table): Range check FieldList and
3793         MethodList.
3795         * metadata-verify.c (verify_method_table): Proper check the ParamList
3796         field.
3798 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3800         * metadata-verify.c (verify_method_table): Check for runtime
3801         implemented functions such as delegate .ctors. Remove spurious
3802         printf.
3803         
3804 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3806         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
3808 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3810         Don't allocate MonoGenericInfo for ownerless generic params.
3811         * class-internals.h (MonoGenericParam::info): Move field to ...
3812         (MonoGenericParamFull): ... this.  New struct.
3813         (MonoGenericContainer::type_params): Change type to
3814         MonoGenericParamFull.
3815         (MonoGenericParam, MonoGenericContainer): Update accessors.
3816         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
3817         'info' field for ownerless generic param.
3818         (mono_metadata_load_generic_params): Update to changes.
3819         * reflection.c (mono_reflection_create_generic_class): Likewise.
3820         (reflection_methodbuilder_to_mono_method): Likewise.
3821         (mono_reflection_initialize_generic_parameter): Likewise.
3823 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3825         Don't use MonoGenericParamInfo for ownerless generic params.
3826         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
3827         use ParamInfo class at all.
3828         (mono_class_from_generic_parameter): Use them.
3829         (make_generic_param_class): Fix a couple of instances where 'pinfo
3830         == NULL' wasn't handle.
3832 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3834         * class.c (make_generic_param_class): Carve out of ...
3835         (mono_class_from_generic_parameter): ... here.
3837 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
3839         Simplify mono_class_from_generic_parameter
3840         * class-internals.h (MonoGenericParamInfo::token): New field.
3841         * metadata.c (mono_metadata_load_generic_params): Initialize it
3842         from metadata.
3843         * class.c (mono_class_from_generic_parameter): Use it instead of
3844         searching through metadata.
3846 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3848         * metadata-verify.c: Add verification of the method table.
3850 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3852         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
3853         Delegate::Invoke optimization.
3855 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3857         * appdomain.c (mono_domain_create_appdomain_internal): Free the
3858         string returned by get_shadow_assembly_location_base.
3860         * appdomain.c (get_shadow_assembly_location_base): Add a comment
3861         about caller's ownership.
3863 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3865         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
3866         reflection memory on domain unload.
3868         * domain.c (mono_domain_free): Don't free refobject_hash, let the
3869         reflection cleanup code do it.
3871         * domain-internals.h: Add mono_reflection_cleanup_domain.
3873         This fixes a memory leak for managed mirrors of reflection objects
3874         on domain unload. 
3876 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
3878         * metadata-verify.c: Implement more verification of the field table.
3880 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
3882         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
3883         doesn't try to parse the input assembly, which can be broken.
3885 2009-04-23  Mark Probst  <mark.probst@gmail.com>
3887         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
3888         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
3889         by using the lowest bit in the link to store whether the link is
3890         tracked.  Move the track_resurrection hashes into boehm-gc.c.
3892 2009-04-22  Miguel de Icaza  <miguel@novell.com>
3894         * Makefile.am: Split the console support in platform specific code
3895         and put together a framework for making this easy in the future so
3896         that we can start splitting code instead of having a mess of PLATFORM_WIN32
3898 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3900         * pedump.c: Fix a warning.
3902 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3904         * verify.c (mono_delegate_type_equal): Compare valuetypes using
3905         mono_class_from_mono_type to avoid bad interactions with the dual representation
3906         of the generic type definition.
3908 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3910         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
3911         get the MonoClass for the call context type as it might be a generic
3912         instance.
3914         Fixes #491483.
3916 2009-04-21  Mark Probst  <mark.probst@gmail.com>
3918         * object-internals.h: The Thread object has no execution_context
3919         member anymore.
3921         * threads.c, threadpool.c, threads-types.h: Accessor functions for
3922         the execution context.
3924         * appdomain.c: Bump corlib version.
3926 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3928         * verify.c (do_newobj): Improve error message.
3930 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3932         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
3933         is nested in the filter block.
3935         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
3936         block is not fully nested.
3938         Fixes #495656.
3940 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3942         * verify.c (verify_type_compatibility_full): Compare MonoClass and
3943         not MonoType to check for equality of valuetypes as the generic type
3944         definition allows for two different encodings: the generic type definition
3945         class or a generic instance over the GTD arguments.
3947         Fixes #496175.
3949 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3951         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
3953         * verify.c (do_initobj): Improve error message.
3955 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3957         * metadata-verify.c: Enable pe verification as the issue with #496453
3958         is that the authenticode data directory have a different unspecified
3959         format. Ignore it for now.
3961         * pedump.c: Run the metadata verifier together with the IL verifier.
3963         Fixes ##496453.
3965 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
3967         * metadata-verify.c: Temporarily disable pe verification due to #496453.
3969 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3971         * class.c (can_access_type): Check visibility against
3972         the element type for pointers and arrays.
3974         Fixes #496150.
3976 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3978         * metadata-verify.c: Fix cli and table verification to use information
3979         from the MonoImage. A lot of duplicated code got killed.
3981 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3984         This patch starts to integrate the metadata verifier with the runtime code.
3986         This patch causes major regression in functionality for the metadata verifier
3987         as cli and table verification are disabled since they require to be ported to
3988         use MonoImage information.
3990         * image.c (do_mono_image_load): Split the code in this function
3991         into mono_image_load_pe_data and mono_image_load_cli_data.
3992         Add     care_about_pecoff parameter to not load pecoff data.
3993         Call into the metadata verifier for pecoff and cli verification.
3995         * image.c (mono_image_open_raw): New function that doesn't perform
3996         any parsing of the image contents.
3997         
3998         The reason for the 3 new functions is to give pedump better control
3999         into the interaction with the verifier.
4001         * metadata-internals.h: Add new functions from image.c as part of the
4002         internal mono API.
4004         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
4005         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
4006         to make those functions work together with the runtime.
4008         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
4009         true if the image needs to be verified.
4011         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
4013         * pedump.c: Use new metadata verifier API.
4015 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
4017         * object.c (mono_install_vtable_trampoline): Make this receive a
4018         trampoline creation function instead of trampoline, allowing the JIT
4019         to use a different trampoline for each vtable.
4021 2009-04-18  Mark Probst  <mark.probst@gmail.com>
4023         * object.c (mono_raise_exception): Don't reset the thread abort
4024         exception state here.
4026 2009-04-18  Mark Probst  <mark.probst@gmail.com>
4028         * icall-def.h: New icall for getting the thread abort exception
4029         state for a thread.
4031         * object.c, thread.c, object-internals.h: A thread's abort
4032         exception state is now a GC handle.  To get the object it stands
4033         for, we must move it into the current app domain, if it's
4034         different than the one where it originated from.
4036         * appdomain.c: Bump corlib version.
4038         * domain.c, domain-internals.h: New function for setting the
4039         domain and migrate the thread abort exception or not.
4041 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4043         * metadata-verify.c: Add initial verification of the
4044         field table.
4046 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4048         * metadata-verify.c: Add a macro to conditionally enable
4049         dumping of verification information. Add  make_coded_token
4050         and search_sorted_table to enable search sorted tables
4051         by a given coded token.
4053 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4055         * metadata-verify.c: Add array mapping from table index
4056         to description offset. Add get_col_offset and get_col_size
4057         functions.
4059 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4061         * metadata-verify.c: Add remaining table descriptions offsets.
4062         Add remaining coded index descriptions.
4064 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4066         * metadata-verify.c: Fixed constant table description.
4067         Fixed calculation of HasCustomAttribute coded index size.
4068         Fixed calculation of size for many table indexes. 
4070 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4072         * pedump.c (dump_metadata): Dump table offset instead
4073         of useless pointer in memory.
4075 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4077         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
4079 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4081         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
4082         a missing of for interface types.
4084 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4086         * metadata-verify.c (verify_pe_optional_header): Add comment of why
4087         the code is commented.
4089         * metadata-verify.c (verify_resources_table): Remove spurious printf
4090         and don't fail if there are unmanaged resources. Gmcs generates a useless
4091         one     for all assemblies - I bet it's some MS compatibility junk.
4093 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4095         * metadata-verify.c (verify_typedef_table): Verify the extends field.
4097         * metadata-verify.c (mono_image_verify): Add a is_corlib.
4099         * verify-internals.h: Same.
4101         * pedump.c: Fix for mono_image_verify new signature.
4103 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4105         * metadata-verify.c (verify_typedef_table): Verify for some invalid
4106         flags combinations.
4108 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4110         * metadata-verify.c (verify_module_table): Ignore the generation field.
4112 2009-04-15  Martin Baulig  <martin@ximian.com>
4114         * debug-mono-symfile.c
4115         (mono_debug_symfile_lookup_location): Don't print a warning for
4116         unknown extended opcodes if they're within 0x40 and 0x7f.
4118 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
4120         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
4121         invoke signatures returning an enum. Fixes #494847.
4123 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4125         * metadata-verify.c: Initial code to verify the typedef table.
4127 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4129         * verify.c (mono_method_verify): Don't fail if an unconditional branch
4130         with non empty stack happens before the beginning of a try block.
4132         Fixes #494812.
4134 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4136         * metadata-verify.c: Verify typename and typenamespace fields of
4137         the typeref table.
4139 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
4141         * metadata-verify.c: Initial code to verify the typeref table.
4143 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
4145         * verify.c (verify_delegate_compatibility): Fix error message.
4147 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
4149         * security-core-clr.c: Fix typo
4151 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
4153         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
4154         a MonoGHashTable to keep its values alive.
4155         (emit_marshal_boolean): Fix a warning.
4157 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
4159         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
4160         not have any interface configured for IPv4/IPv6.
4162 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
4164         * assembly.c: fix typo in error message.
4166 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
4168         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
4169         allocating the location holding the this argument to prevent
4170         'too many root sets' errors.
4172         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
4173         to mark fields as special static.
4174         (mono_field_static_get_value): Handle special static fields.
4175         (mono_field_static_set_value): Ditto.
4177         * class-internals.h (struct _MonoClassField): Document this.
4179 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4181         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
4182           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
4183           case.  This will handle when managed code returns null to native code.
4185         Code is contributed under MIT/X11 license.
4187 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4189         * object.c (build_imt_slots): Changing a free to a g_free to match
4190           the g_malloc0 in add_imt_builder_entry that allocated this memory.
4192         Code is contributed under MIT/X11 license.
4194 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4196         * marshal.c (emit_marshal_boolean): Adding code to ensure that
4197           the correct TRUE value is passed through the marshaling layer.
4199         Code is contributed under MIT/X11 license.
4201 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
4203         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
4204         correctly. Fixes #492330.
4205         
4206         * marshal.c: Fix the embedding of object pointers into JITted code in
4207         the native-to-managed wrappers by allocating some GC tracked memory, and
4208         embedding the address of that.
4210 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
4212         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
4213         pointers into the vtable.
4215 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
4217         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
4219         * verify.c (verify_ldftn_delegate): Improve error message.
4221 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
4223         * reflection.c (my_mono_class_from_mono_type): Remove.
4225 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
4227         Prepare to reduce memory usage of owner-less generic parameters (1/n)
4228         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
4229         and constraints fields into ...
4230         (MonoGenericParamInfo): ... this.
4231         (mono_generic_param_info, mono_generic_container_get_param_info):
4232         New accessors.
4233         * class.c, debug-helpers.c, icall.c: Update to changes.
4234         * metadata.c, reflection.c, verify.c: Likewise.
4236 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
4238         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
4240         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
4241         
4242         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
4243         booleans with sbytes.
4245 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4247         * class.c (can_access_instantiation): Verify accesibility of element types
4248         for arrays and pointers.
4250         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
4252         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
4254         Fixes #493068.
4256 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4258         * verify.c (do_invoke_method): Improve error messages.
4260 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
4262         * verify.c:  Fixing the MSVC build.
4264         Code is contributed under MIT/X11 license.
4266 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4268         * security-core-clr.c: Simplify get_reflection_caller not to call
4269         mono_method_get_last_managed (another stack walk) and adjust the
4270         callers to handle a (should not happen) NULL return value.
4272 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4274         Add accessors to some MonoGenericParam fields
4275         * class-internals.h (mono_generic_param_owner): New accessor.
4276         (mono_generic_param_num): Likewise.
4277         (mono_type_get_generic_param_owner): New helper.
4278         (mono_type_get_generic_param_num): New helper.
4279         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
4281 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4283         * class-internals.h (mono_generic_container_get_param): New wrapper.
4284         * class.c, icall.c, metadata.c, verify.c: Use it.
4286 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4288         Fix gtest-252.cs
4289         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
4290         the standard case/loop.  In particular, don't complain about
4291         references to generic type definitions.
4293 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
4295         * debug-helpers.c (dis_one): Decode string arguments.
4297 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4299         * pedump.c (dump_verify_info): Dump type name correctly.
4301 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4303         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
4304         are larger than code size.
4306         This can happen in valid code if the try/catch block is not followed by any instruction
4307         and do a backward branch on the leave instruction.
4309         Fixes #492494.
4311 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
4313         * security-core-clr.c: Fix typo while comparing second method names
4314         in can_avoid_corlib_reflection_delegate_optimization
4316 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
4318         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
4320         Fixes #487738.
4322 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
4324         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
4325         a MVAR using a class context.
4327         Fixes #490335.
4329 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
4331         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
4333         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
4335         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
4336         functions supplied by the JIT for the SGEN GC.
4338         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
4339         
4340 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
4342         monitor.c (mono_monitor_try_enter_internal):
4343         Added calls to profile monitor contentions.
4344         Also duplicated a small piece of code (the "get the monitor" logic)
4345         from the fast path to the slow path, and changed the relevant goto
4346         statements, so that monitor acquisition events can be emitted from the
4347         slow path (this is by Paolo Molaro).
4349 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
4351         * profiler.c, profiler.h, profiler-private.h:
4352         Added support for profiling monitor contentions.
4354 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
4356         * metadata-verify.c: Verify the modules table.
4358 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
4360         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
4361         using the context of the method been verifier and not of the method been called.
4363         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
4364         safely inflate generic types. 
4366 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
4368         * security-core-clr.c: Change the strategy for checking the 
4369         "reflection using delegates optimization" to avoid unneeded 
4370         attributes in multiple class libraries.
4372 2009-04-02  Mark Probst  <mark.probst@gmail.com>
4374         * sgen-gc.c: Remove object element in the disappearing link struct
4375         by storing the object pointer in the link.
4377 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4379         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
4381 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4383         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
4385         * verify.c (mono_method_verify): Do proper bounds checking of exception
4386         clause ranges.
4388 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4390         * loader.c (mono_field_from_token): Don't crash if the field parent could
4391         not be decoded.
4393 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4395         * sgen-gc.c: Execute critical finalizers after ordinary
4396         finalizers.
4398         * class-internals.h, domain.c: Add CriticalFinalizerObject to
4399         mono_defaults.
4401 2009-03-31 Jb Evain <jbevain@novell.com>
4403         * verify.c (do_ldstr): don't check if a string is in the user strings
4404         heap if the current image is dynamic.
4406 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4408         * sgen-gc.c: Wait until the last finalizer has executed when
4409         returning from WaitForPendingFinalizers.
4411 2009-03-31  Martin Baulig  <martin@ximian.com>
4413         * mono-debug-debugger.h (MonoDebuggerEvent): Add
4414         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
4415         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
4416         (mono_debugger_event_create_appdomain): New function.
4417         (mono_debugger_event_unload_appdomain): New function.
4419         * appdomain.c (mono_domain_create_appdomain_internal): Call
4420         mono_debugger_event_create_appdomain().
4422 2009-03-31  Martin Baulig  <martin@ximian.com>
4424         * mono-debug-debugger.c
4425         (mono_debugger_register_class_init_callback): Also register the
4426         class init callback if the class is already initialized to make
4427         things work with shadow copied assemblies.
4429 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
4431         * security-core-clr.c
4432         (mono_security_core_clr_ensure_reflection_access_field): Let 
4433         critical code access the field (just like we do for methods). Use
4434         check_field_access helper.
4435         (mono_security_core_clr_ensure_reflection_access_method): Use 
4436         check_field_access helper.
4438 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4440         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
4441         call the run-finalize function directly.
4443         * gc.c, gc-internal.h: Make run_finalize() non-static.
4445 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4447         * sgen-gc.c: Use a separate struct for disappearing links.
4449 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
4451         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
4452         * MaxIOVectorLength enabled, just ignore them.
4453         Fixes bug #349688.
4455 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
4457         * metadata-verify.c: Fix eglib build.
4459 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
4461         * threads-types.h: Fix the win32 build.
4463 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
4465         * class.c: move coreclr inheritance/override checks to 
4466         security-core.clr.c
4467         * security-core.clr.c|h: add code from class.c with additional
4468         documentation. Fix override check when the method is not critical.
4470 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
4472         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
4473         (match_class): Ditto.
4475 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
4477         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
4479         * metadata-verify.c: Implement table layout row size calculation. Verify
4480         the total size of the tables.
4482 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
4484         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
4486 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
4488         * appdomain.c:
4489         * console-io.[ch]: added new mono_console_init() to make sure that
4490         file descriptors 0, 1 and 2 are opened.
4491         Bug #489019 fixed.
4493 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
4495         * appdomain.h: Export a new callback type and a new function to
4496         set this callback. This allow a mono host to provide it's own
4497         definition for "platform code".
4498         * metadata-internals.h: Add a core_clr_platform_code flag on 
4499         _MonoImage to (cache and) know if it is representing platform 
4500         code.
4501         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
4502         on platform code images.
4503         * security-core-clr.c|h 
4504         (mono_security_set_core_clr_platform_callback): Allow the host
4505         to provide it's own platform check definition.
4506         (mono_security_core_clr_determine_platform_image): Detect if an 
4507         image is platform code (using the specified callback).
4508         (mono_security_core_clr_is_platform_image): Return cached value 
4509         for platform code.
4511 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
4513         * threads.c (mono_create_thread): New helper function to wrap CreateThread
4514         which has different parameter types for the 'tid' argument in windows and
4515         the io-layer.
4517         * appdomain.c attach.c threads.c: Use the new helper.
4519 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
4521         * metadata-verify.c: Verify valid table bits.
4523 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
4525         * metadata-verify.c (verify_metadata_header): Store size in the size field.
4527         * metadata-verify.c: Add initial table schema verification.
4529 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
4531         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
4532         obtain the refclass argument needed by mono_param_get_objects (). Fixes
4533         #488383.
4535         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
4537         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
4539 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
4541         * security-core-clr.c: Add/update documentation
4543 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
4545         * marshal.c (emit_marshal_object): Generate code to throw an exception
4546         instead of throwing it. Fixes #488670.
4548 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
4550         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
4551         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
4552         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
4553         and add a call to mono_security_core_clr_ensure_delegate_creation
4554         to do the extra checks required by CoreCLR.
4555         * security-core-clr.c|h: Add function to check delegate creation,
4556         both in the binding and accessibility, under CoreCLR.
4558 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
4560         * reflection.c (mono_reflection_create_dynamic_method): when 
4561         coreclr is enabled make sure that every resolved object are
4562         checked (e.g. field and method access).
4563         * security-core-clr.c|h: Add function to check objects resolved
4564         when a dynamic method is created.
4566 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4568         * metadata-verify.c: Cache directory rva translations.
4570         * metadata-verify.c: Add cli-header and streams verification.
4572 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4574         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
4575         the wrong offset (8 instead of 6).
4577 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
4579         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
4580         methods, return the native function address itself. Fixes
4581         #487758.
4583 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
4585         * console-io.c: some of the values for control characters might not be
4586         present.
4588 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
4590         * exception.c|h: Add helpers to create [Field|Method]AccessException
4591         * icall.c: Add required coreclr check calls for field reflection.
4592         Move the existing (method) check logic into security-core-clr.c
4593         * security-core-clr.c: Add functions to check if the access of a
4594         field or method is allowed when reflecting under coreclr. This is
4595         mostly done using a stack walk to find the "real" caller: i.e. the
4596         code that is calling the reflection
4598 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
4600         * gc-internal.h: Change location of gc_wrapper.h
4602 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
4604         * class.c: Simplification to coreclr checks for overrides that
4605         makes it easier to set breakpoints.
4607 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
4609         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
4610         mono_security_core_clr_method_level): Avoid potential 
4611         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
4612         user/application code) and make it easier to set breakpoints
4614 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4616         * metadata-verify.c: Reject cli header tables that mono don't handle.
4618 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4620         * pedump.c: Fix CLI header dumping.
4622 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4624         * metadata-verify.c: More CLI header verification.
4626 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
4628         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
4630 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
4632         * metadata-verify.c: Initial verification of the CLI header.
4634 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
4636         * metadata-verify.c (verify_resources_table): Fix verification of zero
4637         sized resource section and id entries count.
4639 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
4641         * icall.c: Handle user types in many Type icalls. Fixes #486303.
4643 2009-03-17  Jb Evain  <jbevain@novell.com>
4645         * profiler.c: call mono_gc_base_init from mono_profiler_load.
4647 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
4649         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
4650         (mono_gc_make_descr_for_array): Ditto.
4652 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
4654         * verify.c (mono_verifier_is_class_full_trust): Add support for
4655         CoreCLR security mode where trusted assemblies are defined as
4656         "platform code".
4658 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
4660         * metadata-verify.c: Add minimal PECOFF resource verification.
4662 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
4664         * metadata-verify.c: Be less restrictive with some coff fields.
4666 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
4668         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
4669         params as boxed values on stack. Fixes #485706.
4671 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
4673         * console-io.c: the termios values may vary in different flavors of unix.
4675 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
4677         * console-io.[ch]: return the entire set of control characters when
4678         initializing the terminal.
4679         * appdomain.c: bump corlib version.
4681 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
4683         * mono-perfcounters.c: added support for in-process custom
4684         performance counters.
4686 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
4688         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
4690 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
4692         * metadata-verify.c: Verify the data pointed by the import table. 
4694 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
4696         * metadata-verify.c (load_data_directories): Store data
4697         directory contents.
4699         * metadata-verify.c: Verify the import table. 
4701 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4703         * metadata-verify.c: Verify data directories.
4705 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4707         * metadata-verify.c: Check section header flags.
4709 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
4711         * appdomain.c: if the assembly name is a shadow-copied file, return
4712         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
4713         in mono_make_shadow_copy.
4714         * icall.c: if the assembly name is a shadow-copied file, replace it
4715         with the original assembly path.
4717         Bug #484244 fixed. NUnit tests for corlib can be run without
4718         --noshadow now.
4720 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
4722         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
4723         entries when the table is reallocated.
4725         * icall.c: Allocate the memory used by the mono_ptr_array macros using
4726         mono_gc_alloc_fixed () since it contains GC refs.
4728 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
4730         * reflection.c (ensure_complete_type): New helper function to call
4731         type resolve handlers for unfinished dynamic types.
4732         (resolve_object): Call it for MonoClassFields. Fixes #483852.
4734 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
4736         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
4737         #483247.
4739 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
4741         * appdomain.c (get_shadow_assembly_location): Fix memleak.
4743 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
4745         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
4746         between GCHandles of type WeakTrackResurrection and the objects they
4747         point to.
4749         * gc.c: Partly implement the sematics of GCHandles of type 
4750         WeakTrackResurrection: these handles should only be cleared after the
4751         finalizer of the object they are pointing to has ran.
4753 2009-03-06  Mark Probst  <mark.probst@gmail.com>
4755         * icall.c: Partially revert r126631 because using the jump
4756         trampolines for generic shared methods makes it superfluous.
4758 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
4760         * threads.c (handle_store): Create the 'threads' hash table with the proper
4761         MONO_HASH_VALUE_GC type.
4763 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
4765         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
4766         FIRST_GC_TRACKED.
4768         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
4769         and LAST_GC_TRACKED as a GC root.
4771         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
4773         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
4774         the static data even if it consists of 1 reference.
4776         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
4777         if there is a GC descriptor.
4779         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
4780         instead of through the GC since they contain no object references.
4782 2009-03-05  Mark Probst  <mark.probst@gmail.com>
4784         * generic-sharing.c (instantiate_other_info): Always return a jump
4785         trampoline for method code.
4787 2009-03-05  Marek Habersack  <mhabersack@novell.com>
4789         * culture-info-tables.h: generated to include the en-tt culture.
4791 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
4793         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
4794         capture the thread context.
4796         * object.c (mono_async_result_new): Cache the invoke wrappers to
4797         ExecutionContext::Capture.
4799 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
4801         * marshal.h: Add a prototype for what mono_compile_method returns
4802         for invoke wrappers.
4804         * gc.c: Use the new prototype declaration.
4806 2009-03-04  Geoff Norton  <gnorton@novell.com>
4808         * boehm-gc.c: Add some MONO_LOG tracing for the GC
4809         * gc-internal.h:
4810         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
4812 2009-03-04  Martin Baulig  <martin@ximian.com>
4814         * mono-debug.h
4815         (mono_debugger_runtime_invoke): Removed.
4817         * mono-debug-debugger.c
4818         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
4820 2009-03-02  Martin Baulig  <martin@ximian.com>
4822         * mono-debug.h
4823         (mono_debugger_unhandled_exception): Removed.
4824         (mono_debugger_handle_exception): Removed.
4825         (mono_debugger_throw_exception): Removed.
4827         * mono-debug.c
4828         (mono_debug_debugger_version): Bump to 5.
4830         * mono-debug-debugger.c: Moved the exception handling code to
4831         ../mini/debug-mini.c
4833 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
4835         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
4836         finalize_objects_hash.
4838         * gc.c: Use the separate lock to access the finalize_objects_hash field.
4839         
4840         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
4841         field.
4843         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
4844         cache.
4846         * image.c (mono_image_close): Free it.
4847         
4848         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
4849         allowing a creation of a wrapper which invokes its method using a CALLVIRT
4850         on the this argument.
4852         * gc.c (run_finalize): Optimize the calling of the finalizers.
4854 2009-03-03  Martin Baulig  <martin@ximian.com>
4856         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
4857         of the `MonoGenericInst' changes.
4859 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4861         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
4862         mono_array_class_get_cached to reduce locking contention. Extract
4863         a domain var.
4865         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
4866         intermediary managed arrays. Use caching version of mono_array_new
4867         to allocate the result array.
4869         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
4871         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
4873         * locales.c (create_names_array_idx):  Use mono_array_new_cached
4874         to reduce locking contention.
4876 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
4877                 
4878         * object.c (mono_method_add_generic_virtual_invocation): Put back the
4879         thunk builder code for the non-interface case.
4881 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
4883         * object.c (get_generic_virtual_entries): New helper function to collect
4884         the virtual generic method instances which need to be added to an IMT
4885         thunk.
4886         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
4887         Instead of creating a new IMT thunk, reset the vtable slot to the
4888         trampoline, the thunk will be created the next time the trampoline is called.
4889         (build_imt_slots): Add support for virtual generic methods in interfaces by
4890         adding to the IMT thunk all the methods registered using 
4891         mono_method_add_generic_virtual_invocation ().
4893         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
4894         (struct _MonoIMTCheckItem): Ditto.
4896         * object.c (mono_method_add_generic_virtual_invocation): Take a
4897         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
4898         the IMT thunk to include all items.
4899         
4900         * object.c (mono_class_create_runtime_vtable): Add a missing
4901         mono_loader_unlock ().
4903 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4905         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4907         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
4909 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4911         * object-internals.h: Rename _MonoReflectionEvent to
4912         MonoReflectionMonoEvent so it reflects the right managed type.
4913         Add a MonoReflectionEvent that correctly represents System.EventInfo.
4915         * icall.c:
4916         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
4917         type.
4919 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4921         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
4922         intermediary managed arrays. Use caching version of mono_array_new
4923         to allocate the result array.
4925 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4927         * reflection.c: Use cached version of mono_array_new alongside
4928         the mono_reflection_get_custom_attrs_by_type call path.
4930 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4932         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
4933         intermediary managed arrays. Use caching version of mono_array_new
4934         to allocate the result array.
4936         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
4938 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4940         * icall.c: Add small implementation of a growable stack bound array.
4942         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
4944         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
4945         intermediary managed arrays. Use caching version of mono_array_new
4946         to allocate the result array.
4948 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
4950         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
4951         helps Enum::CompareTo to be implemented without reboxing all enums
4952         to their underlying type.
4953 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
4955         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
4956         since it acquires a global lock leading to scalability problems.
4958         * profiler.c: Make the stat profiler work with multiple appdomains, this
4959         currently only works when no appdomains are unloaded.
4961 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
4963         * appdomain.c: make the check to avoid copying when the assembly is
4964         already shadow copied actually work.
4966 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
4968         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4970         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
4971         changes to the managed side.
4973 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
4975         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
4976         classes + a separate lock for it, as it is used frequently at runtime, not
4977         just during metadata loading/JIT compilation.
4979         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
4980         for szarrays.
4981         
4982         * object-internals.h (mono_class_from_name_cached): New macro to cache
4983         the results of the lookup locally without having to declare a static
4984         variable to hold it.
4985         (mono_class_get_field_from_name_cached): Ditto.
4986         (mono_array_class_get_cached): Ditto.
4988         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
4989         the new macros.
4990         
4991         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
4992         slower search in metadata.
4994         * pedump.c: Fix a warning.
4996 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
4998         * reflection.c (encode_locals): Add checks for user types.
4999         (method_encode_clauses): Ditto.
5000         (method_encode_code): Ditto.
5001         (mono_image_create_token): Ditto.
5003         * object-internals.h: Change the type of more fields from MonoReflectionType*
5004         to MonoObject*.
5006 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
5008         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
5009         the a thread does not suspend within 100ms.
5011         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
5012         in addition to StopRequested as well.
5014         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
5016         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
5017         search the method_hash before inserting a new entry, to avoid crashes when
5018         the same method is inserted multiple times, causing the old 
5019         MonoDebugMethodInfo structure to be freed by the value dtor function.
5021 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
5023         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
5024         SO_EXLUSIVEADDRUSE where available.
5026 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
5028         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
5029         runtime invoke wrappers, this time it is string ctor wrappers, which
5030         pass a dummy string as 'this' instead of their obj argument. Fixes
5031         #478473.
5033 2009-02-21  Jb Evain  <jbevain@novell.com>
5035         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
5036         only get create_culture once.
5038 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
5040         * reflection.c (mono_reflection_setup_internal_class): Move the user type
5041         check before the locking.
5042         
5043         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
5044         (mono_reflection_create_runtime_class): Ditto.
5045         (mono_reflection_sighelper_get_signature_local): Ditto.
5046         (mono_reflection_sighelper_get_signature_field): Ditto.
5048         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
5049         is a System.MonoType object or similar.
5050         (monotype_cast): New helper function to cast a MonoObject to a 
5051         MonoReflectionType object.
5053         * object-internals.h: Change MonoReflectionType* members in structures to
5054         MonoObject* members to force the usage of the monotype_cast () function.
5056         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
5057         structures/arrays. This causes us to assert instead of crashing when 
5058         instances of user defined subclasses of System.Type are encountered.
5060 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5062         * cil-coff.h:
5063         * icall-def.h:
5064         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
5065         win32 resource loaded from a PE file.
5067         * image.c: fix mono_image_lookup_resource.
5069 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5071         * icall-def.h:
5072         * threads-types.h:
5073         * threads.c: added internal call for WaitHandle.SignalAndWait.
5075 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
5077         * cominterop.c : Adding cominterop_type_from_handle and 
5078           registering it as an icall.  Replacing all references
5079           to type_from_handle.
5081         Code is contributed under MIT/X11 license.
5083 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5085         * Makefile.am: Add lock-tracer.h and lock-trace.c.
5087         * appdomain.c: Call the tracer init function.
5089         * domain-internals.h: Enable the tracer for the domain locks.
5091         * image.c: Enable the tracer for image locks.
5093         * loader.c: Enable the trace for the loader lock.
5095         * lock-tracer.h:
5096         * lock-tracer.c: Initial implementation of the lock trace utility.
5097         The tracer requires a compile time define to be enabled and a env var
5098         to be enabled at runtime.
5100 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5102         * domain.c (mono_domain_code_foreach): Improve documentation.
5104 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5106         * appdomain.c:
5107         * generic-sharing.c:
5108         * object.c:
5109         * reflection.c:  Adjust locking order to the new semantics where the loader lock
5110         comes first.
5112 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
5114         * domain.c: Add mono_domain_code_* functions that perform locking
5115         around the domain codeman.
5117         * domain-internals.h: Export those functions.
5119         * object.c: Use new functions instead of acquiring the domain lock.
5121 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
5123         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
5124         delegate. Fixes #477396.
5126 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
5128         * reflection.c (create_custom_attr): Get rid of alloca.
5130 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
5132         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
5133           Adding exception handling for all CCW calls.
5135         Code is contributed under MIT/X11 license.
5137 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
5139         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
5141         * marshal.c (emit_marshal_boolean): Add null checks to the new 
5142         native->managed marshalling code. Fixes #476247.
5144 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
5146         * class.c (mono_class_get_vtable_entry): Move the addition of
5147         static rgctx invoke wrappers for vtable methods here, this simplifies
5148         a lot of code and causes fewer rgctx wrappers to be created.
5150         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
5151         name of the statistics to begin with an uppercase.
5153 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5155         * reflection.c: Revert previous change as it breaks the build.
5156         
5157 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5159         * verify.c: Properly handle SZARRAY element type.
5161         Fixes #474271.
5163 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5165         * reflection.c (mono_image_create_method_token): Correctly encode
5166         MethodDef MemberRefParent token.
5168         Fixes #472845.
5170 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
5172         * image.c (mono_image_close): Delete the critical section before
5173         freeing the memory holding it.
5175 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5177         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
5178         Fixes #476257.
5180 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5182         * pedump.c (main): Call mono_marshal_init so pedump
5183         doesn't crash.
5185 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5187         * loader.c (method_from_memberref): Properly fix #474271 and
5188         don't break the runtime bad.
5190 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
5192         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
5193         (mono_domain_alloc0): Ditto.
5195 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5197         * loader.c (method_from_memberref): Don't abort if the array
5198         method is not found. A regular loader failure is more informative
5199         and correct.
5201         Fixes #474271.
5203 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5205         *loader.c: Guard MonoImage::method_cache/methodref_cache
5206         using the image lock instead of the loader lock.
5208         * metadata.h: Add comments about which fields are protected by
5209         the image lock.
5211 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
5213         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
5215         * generic-sharing.c (mono_method_construct_object_context): Remove the
5216         wrapper_type == NONE assert, it is not needed.
5218 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
5220         * reflection.c (clear_cached_object): New helper function.
5221         (mono_method_clear_object): New function to clear the cached reflection
5222         objects for a dynamic method.
5224         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
5225         Partly fixes # 463323.
5226         
5227 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
5229         * class.c:
5230         * loader.c:
5231         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
5233 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
5235         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
5236         take the image lock instead of the loader lock.
5238         * metadata-internals.h: Export new functions.
5240 2009-02-12  Miguel de Icaza  <miguel@novell.com>
5242         * domain.c (app_config_parse): Remove another use of stat that is
5243         not necessary as g_file_get_contents already does the presence
5244         check. 
5246 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
5248         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
5250         * marshal.c: Move the bstr handling code to cominterop.c.
5252         * marshal.c: Remove some COM interop code missed previously.
5254 2009-02-12  Miguel de Icaza  <miguel@novell.com>
5256         More Paolo patches from the Wii port:
5257         
5258         * security.c: Remove ves_icall_System_Environment_get_UserName
5259         from here.
5261         * icall.c: And put ves_icall_System_Environment_get_UserName
5262         here. 
5264         * appdomain.c (mono_set_private_bin_path_from_config): Remove
5265         redundant call to stat that was only used to test for the file
5266         existence.   Patch from Paolo.
5268         * gc.c (run_finalize): If COM is disabled, do not link in
5269         mono_marshal_free_ccw.
5271         * generic-sharing.c: Use alloca.h here as well.
5273 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
5275         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
5277 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
5279         * cominterop.c cominterop.h: New files.
5281         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
5282         function/typedefs which are needed by cominterop.c global.
5284 2009-02-12  Mark Probst  <mark.probst@gmail.com>
5286         * generic-sharing.c: Don't take the loader lock to guard image
5287         mempool allocs.
5289 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5291         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
5292         called without the loader lock which is required to guard MonoImage:tokens.
5294 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5296         * class.c:
5297         * metadata.c:
5298         * method-builder.c:
5299         * marshal.c:
5300         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
5302 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5304         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
5305         Rework the code to use regular mono_image_alloc/0.
5307         * loader.c: Rework the code to use regular mono_image_alloc/0.
5309         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
5311 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
5313         * object-internals.h : Fixing a typo in the 
5314           MonoReflectionComVisibleAttribute struct.
5316         * marshal.c (cominterop_com_visible): Check the implemented 
5317           interfaces for ComImport.
5319         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
5320           assume that bools should be treated as VARIANTBOOLs.
5322         * marshal.c (emit_marshal_boolean): Adding cases for 
5323           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
5325         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
5326           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
5328         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
5329           should be treated as VARIANTBOOLs.    
5331         Code is contributed under MIT/X11 license.
5333 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5335         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
5336         allocation with the image lock.
5338 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5340         This patch is the last of a series to remove explicit reference of MonoImage::mempool
5341         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
5343         * object.c: Add mono_string_to_utf8_image.
5345         * object-internals.h: Export mono_string_to_utf8_image.
5347         * reflection.c: Rework all explicit references to the the image mempool to go thought
5348         the mono_image_alloc set of functions.
5350 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5352         This patch is the third of a series to remove explicit reference of MonoImage::mempool
5353         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
5354         and generics-sharing.c.
5356         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
5357         as first argument. Note that this function remains broken as it doesn't perform locking around the
5358         mempool allocation.
5360         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
5362         * image.c: Add g_slist_append_image.
5364         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
5365         the supplied image for allocation. Move code into mono_metadata_field_info_full.
5367         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
5368         Fix all related code to do the same.
5370         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
5372         * metadata-internals.h: Fix the signatures.
5374 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5376         This patch is the second of a series to remove explicit reference of MonoImage::mempool
5377         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
5378         and similar to work using MonoImage.
5380         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
5381         MonoMemPool.
5383         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
5385         * class.c (mono_metadata_signature_deep_dup): Same.
5387         * class.c (inflate_generic_type): Same.
5389         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
5391         * metadata.c (mono_metadata_signature_dup_full): Same.
5393         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
5394         mono_metadata_signature_dup_full.
5396         * metadata.c (mono_metadata_type_dup): Same.
5398         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
5400         * reflection.c: Same.
5402         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
5404         * metadata-internals.h: Fix the signatures.
5406         * class-internals.h: Same.
5408 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5410         This patch is the first of a series to remove explicit reference of MonoImage::mempool
5411         and use mono_image_alloc set of functions instead. 
5413         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
5414         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
5415         of a MonoMemPool.
5417         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
5419         * class.c (g_list_prepend_mempool): Removed.
5421         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
5423         * image.c: Add g_list_prepend_image.
5425         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
5427         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
5430 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5432         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
5433         mono_image_unlock.
5435         * image.c (mono_image_init): Init the lock field.
5437         * image.c (mono_image_init): Cleanup the lock field.
5439         * image.c: Add mono_image_(un)lock functions.
5441 2009-02-11  Mark Probst  <mark.probst@gmail.com>
5443         * class.c, class-internals.h: mono_method_get_context_general()
5444         combines the functionality of mono_method_get_context() and
5445         mini_method_get_context().
5447         * generic-sharing.c, domain-internals.h:
5448         mono_method_construct_object_context() and
5449         mono_domain_lookup_shared_generic() moved from mini.
5451         * icall.c (ves_icall_InternalInvoke): Handle the case where the
5452         method doesn't have the correct instantiation because it's shared
5453         generic code.  Fixes #473999.
5455 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
5457         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
5459         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
5460         
5461 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5463         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
5465         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
5467         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
5468         and recheck the cache for dups after it.
5470         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
5472         Fixes one of the deadlocks found in #473150.
5474 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
5476         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
5477           For Win32, add additional break conditions for accept.
5479         Code is contributed under MIT/X11 license.
5481 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
5483         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
5484         lazily initialize the native wrapper cache.
5485         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
5486         cache, since they are different from the normal wrappers.
5488         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
5490         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
5491         AOT compiled native wrappers.
5493 2009-02-09  Geoff Norton  <gnorton@novell.com>
5495         * appdomain.h:
5496         * security-core-clr.c: Allow enabling core-clr from the embedding
5497         API.
5499 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5501         * socket-io.c: when requesting all the local ips, if there are no
5502         interfaces up and running, MS returns 127.0.0.1.
5504 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5506         * mono-perfcounters-def.h: processor time is an inverse time.
5507         Fixes bug #468625.
5509 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5511         * socket-io.c: an empty host name returns the list of local IPs.
5512         Fixes bug #386637 part 1/2.
5514 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
5516         * verify.c (mono_class_interface_implements_interface): Call
5517         mono_class_setup_interfaces ().
5518         (merge_stacks): Ditto.
5520 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
5522         * class.c (mono_class_setup_interfaces): New function to lazily initalize
5523         klass->interfaces.
5524         (mono_generic_class_get_class): Don't initalize klass->interfaces.
5525         (mono_generic_class_get_class): Ditto.
5527 2009-02-06  U-QUACK\miguel  <miguel@quack>
5529         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
5530         they live in security.c
5532         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
5533         another bit from Paolo's code.
5535 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
5537         * object.c (build_imt_slots): Add a small optimization to avoid inflating
5538         methods which will be discarded by add_imt_builder_entry ().
5540         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
5541         need to be boxed.
5543         * loader.c: Add a statistics for the size of the memberref signature cache.
5544         
5545         * loader.c (find_cached_memberref_sig): New helper function.
5546         (cache_memberref_sig): Ditto.
5548         * loader.c: Cache the result of parsing memberref signatures, since otherwise
5549         they will be parsed again for every generic instantiation, leading to unbounded
5550         memory growth.
5552 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5554         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
5555         parameters of generic methods.
5557         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
5558         after the original method is copied to the inflated method.
5559         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
5561         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
5562         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
5564         * class.c metadata.c: Update after the changes above.
5566 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
5568         * metadata-verify.c: Simplified error handling and added
5569         section table validation.
5571 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5573         * class-internals.h (MonoClassExt): New structure containing rarely used
5574         fields of MonoClass.
5575         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
5576         through a new 'ext' field.
5578         * class.c (mono_class_alloc_ext): New helper function to allocate 
5579         class->ext.
5581         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
5583 2009-02-05  Mark Probst  <mark.probst@gmail.com>
5585         * object.c (mono_object_get_virtual_method): Properly inflate
5586         generic methods.  Fixes #472692.
5588 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
5590         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
5591         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
5592         for the parent type, the created type must be ready to be used on a generic
5593         instantiation.
5594         We fill this_arg/byval_arg if the parent is a generic instance to make sure
5595         we won't have duplicated entries in generic_inst_cache.
5597         Fixes #469553.
5599 2009-02-05  Miguel De Icaza  <miguel@novell.com>
5601         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
5602         replace with plain BSD per the comments on the bug MONO77637.
5604 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5606         * class.c (mono_class_get_generic_class): New accessor function.
5607         (mono_class_get_generic_container): Ditto.
5609         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
5610         fields, similar to the ones in MonoMethod.
5612         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
5613         (mono_class_create_from_typedef): Set klass->is_generic if needed.
5615         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
5616         
5617         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
5618         the same information as element_class->byval_arg.
5620         * class.c reflection.c: Remove references to class->byval_arg.
5622         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
5623         klass->enum_basetype directly.
5625         * verify.c metadata.c object.c icall.c reflection.c: Use 
5626         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
5627         directly.
5629 2009-02-04  Miguel de Icaza  <miguel@novell.com>
5631         * icall-def.h: Remove internal calls for sockets when
5632         DISABLE_SOCKET is defined, file system writing features when the
5633         OS only support reading and not writing data and Policy support if
5634         the Policy is disabled.
5635         
5636         * image.c (do_mono_image_open): Apply Paolo's patches for using
5637         mono_file_map_ APIs here.
5639         * assembly.c: Add support for platforms to avoid prefix
5640         auto-detection. 
5642 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
5644         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
5645         warning.
5647         * class.c (mono_class_inflate_generic_class): New helper function.
5649         * class.c: Use mono_class_inflate_generic_class in a few places. Add
5650         statistics for inflated methods/classes.
5652         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
5654         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
5655         the call is made from Delegate.CreateDelegate () for the invoke method of
5656         a delegate.
5658         * loader.c: Add a statistics for the memory occupied by inflated signatures.
5660         * metadata.c (mono_metadata_signature_size): New helper function.
5662         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
5663         generic instances.
5665         * metadata.c (inflated_method_in_image): Avoid calling 
5666         mono_method_signature () if the method does not already have a signature.
5668 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5670         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
5671         valuetype is compatible with target type, check by inheritance as a
5672         VT is not really compatible with System.ValueType, for example.
5674         * verify.c (do_invoke_method): Improve error message.
5676         * verify.c (do_box_value): If boxing a nullable, use the type argument
5677         on stack instead.
5679         * verify.c (do_newobj): Improve error message.  
5681         Fixes #469549.
5683 2009-02-03  Miguel de Icaza  <miguel@novell.com>
5685         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
5687 2009-02-03  Mark Probst  <mark.probst@gmail.com>
5689         * generic-sharing.c: Don't hold domain lock when calling
5690         instantiate_other_info().  Fixes #471958.
5692         * domain-internals.h, loader.c: Describe locking policy of domain
5693         lock vs loader lock.
5695 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5697         * verify.c (mono_delegate_signature_equal): Make it possible to check
5698         first-arg-bound delegates to static method.
5700         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
5701         static methods with the first arg bound.
5703         Fixes #469529.
5705 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5707         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
5708         errors.
5710         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
5711         under strict mode. Any type, when boxed can be seen as a reference type.
5713         Fixes #469528.
5715 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
5717         * object.h: The lower bound of an array is a signed integer value.
5718         Introduce mono_array_lower_bound_t typedef. It should be used instead of
5719         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
5721         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
5722         calculate the upper bound.
5723         
5724         Fixes #471252.
5726 2009-02-02  Miguel de Icaza  <miguel@novell.com>
5728         From Paolo's work, refactored, cleared up:
5729         
5730         * threadpool.c, icall.c: ifdef code that requires a working socket
5731         stack.
5733         * metadata.c (mono_metadata_field_info): Do not attempt to return
5734         a value from a function declared as void.
5736         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
5737         from the console stack.
5739         * assembly.c: use strrchr instead of rindex.
5741         * class.c, object.c, marshal.c, icall.c, reflection.c: include
5742         alloca.h on systems that have it.
5744         * environment.c: Avoid code that uses stuff from
5745         HAVE_SYS_UTSNAME_H
5746         
5747         * appdomain.c: Include sys/time.h.
5749         * console-io.c: include sys/ioctl.h if it is available.
5751 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
5753         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
5755         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
5756         the method builder.
5758         * marshal.c: Set mb->skip_visibility instead of setting it on the method
5759         after it was created and cached, as the later is not thread safe.
5760         
5761 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
5763         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
5764         called while the debugging module is not initialized. Fixes #471669.
5766 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
5768         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
5770         Fixes #471255.
5772 2009-02-02  Mark Probst  <mark.probst@gmail.com>
5774         * generic-sharing.c (lookup_or_register_other_info): Make sure the
5775         loader lock is not taken while the templates lock is held.  Fixes
5776         #471089.
5778 2009-02-02  Mark Probst  <mark.probst@gmail.com>
5780         * metadata.c (type_in_image): Added a check to fix a monodis
5781         crash.
5783 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
5785         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
5786         nullable arguments.
5788         * object.c (mono_runtime_invoke_array): Ditto.
5789         
5790         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
5791         freeing wrappers of dynamic methods.
5793         * loader.c (mono_free_method): Call it. Fixes #463323.
5794         
5795         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
5796         methods taking vtype/byref arguments, to fix yet another bug caused by
5797         the sharing of runtime invoke wrappers. Partly fixes #471259.
5799 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
5801         * debug-mono-symfile.c (check_line): Return NULL instead of returning
5802         <first file in file table>:1 when the IL offset does not have an associated
5803         line number.
5805 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
5807         * mono-debug.c (mono_debug_lookup_locals): New function to return local
5808         variable info for a method.
5810         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
5811         
5812 2009-01-30  Jb Evain  <jbevain@novell.com>
5814         * pedump.c: reuse code from monodis to make sure pedump honors
5815         MONO_PATH, which is needed to verify net_2_1 assemblies.
5817 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
5819         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
5820         there is no line number info.
5822 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
5824         Avoid some MonoType allocations
5825         * reflection.c (mono_reflection_initialize_generic_parameter):
5826         Reuse MonoType from param->pklass rather than allocating one.
5827         (mono_dynamic_image_free): Update to changes.
5829 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
5831         Rearrange some code to improve consistency
5832         * reflection.c (mono_reflection_setup_generic_class): Move body ...
5833         (mono_reflection_initialize_generic_parameter): ... here.
5835 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
5837         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
5838         with type constraints as an experiment.
5840         * boehm-gc.c (on_gc_notification): Update mono_stats.
5842 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
5844         Avoid some allocations
5845         * class-internals.h (_MonoGenericInst::type_argv): Convert from
5846         pointer to tail array to avoid extra allocation.
5847         * metadata.c (free_generic_inst): Update to changes.
5848         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
5849         on-stack struct.
5851 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
5853         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
5854         return TRUE if the two type objects are the same.
5856 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
5858         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
5859         (mono_class_native_size): Use klass->marshal_info->min_align instead of
5860         klass->min_align, since klass->min_align contains the managed alignment,
5861         while the native alignment can be different, like for longs on x86.
5862         Fixes #469135.
5864         * class-internals.h (MonoMarshalType): Add a min_align field.
5866 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
5868         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
5869         the 1.0 format.
5871 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
5873         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
5874         some comments about the usage of the used_regs field.
5876         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
5877         Fixes #469217.
5879 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
5881         * appdomain.c: return NULL instead of throwing FileNotFoundException
5882         when LoadAssembly() fails.
5884 2009-01-23  Mark Probst  <mark.probst@gmail.com>
5886         * metadata.c (mono_metadata_generic_param_equal): Only compare the
5887         image if the owner is NULL.  Fixes the AOT failures.
5889 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
5891         * metadata.c (mono_metadata_load_generic_params): Initialize the 
5892         MonoGenericParam structure using memset so the image field is initialized
5893         as well.
5895 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5897         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
5898         a plain store.
5900 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
5902         * class.c (mono_class_setup_vtable_general): In the generic instance
5903         optimization, set method->slot for abstract virtual methods. Fixes part of
5904         #467834.
5906 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5908         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
5909         which signals that the unloading has started but all appdomain services must
5910         remain operational.
5912         * appdomain.c (mono_domain_unload): The initial state for unloading now
5913         is unloading_start and we switch to unloading after the managed call to
5914         AppDomain::DomainUnload has finished.
5916         The new unloading state has to be created because managed code in the
5917         DomainUnload event can depend on things like the threadpool still working.
5918         The domain must remain fully functional while the event executes.
5920         This shown as an issue due to Process::WaitForExit, which waits for
5921         async reads of stdout and stderr to complete. Since those are processed
5922         in the threadpool the code deadlocks because the DomainUnload callback 
5923         waits for the async read finished event, which should have been set by a
5924         threadpool job but has been discarded due to the domain been in unload
5925         state.
5927 2009-01-21  Mark Probst  <mark.probst@gmail.com>
5929         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
5930         image must match.
5932 2009-01-21  Mark Probst  <mark.probst@gmail.com>
5934         * reflection.c (resolve_object): For fields, inflate the class and
5935         then get the field in the inflated class.
5937 2009-01-20  Mark Probst  <mark.probst@gmail.com>
5939         * object-internals.h (struct _MonoException): Added a comment
5940         explaining the new use of trace_ips.
5942 2009-01-20  Mark Probst  <mark.probst@gmail.com>
5944         * generic-sharing.c (inflate_other_data): Inflate array methods
5945         correctly.
5947         * loader.c, class-internals.h: Rename search_in_array_class() to
5948         mono_method_search_in_array_class() and make it non-static.
5950 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
5952         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
5953         Hopefully fixes #458168.
5955 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
5957         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
5958         as it is performed elsewhere.
5960         Code is contributed under MIT/X11 license
5962 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
5964         * mono-perfcounters-def.h: Add counters for asp.net requests total and
5965         requests queued.
5966         * object.c (mono_raise_exception): Increment the exceptions total
5967         counter when an exception is thrown.
5968         * class-internals.h: Add a location for storing the total number of
5969         asp.net requests served.
5970         * mono-perfcounters.c: Implement update support for asp.net counters
5971         from the class libraries. Implement read support for asp.net counters
5972         and exceptions total counter.
5974 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
5976         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
5977         accessing klass->methods. Fixes #467385.
5979 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
5981         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
5982         for byval arguments without an [Out] attribute. Fixes #467212.
5984         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
5985         Fix compilation under android.
5986         
5987         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
5988         processed, scan them directly after they are copied, to achieve better locality
5989         and cache usage.
5991         * socket-io.c: Applied patch from Koushik Dutta
5992         (koush@koushikdutta.com). Disable IPV6 when running under android.
5994 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
5996         * icall.c (ves_icall_InternalExecute): Add write barriers.
5998         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
5999         the GC code.
6001         * sgen-gc.c: Implement write barriers in IL code.
6003 2009-01-17  Geoff Norton  <gnorton@novell.com>
6005         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
6007 2009-01-17  Geoff Norton  <gnorton@novell.com>
6009         * image.c: When unloading the image->references table, there can be gaps
6010         in it.  Ensure that we iterate every entry to avoid leaking assembly references
6011         when unloading an appdomain.
6013 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
6015         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
6016         speed up ptr-in-nursery checks.
6018         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
6019         threads_lock () to prevent deadlocks.
6021         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
6022         does not need to be scanned during minor collections, since writes to it
6023         must use write barriers.
6025 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
6027         * metadata-verify.c: Add pe nt header verification.
6028         
6029 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
6031         * gc.c: Fix a few warnings when using SGEN.
6033 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
6035         * metadata-verify.c: Add pe optional header verification.
6037 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
6039         * sgen-gc.c: Add support for user defined marker functions, used by
6040         MonoGHashTable to avoid registering a GC root for every hash node.
6042 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
6044         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
6045         non-pinned roots into separate hashes to avoid having to traverse them
6046         in functions which are only interested in one kind.
6048 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
6050         * metadata-verify.c: Add pe header machine field verification.
6051         
6052 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
6054         * metadata-verify.c: Add pe header size verification.
6056 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
6058         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
6059         using the GC, they don't contain references.
6061         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
6063 2009-01-13  Geoff Norton  <gnorton@novell.com>
6065         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
6066         AppDomains created on the native side can be cleaned up on the native side.
6068 2009-01-13  Geoff Norton  <gnorton@novell.com>
6070         * appdomain.c: Ensure that we call mono_context_init for the embedding api
6071         as well as the managed api.
6073 2009-01-13  Geoff Norton  <gnorton@novell.com>
6075         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
6076         with a MonoAppDomain initialized against it.
6078 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
6080         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
6081         
6082         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
6084         * marshal.c: Avoid setting the exception clauses after a method has been entered 
6085         into the wrapper caches. Fixes #465700.
6087         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
6088         method builder.
6089         (mono_mb_create_method): Set the clauses from the method builder.
6091 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
6093         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
6094         Patch from Makoto Kishimoto.
6096 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
6098         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
6099         encoding them as ROOT_DESC_COMPLEX.
6100         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
6102 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
6104         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
6105         no longer point to the nursery.
6107         * sgen-gc.c: Add a few comments/FIXMEs.
6108         
6109         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
6111         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
6112         initialization of the various _method variables thread safe. Fixes
6113         #465377.
6115 2009-01-12  Mark Probst  <mark.probst@gmail.com>
6117         * domain.c, domain-internals.h: Remove the shared_generics_hash
6118         and its lookup functions.
6120 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
6122         * socket-io.c:  Fixing the MSVC build. 
6124         Code is contributed under MIT/X11 license.
6126 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
6128         * metadata-verify.c: Add pe header watermark verification.
6130 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6132         * metadata-verify.c: Add lfanew verification.
6134 2009-01-12  Jb Evain  <jbevain@novell.com>
6136         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
6137         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
6139 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
6141         * socket-io.c: Fix the build.
6143         * environment.c: Fix an #ifdef.
6145 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6147         * threadpool.c (async_invoke_thread): Handle the wait function returning
6148         WAIT_IO_COMPLETION as well.
6149         (async_invoke_io_thread): Ditto.
6151 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
6153         * threads.c: Fixing the Windows build.
6155         Code is contributed under MIT/X11 license.
6157 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6159         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
6160         interrupt a wait.
6161         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
6162         the thread to wait again.
6164 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6166         * metadata-verify.c: Initial skeleton of the metadata verifier.
6168         * pedump.c: Add support for the metadata verifier.
6170         * verify-internal.h: Export the whole assembly metadata verifier function.
6172 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6174         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
6176 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6178         * Makefile.am: Upgrade dtrace-prelink.sh location.
6180 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
6182         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
6183         well. Otherwise the shutdown deadlock that happens on unix will can happen
6184         as well.
6185         If the main thread code finishes too fast it's possible that the finalizer
6186         thread won't have executed yet, won't record itself as the finalizer thread
6187         and the shutdown sequence will wait on it forever.
6189 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
6191         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
6192         with MSVC.
6194 2009-01-08  Miguel de Icaza  <miguel@novell.com>
6196         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
6197         Robert Jordan for pointing this out.
6199 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
6201         * icall.c
6202         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
6203         ves_icall_System_IO_DriveInfo_GetDriveType.
6205 2009-01-07  Miguel de Icaza  <miguel@novell.com>
6207         * icall.c: Wrap calls to mono_strtod in CriticalSection
6208         invocations when using eglib, to work around #464316.
6210 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
6212         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
6213         return value of GetCurrentDirectory to never access unitialized memory.
6215 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
6217         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
6218         return value of GetCurrentDirectory and expand the buffer if needed.
6220         Fixes #459094.
6222 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
6224         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
6225           Adding a call to mono_init_com_types.
6227         Code is contributed under MIT/X11 license.
6229 2009-01-07  Geoff Norton  <gnorton@novell.com>
6231         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
6232         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
6233         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
6234         be the value of the ip buffer.
6236 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6238         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
6239         interfaces_packed here.
6241         Fixes part of #463294.
6243 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6245         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
6247         Fixes part of #463294.
6249 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6251         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
6252         is a boxed complex as well.
6254         Fixes part of #463294.
6256 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6258         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
6259         control if a methodspec should be created for the generic method definition from external assemblies.
6260         Caching of methodspec is done using the handleref hash table.
6262         Fixes #462592.
6264 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
6266         * loader.c (find_method): When searching the interfaces of a class
6267         check the transitive closure of implemented interfaces.
6269         Fixes #463303.
6271 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
6273         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
6274         
6275 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
6277         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
6278         interfaces calculation to fill_valuetype_array_derived_types.
6280         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
6281         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
6282         for example.
6284         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
6285         interfaces for valuetypes if needed.    
6287         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
6288         for their basetype as well. Types are array expanded if rank is > 0.
6290         Fixes #400716.
6292 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
6294         * socket-io.h : Changing the signature of
6295           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
6296           the blocking state.
6298         * icall-def.h :  Changing the signature of
6299           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
6301         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
6302           For Windows only.  Avoid blocking when calling accept by
6303           querying for a connection via select.  The loop also queries
6304           the thread state every 1000 micro seconds for the thread
6305           stop state.  This will avoid the process hanging on shutdown
6306           when using a TcpChannel that is never connected to.
6308         Code is contributed under MIT/X11 license.
6310 2008-12-30  Marek Safar  <marek.safar@gmail.com>
6312         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
6314 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
6316         * class.c (get_implicit_generic_array_interfaces): Extract common
6317         code to a helper function making it a lot easier on the eyes.
6319 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
6321         * class.c (get_implicit_generic_array_interfaces): If the internal
6322         enumerator is an interface inflate System.Object instead of itself.
6324         Fixes #461261.
6326 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
6328         * object.c (mono_runtime_invoke_array): Don't assert with
6329         byref nullable types.
6331         * marshal.c (mono_marshal_get_runtime_invoke): To handle
6332         byref nullables we unbox the object and store it on the
6333         stack. 
6334         We can't use the boxed object since it is the T of Nullable<T>
6335         and the boxed representation of a nullable it's underlying type
6336         or null.
6337         We could cheat and create a boxed nullable and use the same
6338         machinery of other byref VTs but this feels like a hack and
6339         using the stack has the bonus of reducing heap pressure.
6341         Fixes #461941.
6343 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
6345         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
6346         return value.
6348         Fixes #461867.
6350 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
6352         * icall-def.h : Adding an internal call definition for 
6353           System.Environment.internalBroadcastSettingChange.
6355         * icall.c : Adding a Windows only implementation to broadcast a 
6356           WM_SETTINGCHANGE when an environment variable has changed.
6358         Code is contributed under MIT/X11 license.
6360 2008-12-19  Mark Probst  <mark.probst@gmail.com>
6362         * class.c, class-internals.h: Made
6363         mono_class_has_parent_and_ignore_generics() non-static.
6365 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
6367         * image.c: deal with the mmap failing when loading an image.
6369 2008-12-17  Geoff Norton  <gnorton@novell.com>
6371         * threadpool.c: Ensure that the io_queue_lock is initialized
6372         in all circumstances, as we always attempt to cleanup against it.
6374 2008-12-17  Miguel de Icaza  <miguel@novell.com>
6376         * icall.c (ves_icall_System_Environment_get_Platform): For
6377         compatibility reasons for existing client code we will keep
6378         returning 4 for a while.   
6380         For how long will depend on the documentation being updated, and
6381         for us to give client code a chance to be updated.
6383         This reverts the original decison on #433108 since we did not
6384         catch roughly 33 instances of the broken code in our own source
6385         code base, we did not catch failures on the buildbots, and QA did
6386         not bring this as a problem.
6388         Only today I found some customer's code breaking due to our own
6389         class libraries not being fully updated and tracked it down to
6390         this change.  I am reverting it because if we could not even get
6391         our story straight in our own code base, how can we hope that our
6392         end user code be fixed?
6394         As of this morning, our Wiki page that documents how to detect
6395         Unix had not been fixed.    
6397 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
6399         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
6401         * class.c (mono_class_get_fields): Handle loading errors.
6403 2008-12-12 Mark Mason <mmason@upwardaccess.com>
6405         * 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.
6406         
6407 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
6409         * mono-perfcounters.c: avoid warning.
6411 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6413         * reflection.c (ensure_runtime_vtable): Work on generic instances and
6414         make sure all interfaces have MonoClass::interface_id set.
6416         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
6417         method table is property set.
6419 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6421         * class.c: New function mono_class_setup_interface_id that setup
6422         MonoClass::interface_id if needed.
6424         * class-internals.h: Export new function.
6426 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6428         * class.c: Add code to sanity check the vtable after setup_vtable_general
6429         has done it's work.
6431 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
6433         * icall.c: make Assembly.GetExecutingAssembly work properly when
6434         reflection is used to invoke the method.
6435         Bug #321781 fixed.
6437 2008-12-11  Mark Probst  <mark.probst@gmail.com>
6439         * metadata/generic-sharing.c: Look for constraints in all type
6440         arguments, not just the first one.
6442 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
6444         * appdomain.c: return the correct CodeBase for an Assembly instance
6445         that was loaded from the shadow-copy directories.
6446         Bug #458190 fixed.
6448 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
6450         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
6452         * sgen-gc.c (check_object): New debugging helper function.
6454         * object.c: Fix calls to mono_value_copy_array ().
6456 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6458         * class.c (mono_class_setup_fields): If working on an inflated class
6459         first check if the generic definition did init with success.
6461         Fixes #445361.
6463 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6465         pedump.c (main): Fix a warning.
6467 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
6469         * object-internals.h : Adding a definition for 
6470           MonoReflectionComVisibleAttribute.
6472         * marshal.c (cominterop_com_visible) :  Method added to check the 
6473           ComVisible attribute of a class.
6475         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
6476           cominterop_raise_hr_exception added to consolidate common code 
6477           to raise hr exceptions.
6479         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
6480           if a managed class should support IDispatch.
6482         * marshal.c 
6483           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
6484           Added additional checks for managed object when getting 
6485           an IDispatch interface.
6487         Code is contributed under MIT/X11 license.
6489 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6491         pedump.c (main): Handle mono_get_method () returning NULL. 
6493 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
6495         * marshal.h: Fix a warning.
6497 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
6499         * marshal.c : Adding cominterop_release_all_rcws to release all
6500           runtime callable wrappers held by the runtime.
6502         * marshal.h : Adding declaration for cominterop_release_all_rcws.
6503           
6504         Code is contributed under MIT/X11 license.
6506 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
6508         * metadata.c (mono_image_alloc_lock): New helper function.
6509         (mono_image_alloc0_lock): Ditto.
6511         * metadata.c: Use the alloc_lock () helper functions for allocating
6512         memory from the image mempool.
6514 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
6516         * class.c (mono_class_from_generic_parameter): Document it's
6517         locking behavior. Fix double checked locking here, we stored in
6518         param->pklass a partially initialized MonoClass and no membar was used.
6520 2008-12-05  Marek Habersack  <mhabersack@novell.com>
6522         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
6523         (3) functions are present in the C library use them to do the
6524         job. If they are absent, make sure that the sum of int_part and
6525         dec_part is rounded before returning. This is necessary due to the
6526         division of dec_part by the power of 10 before the final addition
6527         is performed - if the result is not rounded in some cases it will
6528         yield invalid results.
6530 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
6532         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
6533         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
6534         instruction instead of a pointer constant.
6536 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
6538         * loader.c (mono_method_get_header): Do most of the work outside the
6539         loader lock, to avoid assembly load hook deadlocks.
6541         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
6542         (mono_metadata_parse_type_full): Ditto.
6544 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
6546         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
6547         Make the stack depth fixed. Ensure proper argument passing to the backtrace
6548         funtions. Finally, use a lock to produce well ordered output.
6550         The lock looks silly, as all calls to the corlib mempool should be guarded
6551         with the loader lock, but for some reason this fact doesn't help. 
6553         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
6555 2008-12-02  Mark Probst  <mark.probst@gmail.com>
6557         * socket-io.c: 64 bit big-endian fixes.
6559 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
6561         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
6562         targets that require strict compatibility between the types.
6564         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
6565         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
6566         Kill the strict argument and create a new one valuetype_must_be_boxed.
6568         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
6569         state that all valuetypes must be boxed.
6571         Fixes #448560.
6573 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
6575         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
6576         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
6578         Contributed under MIT/X11 license.
6580 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
6582         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
6583         the inflate_generic_type machinery should handle it.
6585         This avoids a crash when the field's flags is zero and it's type is
6586         a primitive.
6587         What happens is that mono_metadata_parse_type_full will see that opt_attrs
6588         is zero and will return one of the cached built-in primitive types. Since
6589         those types live in read-only memory, the code that copies it crashes.  
6591 2008-11-28  Mark Probst  <mark.probst@gmail.com>
6593         * object.c: Don't put function descriptors into generalized IMT
6594         thunks.
6596 2008-11-28  Mark Probst  <mark.probst@gmail.com>
6598         * class.c: Enable generic code sharing on PPC64.
6600 2008-11-27  Mark Probst  <mark.probst@gmail.com>
6602         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
6603         from mini/mini.c.
6605         * generic-sharing.c: Allocate the method template slists from the
6606         image mempool so it doesn't leak.
6608 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
6610         * class.c (generic_array_methods): Release the linked list.
6612 2008-11-27  Mark Probst  <mark.probst@gmail.com>
6614         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
6615         invocation to g_utf16_to_utf8().
6617 2008-11-26  Mark Probst  <mark.probst@gmail.com>
6619         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
6620         arguments on big endian archs.
6622 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
6624         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
6625         the type name (test added in corlib).
6627 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
6629         * pedump.c: initialize perf. counters. Fixes a segv.
6631 2008-11-25  Martin Baulig  <martin@ximian.com>
6633         * mono-debug-debugger.c
6634         (mono_debugger_runtime_invoke): Return the exception object if an
6635         exception was thrown.  Visual Studio displays the exception object
6636         in the locals window.
6638 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6640         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
6641         ftnptr.
6643 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6645         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
6646         MONO_TYPE_U are sizeof (gpointer), too.
6648 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6650         * marshal.c (mono_type_native_stack_size): Fixed size and
6651         alignment for reference types.
6653 2008-11-23  Mark Probst  <mark.probst@gmail.com>
6655         * class.c (mono_class_generic_sharing_enabled): Disable generic
6656         code sharing for PPC64.
6658 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
6660         * icall.c (mono_method_get_equivalent_method): Make sure
6661         method->klass->methods is inited before looping over it.
6663 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6665         * object.c: when calling ExecuteAssembly in a newly created domain,
6666         the configuration file and application base are already set up.
6667         Bug #446353 take 2 fixed.
6669 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
6671         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
6672         Fixes #444715. Fix a warning.
6674 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
6676         * appdomain.c: write the full path of the assembly to the .ini file
6677         created when "shadow-copying"
6678         Bug #446353 fixed.
6680 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
6682         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
6683         if signature==FALSE.
6685 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
6687         * marshal.h : Fix the cygwin build.
6688            marshal.c:12442: undefined reference to `_IID_IMarshal'
6689           
6690         Code is contributed under MIT/X11 license.
6692 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
6694         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
6695           free threaded marshaler when QueryInterface is called on a COM callable
6696           wrapper requesting the IMarshal interface.
6697           
6698         Code is contributed under MIT/X11 license.
6700 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
6702         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
6704         * reflection.c (mono_type_get_object): Special case the very common
6705         void type.
6707         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
6708         hold typeof(void).
6710 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
6712         * process.h : Adding method declaration for
6713           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
6714           
6715         * process.c : Adding implementation for
6716           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
6717           
6718         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
6719           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
6721         Code is contributed under MIT/X11 license.
6723 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
6725         * appdomain.c (unload_thread_main): Clean up threadpool by
6726         calling mono_thread_pool_remove_domain_jobs.
6728         * domain-internals.h (struct _MonoDomain): Add new fields to
6729         help coordinate the cleanup of the threadpool.
6731         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
6732         that cleans up the threadpool of all jobs associated with an appdomain.
6733         It does that by cleaning up the queues and making sure all active
6734         threads are accounted.
6736         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
6737         unloaded or in the process of. Take this is such way that there is
6738         no race condition between another thread starting the unload and the
6739         current thread acknowledging it.
6741         * threadpool.c (async_invoke_thread): Same.
6743         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
6744         firing the new thread.
6746         * threadpool.c (start_tpthread): Same.
6748         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
6750         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
6752 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
6754         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
6755         Add support for DuplicateHandle.
6756         
6757         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
6758         Add support for DuplicateHandle.
6759         
6760         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
6761         Add support for DuplicateHandle.
6763         Code is contributed under MIT/X11 license.
6765 2008-11-06  Mark Probst  <mark.probst@gmail.com>
6767         * class-internals.h: Make min_align into a whole byte.
6769         * class.c: Set min_align for SIMD types to 16.
6771 2008-11-05  Geoff Norton  <gnorton@novell.com>
6773         * attach.c: Default the attacher to enabled for all cases including
6774         embedded.
6776 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
6778         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
6779         change r117650.
6781 2008-11-04  Mark Probst  <mark.probst@gmail.com>
6783         * monitor.c, monitor.h: New function for querying offsets of
6784         members of MonoThreadsSync.
6786 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
6788         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
6789         to speed up this function and to avoid the boundless memory growth caused by
6790         the signature_dup () calls.
6792 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
6794         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
6795         wrapper.
6797         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
6798         by 1 bit.
6800         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
6802 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
6804         * appdomain.c:
6805         * domain-internals.h: made mono_set_private_bin_path_from_config()
6806         "internal".
6807         * object.c: call the above function after setting the configuration
6808         file path for the root domain.
6809         Fixes bug #314478.
6811 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
6813         * assembly.c: when the assembly is loaded from an absolute path, end
6814         basedir with a directory separator.
6815         Bug #440781 fixed.
6817 2008-10-30  Mark Probst  <mark.probst@gmail.com>
6819         * monitor.c (mono_monitor_get_fast_enter_method): If
6820         CompareExchange is not available, don't create the fastpath
6821         instead of asserting.  (The method is missing in the 1.1 profile.)
6823 2008-10-30  Mark Probst  <mark.probst@gmail.com>
6825         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
6827         * monitor.c, monitor.h: Code for generating Monitor.Enter and
6828         Monitor.Exit IL fastpaths.
6830 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
6832         * class.c (mono_class_create_from_typedef): Added Vector2ul.
6834 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
6836         * class.c (mono_class_create_from_typedef): Added Vector2l.
6838 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
6840         * class.c (mono_class_create_from_typedef): Added Vector2d.
6842 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
6844         * appdomain.c: translate \ into / for cache_path.
6845         * domain-internals.h: new mono_is_shadow_copy_enabled().
6846         * icall.c: (fill_reflection_assembly_name) do the same path
6847         manipulations that get_code_base does.
6848         (get_code_base) use mono_is_shadow_copy_enabled.
6850 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
6852         * appdomain.c: shadow-copied assemblies go to CachePath +
6853         ApplicationName when both are set. DynamicBase has nothing to do with
6854         shadow copies.
6855         Bug #406877 fixed.
6857 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
6859         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
6860         STANDALONESIG table.
6862         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
6863         standalone signatures.
6865         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
6866         comparison code: instead of comparing the signatures using a custom
6867         equals function, transform them to a common signature and compare that. This
6868         works better with AOT.
6870 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
6872         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
6874         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
6875         call for generic instances.
6876         (mono_class_setup_properties): Call setup_properties () before accessing
6877         gklass->properties.
6879         * class.c (mono_class_get_virtual_methods): New helper function to iterate
6880         over the virtual methods of a class using metadata if possible, avoiding the
6881         creation of MonoMethod's for non-virtual methods.
6882         
6883         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
6884         get_virtual_methods () to iterate over the virtual methods of classes.
6886 2008-10-25  Martin Baulig  <martin@ximian.com>
6888         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
6890 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
6892         * class.c (mono_class_create_from_typedef): Added Vector4i.
6894 2008-10-24  Mark Probst  <mark.probst@gmail.com>
6896         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
6897         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
6898         special-casing applies to eliminate the call completely.
6900 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
6902         * class.c (mono_class_create_from_typedef): Added Vector8s.
6904 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
6906         * class.c (mono_class_create_from_typedef): Added Vector16sb.
6908 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6910         * icall.c: get rid of annoying warning.
6912 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6914         * threadpool.c: in 1.x, if you change the background status of the
6915         threadpool thread, it's not reset.
6916         Remove unnecessary calls to SetState.
6918 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6920         * threadpool.c: asynchronously create a set of idle threads upon first
6921         use of the threadpool. SetMinThreads will now start the appropriate
6922         number of idle threads if they are not already running. The default is
6923         1 threadpool thread per CPU. Increased the maximum number of threads
6924         per CPU to 10.
6926 2008-10-22  Martin Baulig  <martin@ximian.com>
6928         Revert r116521 from Zoltan, it breaks the debugger:
6930         * class.c (mono_class_get_virtual_methods): New helper function to iterate
6931         over the virtual methods of a class using metadata if possible, avoiding the
6932         creation of MonoMethod's for non-virtual methods.
6933         
6934         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
6935         get_virtual_methods () to iterate over the virtual methods of classes.
6937 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6939         * threads.c: when creating a threadpool thread, set its state to
6940         'background'.
6941         * threadpool.c: reset the background state of a threadpool thread
6942         after finishing each work item
6943         Bug #437888 fixed.
6945 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
6947         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
6948         
6949         * class.c (mono_class_setup_vtable_general): Add an optimized version for
6950         generic instances which works by inflating the methods in the container
6951         class's vtable.
6953         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
6954         variant which doesn't make a copy if no inflation was done.
6955         (mono_class_setup_fields): Use it.
6957         * metadata.c (mono_metadata_get_shared_type): New helper function to
6958         return a shared instance of a given MonoType.
6960         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
6961         a copy of most non-generic types.
6963 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
6965         * threadpool.c: remove one more GetSystemInfo () call.
6967 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
6969         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
6970         use the code in mono-proclib.h to get processor information.
6972 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6974         * appdomain.c: fixed the logic that determines whether assemblies in a
6975         directory are "shadow-copied" or not. Bug #433483 fixed.
6977 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
6979         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
6980         warning.
6982 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
6984         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
6985         returning a vtype.
6987         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
6988         reflection.c: Use mono_field_get_name () for accessing a field's name.
6990         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
6991         class.c
6993         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
6994         field.
6996         * loader.c (find_method_in_class): Reenable the metadata optimization by
6997         not using it for generic instances.
6999         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
7000         data/def_type fields from MonoClassField into a separate structure.
7001         (struct MonoClassField): Remove data/def_type fields.
7002         (struct _MonoClass): Add a 'field_def_values' array to store the default
7003         values/RVA for fields.
7005         * class.c reflection.c: Update after the changes.
7006         
7007         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
7008         for accessing field->data.
7010         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
7012         * loader.c (find_method_in_class): Revert the last change for now as
7013         it breaks Mono.C5 unit tests.
7015         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
7016         'field_generic_types' and 'field_objects' which contain the information
7017         previously stored in MonoInflatedField.
7018         (MonoInflatedField): Delete.
7019         (struct _MonoClassField): Delete 'generic_info' field.
7021         * reflection.c: Store the information which was previously in 
7022         field->generic_info in MonoDynamicGenericClass instead.
7024         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
7025         MonoClassField changes.
7027 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
7029         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
7030         store the value inside the data array of the MonoMethodWrapper.
7031         This saves memory, is faster and fixes the lifetime issues (methods
7032         were never removed from the hash previously). May also fix bug#436996.
7034 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
7036         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
7037         generic instances, compute the type from the generic definition instead of
7038         looking in field->generic_info.
7040         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
7041         for inflated fields, the only user was get_fieldref_token () which no
7042         longer needs it.
7044         * class.c (mono_class_init): Revert the last change as it seems to cause
7045         crashes.
7047         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
7048         bytes on 64 bit platforms.
7050         * object.c (mono_class_create_runtime_vtable): Fix a warning.
7051         
7052         * object.c (mono_class_create_runtime_vtable): Don't initalize
7053         field->data/field->def_type here, it is done lazily by 
7054         mono_class_get_field_default_value ().
7056         * icall.c (ves_icall_get_enum_info): Call 
7057         mono_class_get_field_default_value () instead of directly accessing
7058         field->data and field->def_type.
7060         * object.c (get_default_field_value): Ditto.
7062         * class.c (mono_field_get_data): Ditto.
7063         
7064         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
7065         call for generic instances.
7067         * loader.c (find_method_in_class): If klass != from_class, then inflate
7068         the method with the context of from_class, since the caller assumes this.
7070 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
7072         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
7073         for accessing method->slot.
7075 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
7077         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
7079 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
7081         * class.c (mono_method_get_vtable_index): Use
7082         mono_method_get_vtable_slot () for accessing method->slot.
7084         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
7085         accessing klass->methods.
7087         * class.c (mono_method_get_vtable_slot): New helper function.
7088         (mono_class_get_vtable_entry): Ditto.
7089         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
7090         accessing method->slot.
7092         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
7093         method to get_inflated_method ().
7095         * class.c (mono_class_get_inflated_method): New helper method to obtain
7096         a method of an inflated class without calling setup_methods ().
7097         (mono_class_get_cctor): Use get_inflated_method.
7099         * generic-sharing.c (mono_class_get_method_generic): Ditto.
7100         
7101         * marshal.c image.c: Lazily create all the marshal caches.
7103         * image.c (mono_image_init): Move initialization of runtime_invoke
7104         caches to marshal.c.
7106         * marshal.c (get_cache): New helper function to lazily initialize a 
7107         wrapper cache.
7108         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
7110         * debug-helpers.c (mono_method_full_name): Include generic arguments.
7112 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
7114         * loader.c: fixed check for interface type.
7116 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
7118         * appdomain.c: check for NULL setup before it's referenced.
7121 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
7123         * class.c: remove the unused old vtable setup code.
7125 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
7127         * class.c: don't depend on interface order in
7128         setup_interface_offsets (bug #435777).
7129         * reflection.c: sort the InterfaceImpl table (patch from
7130         Jb Evain  <jbevain@novell.com>).
7132 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
7134         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
7135         the low level assemblies lock.
7137 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
7139         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
7140         object.c, reflection.c, socket-io.c, threads.c: introduced
7141         mono_framework_version () to return the major framewrok version,
7142         changed the code that was using more complex patterns to use it.
7143         Return the correct value for PlatformID for OSX.
7145 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
7147         * icall-def.h, process.h, process.c: added an icall to get info about
7148         processes using mono-proclib.
7150 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
7152         * mono-perfcounters.c: use the mono-proclib functions to
7153         access process information.
7155 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
7157         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
7158         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
7159         reflection.c: remove rawbuffer usage: mmap support is more sanely
7160         provided by utils/mono-mmap.
7162 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
7164         * gc.c: use posix semaphores when possible so that
7165         mono_gc_finalize_notify() is signal safe.
7167 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
7169         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
7170         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
7171         be #ifdef-ed out, the linker will remove the rest.
7173         * marshal.c: Implement DISABLE_COM.
7175         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
7177 2008-10-11  Miguel de Icaza  <miguel@novell.com>
7179         * locales.c (string_invariant_compare_char): Optimization: do not
7180         call g_unichar_type unless we actually need the information.
7182 2008-10-10  Mark Probst  <mark.probst@gmail.com>
7184         * object.c, class-internals.h: Also create remoting trampolines
7185         for generic methods.  Pass the domain to the remoting trampoline
7186         creation function, too.
7188 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
7190         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
7192 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
7194         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
7195         Vector4ui.
7197 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
7199         * assembly.c:
7200         * locales.c: remove the use of g_strdown. Fixes bug #322313.
7202 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
7204         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
7205         for the least possible amount of time (extending the fix in r113458).
7207 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
7209         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
7211 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
7213         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
7214         as possible simd intrinsic types.
7215         Optimized the test to check for the common prefix first.
7217 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
7219         * class.c: back out part of a broken optimization committed on
7220         May 23th (bug #433908).
7222 2008-10-09  Mark Probst  <mark.probst@gmail.com>
7224         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
7225         Win32.  Should fix #432388 for most cases until we have the new
7226         profiler on Win32.
7228 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
7230         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
7231         instead of using inst->id so the hash is stable for AOT.
7233 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
7235         * appdomain.c:
7236         * icall.c: create a .ini file for shadow-copied assemblies that
7237         contains the location of the original assembly. Use this to return the
7238         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
7239         Also fix the number of '/' for windows when returning the CodeBase.
7240         Fixes bug #430920.
7242 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7244         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
7246         Code is contributed under MIT/X11 license.
7248 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7250         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
7251           if if the class vtable needs initialized.
7253         Code is contributed under MIT/X11 license.
7255 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7257         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
7258           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
7259           STRING->BSTR, and CLASS->INTERFACE.
7261         Code is contributed under MIT/X11 license.
7263 2008-10-07  Marek Habersack  <mhabersack@novell.com>
7265         * sysmath.h: changed the declaration of the
7266         ves_icall_System_Math_Round2 icall by adding an extra
7267         away_from_zero parameter.
7269         * sysmath.c (ves_icall_System_Math_Round2): added support for
7270         away from zero rounding. The icall now takes an extra boolean
7271         parameter to signal that away from zero operation is requested.
7273 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
7275         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
7276         the delegate klass so it can work with full-aot.
7277         (mono_marshal_get_delegate_end_invoke): Ditto.
7278         (mono_marshal_get_delegate_invoke): Ditto.
7280 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
7282         * gc.c, attach.h, attach.c: remove a bad pattern:
7283         add_finalizer_callback () is not implemented correctly, it can't
7284         without adding more overhead to the finalizer loop and it's not
7285         even needed, since we know exactly what we need to call, so there is
7286         no need to do so through an expensive function pointer.
7288 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
7290         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
7291         for the no-gc case.
7292         * attach.c (mono_attach_init): Remove the #ifdef.
7294 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
7296         * attach.c (mono_attach_init): Don't use
7297         mono_gc_add_finalizer_thread_callback when compiling without GC.
7298         Fixes #432306.
7299         
7300         Code is contributed under MIT/X11 license.
7302 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
7304         * class.c (mono_class_create_from_typedef): Remove the 
7305         #ifndef DISABLE_SIMD stuff.
7307 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
7309         * class-internals.h (MonoClass): Added simd_type bit field.
7311         * class.c (mono_class_create_from_typedef): Check if type is a simd
7312         intrinsic.
7314 2008-10-03  Mark Probst  <mark.probst@gmail.com>
7316         * object.c (mono_method_add_generic_virtual_invocation): Only add
7317         instantiations to the thunk whose count is at least as large as
7318         the threshold.
7320 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
7322         * icall.c: changed the Type of the exception thrown when trying to
7323         invoke a constructor on an abstract class. Part of the fix for bug
7324         #324185.
7326 2008-10-02  Mark Probst  <mark.probst@gmail.com>
7328         * class.c, class-internals.h (mono_method_get_vtable_index): New
7329         function which returns the index into the vtable and properly
7330         handles inflated virtual generic methods.
7332 2008-10-01  Mark Probst  <mark.probst@gmail.com>
7334         * object.c, domain.c, object-internals.h, domain-internals.h:
7335         Generalize IMT thunk machinery to also handle thunks for virtual
7336         generic method invokes.  When a virtual generic method is invoked
7337         more than a number of times we insert it into the thunk so that it
7338         can be called without lookup in unmanaged code.
7340         * generic-sharing.c, class-internals.h: Fetching a
7341         MonoGenericInst* for a method from an (M)RGCTX.
7343 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
7345         * marshal.c (emit_marshal_string): Applied a variant of a patch by
7346         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
7347         marshalling. Fixes #431304.
7349 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
7351         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
7352           handle when ref is specified without In or Out.
7354         Code is contributed under MIT/X11 license.
7356 2008-09-30  Mark Probst  <mark.probst@gmail.com>
7358         * loader.c (mono_get_method_constrained): Don't expand method with
7359         the class's context, because it's already a method of that class.
7361 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
7363         * attach.c : should be correct build fix.
7365 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
7367         * attach.c: Fix the previous change.
7369 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
7371         * attach.c : quick w32 build fix.
7373 2008-09-27  Miguel de Icaza  <miguel@novell.com>
7375         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
7376         crashes MonoDevelop: #430455.
7378 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
7380         * domain-internals.h (struct _MonoDomain): Move most fields used only by
7381         the JIT do MonoJitDomainInfo in ../mini/mini.h.
7383         * domain.c: Remove initialization/cleanup of the removed fields.
7385 2008-09-27  Mark Probst  <mark.probst@gmail.com>
7387         * class.c (mono_class_generic_sharing_enabled): Enable generic
7388         code sharing for PPC.
7390 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
7392         * attach.c : Fixing the Windows builds.
7394         Code is contributed under MIT/X11 license.
7396 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
7398         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
7399         the default generic sharing mode to 'all'.
7401 2008-09-25  Mark Probst  <mark.probst@gmail.com>
7403         * generic-sharing.c, class-internals.h: New function for checking
7404         whether a method needs a static RGCTX invoke wrapper.  A few
7405         funtions moved from mini/generic-sharing.c.
7407         * icall.c: New function used.
7409 2008-09-25  Mark Probst  <mark.probst@gmail.com>
7411         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
7412         Static RGCTX invoke wrapping applies to value type methods, too.
7414         * class.c (mono_class_setup_vtable_general): In generic-shared
7415         value types, wrap methods with a static RGCTX invoke wrapper.
7417 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
7419         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
7420         osx build.
7422 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
7424         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
7425         register a callback which is called when the finalizer thread is woken
7426         up.
7427         (finalizer_thread): Call the callback if it exists.
7429         * attach.h attach.c: New files, implementing the attach mechanism.
7431         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
7432         
7433         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
7434         by the previous change.
7436 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
7438         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
7439         loader.c, marshal.c, metadata-internals.h, metadata.c,
7440         method-builder.c, object.c, reflection.c: introduced specific functions
7441         to allocate from the domain and image mempools and cleaned up most of
7442         the code to use them (still missing a few in reflection.c).
7443         Keep the loader bytes counter updated.
7445 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
7447         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
7448         loader-related counters.
7450 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
7452         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
7453         added more MS-compatible counters.
7455 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
7457         * class.c (mono_class_setup_fields): Call setup_fields before accessing
7458         class->blittable. Fixes #428217.
7460 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
7462         * reflection.c (mono_image_get_field_on_inst_token): Call 
7463         field_encode_signature () since that handles custom modifiers too.
7464         Fixes #424663.
7466 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
7468         * reflection.c (add_custom_modifiers): New helper function to merge custom
7469         modifiers stored in objects to a MonoType.
7470         (fieldref_encode_signature): Encode custom modifiers.
7471         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
7472         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
7474 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
7476         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
7477         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
7478         64-bit IL only images because imports are not resolved for IL only images.
7479         Special thanks to Bill Holmes for finding this bug and testing the patch.
7480         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
7482         Contributed under MIT/X11 license.
7484 2008-09-19  Miguel de Icaza  <miguel@novell.com>
7486         * mono-config.c (dllmap_start): Add support for the bits keyword
7487         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
7489 2008-09-19  Mark Probst  <mark.probst@gmail.com>
7491         * reflection.c (inflate_mono_method): When the class the method is
7492         to be inflated for is itself not inflated, just return the method.
7494 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
7496         * mono-perfcounters.c: use more user friendly process instance names.
7498 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
7500         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
7501           handle "[in] ref" and "[in][out] ref" cases.
7503         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
7504           to mono_mb_create_method.  This was causing problems calling native to
7505           managed passing Variants by value.
7507         Code is contributed under MIT/X11 license.
7509 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
7511         * class.c (can_access_internals): Call mono_assembly_load_friends ()
7512         before accessing the friend_assembly_names field.
7514         * assembly.c (mono_assembly_load_friends): Make this callable multiple
7515         times.
7516         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
7517         called lazily when it is needed.
7519         * metadata-internals.h (struct _MonoAssembly): Add 
7520         'friend_assembly_names_inited' flag.
7522 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
7524         * mono-perfcounters-def.h: fix the types of a few counters.
7525         * mono-perfcounters.c: implemented the instance names getter
7526         and a few bugfixes.
7528 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
7530         * culture-info-table.h : regenerated.
7532 2008-09-17  Robert Jordan  <robertj@gmx.net>
7534         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
7535         context bound objects. Fixes #415577.
7537         Code is contributed under MIT/X11 license.
7539 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
7541         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
7542         implementation (bug #423582).
7544 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
7546         * object.c (mono_object_get_virtual_method): Handle the case method->slot
7547         is not set. Fixes #426309.
7549 2008-09-16  Jb Evain  <jbevain@novell.com>
7551         * class.c (mono_class_from_name): fix the exported type look up
7552         when the type is defined in a referenced assembly.
7554 2008-09-16  Jb Evain  <jbevain@novell.com>
7556         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
7557         increment the next index counter on each iteration to make that work
7558         for more than one type forwarder. Unmanaged part to fix #422929.
7560 2008-09-15  Mark Probst  <mark.probst@gmail.com>
7562         * object-internals.h: enum ComInterfaceType in
7563         MonoInterfaceTypeAttribute is guint32, not guint16.
7565 2008-09-12  Mark Probst  <mark.probst@gmail.com>
7567         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
7568         writing code.
7570 2008-09-11  Mark Probst  <mark.probst@gmail.com>
7572         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
7573         not gboolean.
7575 2008-09-11  Mark Probst  <mark.probst@gmail.com>
7577         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
7578         Endianness fixes for MonoSymbolFileOffsetTable.
7580 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
7582         * process.c (complete_path) : Removing quotes from the 
7583           input path.  The glib file routines do not handle file paths
7584           that have quotes around them.
7586         Code is contributed under MIT/X11 license.
7588 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
7590         * socket-io.h : Adding a comment to provide locations where 
7591           changes to MonoSocketAsyncResult need to be synced.
7593         Code is contributed under MIT/X11 license.
7595 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
7597         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
7598         parameters as well. Fixes #425001.
7600 2008-09-08  Miguel de Icaza  <miguel@novell.com>
7602         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
7603         windows build.
7605 2008-09-07  Miguel de Icaza  <miguel@novell.com>
7607         * console-io.c: Add support for tracking the window size if it
7608         changes.
7610         The setup is very simple: the TtySetup function will now return a
7611         pointer to a location in memory that tracks the current console
7612         size.  The managed code checks its current value every time its
7613         queried against the last value set, and updates accordingly.
7615         With this setup we can work with multiple consoles, and we do not
7616         require to poke into managed code from a signal handler.
7618         Additionally, the environment for COLUMNS and LINES is now handled
7619         in unmanaged code.
7621         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
7623 2008-09-07  Mark Probst  <mark.probst@gmail.com>
7625         * marshal.c (mono_type_native_stack_size): Treat
7626         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
7628 2008-09-04  Jb Evain  <jbevain@novell.com>
7630         * class.c (mono_class_is_assignable_from): fix assignability of nullables
7631         to nullables.
7633 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
7635         * verify.c (verify_type_compatibility_full): Revert change
7636         to allow converting a native int to unmanaged pointer be verifiable
7637         under non-strict mode.
7638         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
7640         * verify.c: Added some TODOs.
7642 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
7644         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
7645           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
7646           Changed to use GlobalAlloc for the memory returned on Windows platforms.
7648         Code is contributed under MIT/X11 license.
7650 2008-09-02  Jb Evain  <jbevain@novell.com>
7652         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
7654 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
7656         reflection.c (typebuilder_setup_fields): Handle classes with
7657         explicit size.
7659 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
7661         class.c (mono_class_setup_events): Add memory barrier due to
7662         double checked locking.
7663         
7664         class.c (mono_class_setup_properties): Same.
7666 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
7668         * class.c (mono_class_is_assignable_from): Fix the build.
7669         
7670         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
7671         before accessing klass->interface_bitmap. Fixes #421744.
7673 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
7675         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
7676         the runtime into no-exec mode, useful when running the AOT compiler.
7678         * appdomain.c gc.c object.c: Avoid executing managed code when running
7679         in no-exec mode.
7680         
7681         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
7683         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
7684         special case when the mono_assembly_loaded () returns NULL because the 
7685         search hook is not installed.
7687 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
7689         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
7690         crashes in bstr marshalling on linux.
7692 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
7694         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
7695         with more than one parameter.
7697 2008-08-24  Miguel de Icaza  <miguel@novell.com>
7699         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
7700         start/stop flow control as well when turning off ICANON (allows
7701         C-s and C-q to be read by Console.ReadKey).
7703 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
7705         * class.c (mono_class_init): Move the initialization of nested classes
7706         into mono_class_get_nested_types (). Fixes #418433.
7708         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
7709         flag.
7711         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
7712         iterating tough the nested classes of a class.
7714 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
7716         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
7717         on arm.
7719 2008-08-22  Miguel de Icaza  <miguel@novell.com>
7721         * console-io.c (sigcont_handler): Support signal chaining for
7722         SIGCONT.
7724         (console_set_signal_handlers): Use best practices with sigaction,
7725         clear the structure before using it. 
7727 2008-08-22  Robert Jordan  <robertj@gmx.net>
7729         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
7730         Fix the Windows build.
7732 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
7734         * class.c (mono_class_generic_sharing_enabled): Make the default
7735         sharing mode 'corlib'.
7737 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
7739         * console-io.c (console_set_signal_handlers): Fix a warning.
7741         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
7742         method normally, the JIT will take care of avoiding recursion.
7744 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
7746         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
7748         Code is contributed under MIT/X11 license.
7750 2008-08-20  Miguel de Icaza  <miguel@novell.com>
7752         * console-io.c (sigcont_handler): We need to restore the entire
7753         termios state, not only the original settings, as things like echo
7754         can be controlled after this (Booish exposes this issue with its
7755         own ReadLine implementation).
7757         Additionally, we need to set the terminal back into keypad_xmit
7758         mode.
7759         
7760         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
7761         string as a paramter as well.   Otherwise we get different
7762         keyboard sequences.
7764 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
7766         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
7767         delegates with byref out parameter passing. Fixes #351520.
7769         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
7770         a generic context.
7771         (mono_type_get_desc): Add the type arguments for GENERICINST.
7772         (mono_method_full_name): Stringify the class name using mono_type_full_name
7773         so it picks up generic arguments.
7775 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
7777         * console-io.c: Removed debug output.
7779 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
7781         reflection.c (mono_reflection_create_runtime_class): Alloc
7782         the nested classes linked list using the dynamic image mempool.
7783         Fixes leak in corlib compilation.
7785 2008-08-19  Miguel de Icaza  <miguel@novell.com>
7787         * console-io.c: Fix incredibly annoying behavior on the console
7788         after resuming execution after control-z.   This affected every
7789         console application.
7791 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
7793         * mempool-internals.h: Header for mono private mempool functions. The first
7794         two function are for allocating glib linked lists using pools.
7796         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
7798         * Makefile.am: Added mempool-internals.h.
7800 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
7802         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
7803         (mono_domain_free): Ditto.
7805         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
7806         be used by the JIT to store its domain-specific information, instead of putting
7807         it directly into MonoDomain.
7809         * domain.c (mono_install_create_domain_hook): New helper function to install
7810         a hook which initializes domain->runtime_info.
7812         * domain.c (mono_install_free_domain_hook): Ditto.
7813         
7814 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
7816         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
7817         asserting if the ares parameter is null.
7819         * mono-perfcounters.c: Fix warnings.
7821         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
7822         is not needed, don't check for interruptions either.
7823         (mono_marshal_get_delegate_end_invoke): Ditto.
7825 2008-08-15  Marek Habersack  <mhabersack@novell.com>
7827         * mono-perfcounters.c (predef_readonly_counter): added support for
7828         reading the ASP.NET Requests Queued counter from another process.
7830 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
7832         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
7833         MonoImage to simplify the AOT code.
7835 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
7837         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
7838         marshalling. Fixes #416078.
7840 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
7841         
7842         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
7843         it is set, looking up the icall address is deferred to the JIT, since 
7844         in embedded scenarios, the icall might not be registered in the runtime
7845         doing the AOT compilation. Backported from the 2.0 branch.
7847 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
7849         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
7850         Fixes #415621.
7852 2008-08-05  Marek Habersack  <mhabersack@novell.com>
7854         * Makefile.am: added support for cross-compilation.
7856 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
7858         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
7860 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
7862         * mono-perfcounters.c: jitted methods and jitted bytes counters.
7864 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
7866         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
7867         mono-perfcounters.c: performance counters implementation.
7869 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
7871         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
7872         to gpointer, letting the AOT code decide what to store in it.
7874 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
7876         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
7877           mono_class_setup_methods if the methods are not initialized.
7879         Code is contributed under MIT/X11 license.
7881 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7883         * verify.c: Remove some debug code I commited by accident.
7885         * verify.c (mono_method_is_valid_in_context): Change the return value
7886         to make possible to distinguish between invalid and unverifiable.
7888         * verify.c (verifier_load_method): Don't return NULL for unverifiable
7889         methods.
7891 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7893         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
7894         constraints. Fixes regression in gtest-253.
7896 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7898         * verify.c (mono_verifier_verify_class): Don't allow generic types
7899         with explicit layout.
7901         * verify.c (mono_method_verify): Check locals and argument types.
7903 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
7905         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
7906         wait if the thread is in StopRequested state.
7908         * class.c (mono_class_from_name): Refactor the module searching code into
7909         a separate function so it can be reused in the AOT case too.
7911 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
7913         * verify.c (mono_type_is_valid_in_context): Improve the error message.
7914         Check both the type and it's generic type definition for loader errors.
7915         
7916         * verify.c (mono_method_is_valid_in_context): Don't generate another
7917         error when a type errors occur, this leads to the wrong exception been
7918         thrown.
7920 2008-07-28  Dick Porter  <dick@ximian.com>
7922         * icall-def.h
7923         * process.c
7924         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
7925         New internal calls to duplicate and close a process handle.
7927 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
7929         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
7931 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
7933         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
7935 2008-07-27  Robert Jordan  <robertj@gmx.net>
7937         * class.c (mono_class_init): Don't compute class.has_finalize for
7938         valuetypes. Fixes #412477.
7940 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
7942         * verify.c: Implement constraint equivalence checking.
7943         This is required when a generic parameter is used as
7944         argument to a constrained one.
7946         Fixes #410637.
7948 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
7950         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7952         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
7954         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
7955         synch with managed object layout.
7957 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
7959         * verify.c (do_branch_op): Handle valuetypes and generic
7960         arguments properly.
7962         * verify.c (do_cmp_op): Same.
7964         Fixes #410383.
7966 2008-07-24  Mark Probst  <mark.probst@gmail.com>
7968         * generic-sharing.c: Fix memory leaks.
7970         * class.c, class-internals.h: Make
7971         mono_class_inflate_generic_type_with_mempool() non-static.
7973 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
7975         * pedump.c (dump_verify_info): Dump full class name.
7977 2008-07-24  Mark Probst  <mark.probst@gmail.com>
7979         * generic-sharing.c: Removed some old code that didn't do anything.
7981 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
7982         * profiler.c: Added runtime_initialized_event,
7983         mono_profiler_install_runtime_initialized and
7984         mono_profiler_runtime_initialized. This new hook tells the profiler
7985         when the runtime is sufficiently initialized to be able to call
7986         mono_thread_attach on the root appdomain.
7987         * profiler.h, profiler-private.h: Likewise.
7989 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
7991         * verify.c (do_cast): Do boxing for generic arguments as well.
7993         * class.c (is_nesting_type): Drop generic instantiations before
7994         checking for nesting.
7996         * class.c (can_access_instantiation): Allow access to generic
7997         arguments.
7999 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
8001         * verify.c (verify_class_for_overlapping_reference_fields):
8002         On some cases, the field size might be zero, guard against that.
8003         Fix the explicit layout check to work as expected.
8005 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
8007         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
8008         mono_thread_resume () during shutdown, since the thread we want to abort
8009         might be suspended.
8011 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
8013         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
8014         warning.
8016         * debug-mono-symfile.c: Fix a warning.
8018         * mono-perfcounters.c (get_cpu_times): Fix a warning.
8020         * object.c (mono_class_vtable): Check if exception_type is set, and return
8021         NULL as defined by the function comments.
8023 2008-07-22  Mark Probst  <mark.probst@gmail.com>
8025         * mempool.c: Use malloc for every single mempool allocation if the
8026         configure option is set.  This makes it easier to track mempool
8027         allocations with tools like Valgrind.
8029 2008-07-22  Jb Evain  <jbevain@novell.com>
8031         * reflection.c (create_dynamic_mono_image): emit the same
8032         metadata version that SL2 does when creating a SL2 image.
8034 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
8036         * icall-def.h:
8037         * icall.c: New icall System.Enum:get_hashcode. This function
8038         avoids the overhead of boxing the enum to the underlying type.
8040 2008-07-21  Mark Probst  <mark.probst@gmail.com>
8042         * reflection.c (mono_method_get_object): Don't let static RGCTX
8043         invoke wrappers get into MonoReflectionMethods.
8045 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
8047         * object-internals.h:
8048         * object.c: New mono_runtime_class_init_full function
8049         that makes throwing the exception optinal.
8051         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
8052         for the case where the exception object is supplied.
8054 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
8056         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
8057         old ld versions.
8059         Contributed under MIT/X11 license.
8061 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
8063         * string-icalls.c (ves_icall_System_String_InternalSplit):
8064         Optimize array allocation by caching the MonoClass of the
8065         array type.
8067         * icall.c (ves_icall_Type_GetMethodsByName): Same.
8069         * reflection.c (mono_param_get_objects): Same.
8071 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
8073         * icall-def.h:
8074         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
8075         It inflates the given type using the class context.
8077 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
8079         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
8080         the vtable if it already exists.
8082         * object-internals.h: Add mono_class_try_get_vtable as part of the
8083         internal API.
8085         * reflection.c (mono_type_get_object): Use the MonoObject from the
8086         vtable when possible. Reduces locking contention on reflection heavy
8087         code.
8089 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
8091         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
8092         g_bit_nth_msf () since that macro is not implemented in eglib.
8094 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
8096         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
8097         on platforms which do not support it.
8099 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
8101         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
8103 2008-07-11  Martin Baulig  <martin@ximian.com>
8105         * mono-debug-debugger.h
8106         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
8108         * mono-debug-debugger.c
8109         (_mono_debugger_interruption_request): New global volatile variable.
8110         (mono_debugger_check_interruption): New public function.
8112         * threads.c
8113         (mono_thread_current_check_pending_interrupt): Call
8114         mono_debugger_check_interruption().
8115         (mono_thread_interruption_checkpoint_request): Likewise.
8117 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8119         * verify.c: Add more type checks for loaded types. Verify the result
8120         handle from ldtoken.
8122 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8124         * loader.c (field_from_memberref): Don't crash if the field
8125         wasn't found.
8127 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8129         * verify.c: Verify if type and method instantiations
8130         don't have invalid VAR or MVAR arguments.
8132 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8134         * verify.c: Fix double free of function pointer list.
8136 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8138         * object.c (mono_string_to_utf8): Comment the new code as it
8139         breaks under eglib.
8141 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
8143         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
8145 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
8147         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
8148           is not throw too many times.
8150         Code is contributed under MIT/X11 license.
8152 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
8154         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
8155         debugging is turned off.
8157 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
8159         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
8161 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8163         * class-internals.h, class.c: Added new generic sharing option:
8164         Share only stuff in System.Collections.Generic, which is now the
8165         default.
8167 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8169         * generic-sharing.c, class-internals.h: New function for getting a
8170         generic method in a generic class given the corresponding method
8171         for a different instantiation of the class.  Partly refactored
8172         from mini-trampolines.c.
8174         * class.c: Make sure generic methods have a class_inst if they are
8175         part of a generic class.
8177         * metadata.c (mono_type_stack_size_internal): Handle type
8178         variables.
8180 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8182         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
8183         Signifies whether information on the this/vtable/mrgctx variable
8184         is available.
8186 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8188         * object.c, object-internals.h, icall.c: New function
8189         mono_delegate_ctor_with_method(), which does the same as
8190         mono_delegate_ctor(), but takes an explicit method argument
8191         instead of taking the method from the jit info.
8193         * marshal.c: When creating a delegate with an inflated method take
8194         the "this" argument as the target class for the castclass.
8196 2008-07-03  Mark Probst  <mark.probst@gmail.com>
8198         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
8199         mono_jit_info_table_find() to perform very badly in some cases.
8201 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
8203         * icall.c (type_from_typename): Handle 'string'.
8205         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
8206         wrappers into the wrapper_hash, since the key is not a MonoMethod.
8208 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
8210         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
8212         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
8213         number of available managed allocator types.
8215         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
8216         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
8218 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
8220         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
8221         which is a low level lock protecting just the 'jit_code_hash' hash table.
8223         * domain.c: Initialize+cleanup jit_code_hash_lock.
8224         
8225 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
8227         * coree.c (mono_load_coree): Set coree_module_handle global variable only
8228         after initialization.
8230         * coree.h: Make MonoFixupExe internal.
8232         Contributed under MIT/X11 license.
8234 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
8236         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
8237         because that is platform independent. Check NumberOfRvaAndSizes in PE32
8238         as well.
8239         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
8240         image being loaded is a CLI image and _CorValidateImage gets called.
8242         * coree.h: Add MonoLoadImage.
8244         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
8245         instead of LoadLibrary.
8247         Contributed under MIT/X11 license.
8249 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
8251         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
8252         for any primitive type.
8254 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
8256         * object.c (mono_array_new_specific): Optimize this and the other allocation
8257         functions a bit.
8258         
8259         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
8260         domains too if mono_dont_free_domains is set.
8262         * domain-internals.h (mono_dont_free_domains): New internal option controlling
8263         whenever to free appdomain data after it has been unloaded.
8265         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
8266         
8267 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
8269         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
8270         (mono_method_get_equivalent_method): Fix a warning.
8272         * object.c (mono_message_init): Avoid looking up array types for each call.
8274 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
8276         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
8277         call.
8279         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
8280         even more.
8282         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
8283         each iteration.
8285         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
8286         fields of an enum.
8288 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
8290         * object.c (mono_value_box): Fix boxing of nullables.
8292 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
8294         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
8295         mono_module_handle that is defined by the linker; no initialization required.
8296         * coree.h: Remove mono_module_handle, add __ImageBase, update
8297         mono_image_open_from_module_handle.
8298         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
8299         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
8300         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
8301         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
8302         to 4 GB away from image base address. IA64 version is not tested but was very
8303         easy to implement and should work if we ever need it.
8304         * domain.c (mono_init_internal): Avoid system error message boxes.
8305         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
8306         with has_entry_point. Handle do_mono_image_load fauilre correctly.
8307         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
8308         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
8309         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
8311         Contributed under MIT/X11 license.
8313 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8315         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
8316         as part of the private mono API.
8317         
8318         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
8319         Do proper argument checking for methods that belong to generic classes.
8320         Do proper type resolution for GMFH/2.
8321         Fixes #377324.
8322         
8323 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8325         * verify.c (do_switch): Fix a memory corruption bug with
8326         the jump index is out of bound.
8328 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8330         * verify.c: Disable debug code.
8332 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8334         * reflection.c (mono_image_get_methodbuilder_token): Use
8335         mono_image_get_methodspec_token_for_generic_method_definition
8336         instead of mono_image_get_memberref_token. We cache more memberef
8337         entries now.
8339 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8341         * verify.c: Inflate exception clause types.
8342         Fixes #402606.
8343         
8344 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8346         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
8347         name.
8349         * reflection.c (mono_image_get_ctorbuilder_token): Same.
8351         * reflection.c (mono_image_create_method_token): Same.
8353 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8355         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
8356         It does the same as mono_image_get_methodref_token but works on
8357         MethodBuilder.
8359         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
8360         and always generate a methodspec. This follows the old behavior and fixes
8361         the regressions in System.Core. 
8363 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
8365         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
8366         don't event mono_class_get () succeeds. Fixes #402182.
8368 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
8370         * metadata-internals.h: Added MonoDynamicImage::methodspec
8371         hashtable to store methodspec tokens created for MethodBuilders.
8373         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
8374         MethodBuilders as open instantiations if a methodspec was requested.
8376         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
8378         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
8380         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
8382         Fixes bug #349190.
8384 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
8386         * loader.c (method_from_methodspec): Avoid crashing if the
8387         method lookup fails.
8389 2008-06-20  Dick Porter  <dick@ximian.com>
8391         * socket-io.c (get_socket_assembly): Cope with Moonlight network
8392         classes being in a different assembly.  Fixes bug 399184.
8394 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
8396         * loader.c (mono_loader_init): Make this callable multiple times.
8397         (mono_dllmap_insert): Call mono_loader_init () so this works even before
8398         the runtime is initialized. Fixes #401755.
8400 2008-06-19  Dick Porter  <dick@ximian.com>
8402         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
8403         Fixes bug 349688.
8405 2008-06-19  Dick Porter  <dick@ximian.com>
8407         * socket-io.c:
8408         * icall-def.h: Implement Socket generic Send() and Receive()
8409         methods.  Fixes bug 395168.
8411 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
8413         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
8415         Contributed under MIT/X11 license.
8417 2008-06-18  Martin Baulig  <martin@ximian.com>
8419         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
8420         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
8421         set to 80.0.  The debugger <-> runtime interface is now frozen as
8422         well.   
8424         * mono-debug.c
8425         (mono_debug_debugger_version): Bump to 4.
8427 2008-06-18  Martin Baulig  <martin@ximian.com>
8429         * debug-mono-symfile.c
8430         (load_symfile): Don't check the minor version.
8432         * debug-mono-symfile.h: Bump the version number to 50.0.
8434 2008-06-18  Martin Baulig  <martin@ximian.com>
8436         * debug-mono-symfile.c
8437         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
8438         minimum required version.
8440 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
8442         * reflection.c (mono_custom_attrs_from_property): Fix support for
8443         retriveving cattrs of dynamic inflated generic types.
8445         * reflection.c (mono_custom_attrs_from_event): Same.
8447         * reflection.c (mono_custom_attrs_from_field): Same;
8449         * reflection.c (typebuilder_setup_events): Same cattrs of events.
8451         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
8452         Moved to metadata.c.
8454         * metadata.c: New functions to retrive the equivalent field, event
8455         of property from the generic type definition.
8457         * metadata-internals.h: Added new functions from metadata.c.
8459 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
8461         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
8462         to cached in a mempool is used.
8464         * metadata.c (free_generic_class): In some situations field generic_info type
8465         is not properly dup'ed and leads to double free'ing.
8467         Fixes #400643.
8469 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8471         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
8472         this arguments (will be needed later for generic methods).
8473         Collect stats.
8475 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8477         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
8478         Create a static RGCTX invoke wrapper for methods which require it.
8480 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8482         * object.c, class-internals.h: New function for checking whether
8483         an individual field is special static.
8485 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
8487         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
8488         linear search since the table is sorted.
8490         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
8491         Fixes #324180.
8493 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
8495         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
8496         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
8498         * gc.c (mono_domain_finalize): Allow an infinite timeout.
8500         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
8501         
8502         * threads.c (mono_thread_request_interruption): Get rid of locking, use
8503         InterlockedCompareExchange to query and modify 
8504         thread->interruption_requested.
8506         * object-internals.h (struct _MonoThread): Change interruption_requested
8507         to a gint32 so it can be modified by atomic operations. Add 
8508         'critical_region_level' from the managed side, change small_id to a guint32,
8509         add new set of 'unused' fields.
8511         * appdomain.c: Bump corlib version.
8513 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
8515         * class.c (mono_class_from_name): Search modules as well. Fixes
8516         #322332.
8518 2008-06-13  Mark Probst  <mark.probst@gmail.com>
8520         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
8521         templates.  Templates are generalized with an additional type_argc
8522         argument.  RGCTX templates have type_argc==0, MRGCTX templates
8523         have type_argc>0.
8525         * domain-internals.h, domain.c: New hash table for looking up
8526         MRGCTXs.
8528         * metadata.c, metadata-internals.h: Rename hash and equal
8529         functions for MonoGenericInst's and make them public.
8531         * class-internals.h: New data structures for the MRGCTX.  Macros
8532         for distinguishing slots in the RGCTX and the MRGCTX.
8534 2008-06-13  Mark Probst  <mark.probst@gmail.com>
8536         * object.c (mono_method_get_imt_slot): Put the same methods of
8537         different instantiations of the same generic interface in the same
8538         IMT slots, to make generic sharing simpler.
8540 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8542         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
8544         * metadata.c (mono_metadata_field_info_with_mempool): Added.
8545         This function works just like mono_metadata_field_info, but
8546         accept a mempool as argument to be used allocating memory.
8548         * marshal.c (mono_marshal_load_type_info): Use new function
8549         to load marshal data into image mempool.
8551 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8553         * class.c (mono_class_inflate_generic_type_with_mempool):
8554         This function allows to inflate a generic type using
8555         a mempool.
8557         * class.c (inflate_generic_type): Take a mempool as argument
8558         and use it to do type dup'ing.
8560         * class.c (mono_class_setup_fields): Field type for generic
8561         generic classes are allocated from the image mempool.
8563         * metadata.c (free_generic_class): Inflated field type is
8564         now allocated in the image mempool.
8566 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8568         * threads.c (thread_cleanup): Free MonoThread::name.
8570 2008-06-12  Marek Habersack  <mhabersack@novell.com>
8572         * appdomain.c (ensure_directory_exists): avoid unnecessary
8573         mkdir(2) calls when the shadow directory already exists.
8574         (mono_make_shadow_copy): copy also satellite assemblies from the
8575         private bin directories.
8577 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
8579         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
8580         
8581         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
8582         a page boundary. Fixes #396219.
8584 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8586         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
8587         due to double-checked locking.
8589 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8591         * assembly.c (build_assembly_name): Release memory on failure.
8593         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
8595 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8597         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
8598         memory on failure.
8600 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8602         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
8603         memory on failure.
8605 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8607         * loader.c (field_from_memberref): Check if field signature type is equal
8608         to the non-inflated type of the field. Fixes #398980.
8610 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
8612         * assembly.c (mono_assembly_load_from_full): Call 
8613         mono_assembly_load_friends () outside the assemblies lock, since it can
8614         acquire the loader lock. Fixes #323696.
8616         * reflection.c (resolve_object): Inflate the inst with the context for
8617         FieldOnTypeBuilderInst. Fixes #399010.
8619 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8621         * reflection.c (mono_image_get_field_on_inst_token): Don't
8622         inflate the field to encode it's signature. If it's a
8623         VAR or MVAR it should stay that way in the signature.
8624         Fixes #399047.
8626 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8628         * reflection.c (resolve_object): Release memory of inflated types.
8630 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8632         * loader.c (mono_method_get_signature_full): Remove assert about
8633         loading a methodspec to a generic method. We have such methods, such as
8634         System.Threading.Interlocked::CompareExchange<T>.
8635         This assert was removed since it crashes the verifier when it checks
8636         methods calling CompareExchange<T>.
8638 2008-06-10  Marek Safar  <marek.safar@gmail.com>
8640         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
8641         of Type array and not MonoType.
8643 2008-06-10  Marek Habersack  <mhabersack@novell.com>
8645         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
8646         <lupus@ximian.com>
8648 2008-06-10  Martin Baulig  <martin@ximian.com>
8650         * debug-mono-symfile.h
8651         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
8652         changes to the file format, but we were generating incorrect
8653         source file indices in the line number table due to a bug, which
8654         made backtraces report an incorrect source file.
8656 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8658         * mono-debug.c: Moved mono_debug_free_method_jit_info from
8659         mini/debug-mini.c to here.
8661         * mono-debug.c (il_offset_from_address): Free memory from find_method.
8663         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
8664         use it to release structs returned by mono_debug_find_method.
8666 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
8668         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
8669         since it needs to set method->slot for all interface methods.
8671 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8673         * class-internals.h: Forgot to add.
8675 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8677         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
8679         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
8680         Lookup the custom attributes from property_hash.
8682         * reflection.c (mono_save_custom_attrs): Save the custom attributes
8683         in property_hash. Allocate all data using the image mempool.
8685         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
8686         for dynamic_custom_attrs to checks if the image is dynamic.
8688 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
8690         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
8691         assemblies array.
8692         
8693         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
8694         runtime functions while holding the domain assemblies lock.
8696 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8698         * verify.c: Reapplied the last bit of the reverted changes.
8700 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
8702         * verify.c: Reapplied more of the reverted changes.
8704 2008-06-09  Martin Baulig  <martin@ximian.com>
8706         * debug-mono-symfile.c (load_symfile): Check the major version
8707         first; if it's wrong, don't print the minor version in the error message.
8709 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
8711         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
8712         lock instead of the domain lock to avoid deadlocks, since the thread might
8713         already hold the loader lock.
8715         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
8716         (mono_thread_attach): Ditto.
8718         * monitor.c: Use a TLS variable for holding the current thread id instead
8719         of calling pthread_self ().
8720         (mono_monitor_init_tls): New internal function to initialize the TLS
8721         variable.
8722         (mono_monitor_try_enter_internal): Put the owner == id check after the
8723         owner == 0 check.
8725         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
8726         missed optimizations when using gcc-4.3.
8728 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
8730         * reflection.c (mono_dynamic_image_free): Free the memory
8731         used by MonoGenericParam in MonoDynamicImage::gen_param.
8733         * reflection.c (mono_reflection_setup_generic_class): Allocate
8734         container from mempool.
8736         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
8737         container from mempool.
8739 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
8741         * threads.c (mono_set_pending_exception): New internal function to set the
8742         pending exception of the current thread.
8743         (mono_thread_get_and_clear_pending_exception): Check for 
8744         thread->pending_exception as well.
8746         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
8748         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
8749         it can trigger a collection.
8751 2008-06-06  Martin Baulig  <martin@ximian.com>
8753         Merged the `debugger-kahalo' branch.
8755         * mono-debug.h
8756         (MONO_DEBUGGER_VERSION): Bumped to 72.
8758         * debug-mono-symfile.h
8759         (MonoSymbolFileMethodIndexEntry): Removed.
8760         (MonoSymbolFileMethodEntry): New public typedef.
8761         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
8762         (MonoSymbolFileSourceEntry): Remove everything except `index' and
8763         `data_offset'.
8764         (MonoSymbolFileMethodEntry): Removed.
8765         (MonoSymbolFileLexicalBlockEntry): Removed.
8766         (MonoSymbolFileLineNumberEntry): Removed.
8767         (MonoDebugLexicalBlockEntry): Removed.
8768         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
8769         removed `num_il_offsets' and `il_offsets'.
8770         (MonoSymbolFile): Replace `version' with `major_version' and
8771         `minor_version'.
8772         (MONO_SYMBOL_FILE_VERSION): Replace with
8773         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
8774         `MONO_SYMBOL_FILE_MINOR_VERSION'.
8776         * debug-mono-symfile.c
8777         (mono_debug_symfile_lookup_location): Add support for the new line
8778         number table format.
8780 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8782         * metadata.c (free_generic_class): Release the inflated
8783         MonoClass of dynamic generic classes if it's not a generic
8784         type definition.
8786 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8788         * verify.c: Reapplied more of the reverted changes.
8790 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8792         * reflection.c (lookup_custom_attr): Clean the cached flag or
8793         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
8794         for SRE types.
8796 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
8798         * verify.c: Reapplied a small part of the reverted changes.
8800 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
8802         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8804         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
8805         previously in managed code.
8806         (mono_monitor_exit): Ditto.
8807         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
8809         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
8810         the managed definition.
8812 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
8814         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
8816 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
8818         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
8819         
8820         * monitor.c: Add some micro optimizations.
8822         * icall.c (type_from_typename): Handle 'bool'.
8824 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
8826         * verify.c: Implement constructor verification per P III 1.8.1.4.
8827         Fixes #396716.
8829 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
8831         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
8832         holding the assemblies lock here too.
8834 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8836         * verify.c: Kill stack_top function.
8838 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8840         * verify.c: Kill stack_get function.
8842 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8844         * verify.c (mono_method_verify): Last change broke the build. Fixed.
8846 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
8848         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
8849         more reliable.
8851         * verify.c (mono_method_verify): Inflate params and locals to avoid
8852         mismatch when checking for compatibility.
8854 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
8856         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
8857         Length prefix should be size in bytes. Fix bug #339530.
8858         
8859         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
8860         Length prefix should be size in bytes. Fix bug #339530.
8862         Code is contributed under MIT/X11 license.
8864 2008-06-05  Bill Holmes <billholmes54@gmail.com>
8866         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
8868         Contributed under MIT/X11 license.
8870 2008-06-05  Martin Baulig  <martin@ximian.com>
8872         * mono-debug-debugger.c
8873         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
8875 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
8877         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
8878         while holding the assemblies lock to prevent deadlocks. Handle the case
8879         where the search hook returns NULL but the assembly was still loaded.
8880         Fixes #323696.
8882         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
8883         modify domain state.
8885 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
8887         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
8888         * Makefile.am (pedump_LDADD): Post-process object files and
8889         add dtrace-generated object file, if necessary.
8891         Code is contributed under MIT/X11 license.
8893 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8895         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
8897 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8899         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
8901 2008-06-04  Mark Probst  <mark.probst@gmail.com>
8903         * threads.c: Try to free everything from the delayed free table
8904         when shutting down threads, and set the variable to NULL after the
8905         table is freed so that calling
8906         mono_thread_hazardous_try_free_all() when shutting down the root
8907         domain doesn't crash.
8909 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8911         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
8912         the caller if resulting type was inflated.
8914         * class.c (mono_class_create_from_typespec): Free the MonoType if it
8915         was inflated.
8917         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
8920 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
8922         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
8923         class library tests.
8925         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
8926         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
8927         #396989.
8929 2008-06-04  Mark Probst  <mark.probst@gmail.com>
8931         * domain.c, domain-internals.h: The JIT infos are now freed by the
8932         JIT info table code.  They are freed immediately if there only a
8933         single JIT info table in circulation.  If there is more, the free
8934         is delayed via a queue.
8936         * threads.c, threads-types.h: New hazard pointer function for
8937         freeing all freeable delayed items in one sitting.
8939 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8941         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
8943         * reflection.c (typebuilder_setup_properties): Same.
8945         * reflection.c (typebuilder_setup_events): Same.
8947 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8949         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
8950         and use it for allocating memory.
8952         * reflection.c (mono_marshal_spec_from_builder): Same.
8954         * reflection.c: Change code to use new signatures.
8956         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
8958 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8960         * decimal.c (rescale128): Put back one line which was accidently commented
8961         out.
8962         
8963         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
8964         to cause crashes.
8966 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8968         * reflection.c (mono_reflection_generic_class_initialize): Name must
8969         be always malloc'ed so we can free it later on. Do this for field, property
8970         and event.
8972         * metadata.c (free_generic_class): Free field, property and event names.
8974 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8976         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
8977         instead of g_memdup.
8979         * reflection.c (typebuilder_setup_fields): Same.
8981 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8983         * decimal.c (rescale128): Optimize this function a bit more.
8985 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8987         * metadata.c (free_generic_class): Release some memory from
8988         SRE generic classes.
8990 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8992         * reflection.c (mono_image_get_generic_field_token): No reference
8993         to name is kept, free it.
8995         * reflection.c (mono_reflection_generic_class_initialize): Free
8996         more memory of the inflated field.
8998 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
9000         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
9001         code.
9003 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
9005         * reflection.c (mono_dynamic_image_free): Release memory used by
9006         MonoDynamicImage::array_methods elements.
9008         * reflection.c (assembly_add_win32_resources): Release memory after
9009         encoding.
9011 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
9013         * decimal.c (log2_32): Use an optimized version for this function too.
9014         
9015         * decimal.c (log2_64): Fix this on 32 bit machines.
9017 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
9019         * class.c (mono_dup_array_type): Implement allocation using a mempool.
9021         * class.c (mono_metadata_signature_deep_dup): Same.
9023         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
9024         a mempool.
9026         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
9028         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
9030         * metadata-internals.h: Added mono_metadata_signature_dup_full.
9032         * class-internals.h: Update signatures to take a MonoMemPool.
9034 2008-06-02  Dick Porter  <dick@ximian.com>
9036         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
9037         * icall-def.h: Add
9038         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
9039         FormatMessage API to get the error text.  Fixes bug 321827.
9041 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
9043         * decimal.c: Add some micro optimizations to make decimal operations faster.
9045 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
9047         * reflection.c (method_encode_clauses): Take a mempool
9048         as parameter and use it to allocate the clause array.
9050         * reflection.c (mono_image_get_field_on_inst_token): Free
9051         the inflated type after encoding it.
9053         * reflection.c (mono_dynamic_image_free): Free each element
9054         of MonoDynamicImage::gen_params.
9056         * reflection.c (reflection_methodbuilder_to_mono_method):
9057         Allocate the generic param array from the mempool.
9058         Allocate signature params from the mempool.
9060         * reflection.c (mono_reflection_generic_class_initialize):
9061         Free inflated fields after been used.
9063 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
9065         * icall.c: Reapply the memory leak fixes as they no
9066         longer make mono crash.
9068 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
9070         * reflection.c (mono_type_get_object): Don't store the suplied
9071         MonoType with type_hash. A caller which pass a type that
9072         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
9073         might end with a pointer to freed memory.
9074         The solution is to use byval_arg or this_arg from the associated
9075         MonoClass of the supplied type.
9077 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
9079         * icall.c: Revert the rest of the last change as it breaks the build too.
9081 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9083         * icall.c: Revert a leak fix as it's breaking the build.
9085 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9087         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
9089 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9091         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
9093 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9095         * icall.c: Fix some memory leaks.
9097 2008-05-29  Dick Porter  <dick@ximian.com>
9099         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
9100         async socket operations from the pending list when a socket
9101         closes.  Leaving it until the threadpool services the event
9102         exposes a race condition when a socket descriptor is reused.
9103         Fixes bug 377589.
9105 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9107         * object.c: Fix negative index check for array alocation.
9109 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9111         * icall.c, marshal.c: Delegate wrappers should skip visibility.
9112         This check is performed by the verifier for IL created delegates
9113         and by Delegate::CreateDelegate for programatically created ones.
9114         Fixes #372406.
9116 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9118         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
9119         Fix code to use mono_array_size_t instead of int.
9121         Based on patch by Luis F. Ortiz.
9122         Contributed under X11 license.
9123         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9125 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9127         * icall.c: Added ves_icall_System_Array_GetLongLength and
9128         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
9129         arrays.
9131         * icall.h: Export both new functions.
9133         Based on patch by Luis F. Ortiz.
9134         Contributed under X11 license.
9135         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9137 2008-05-28  Martin Baulig  <martin@ximian.com>
9139         The debugger now requires exactly r103463.
9141         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
9142         This version is not supported by the debugger, wait for 72.
9144 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9146         * object.h: Changed array related functions to use
9147         mono_array_size_t instead of guint32. Forgot to commit this file.
9149         Patch by Luis F. Ortiz.
9150         Contributed under X11 license.
9151         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9154 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9156         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
9157         don't define it. Use the number literal instead.
9159 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9161         * icall.c: Changed array related functions to use
9162         mono_array_size_t instead of guint32.
9164         * icall.c (ves_icall_System_Array_GetLength): Check for length
9165         overflow under MONO_BIG_ARRAYS.
9167         Based on patch by Luis F. Ortiz.
9168         Contributed under X11 license.
9169         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9171 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9173         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
9175         Based on patch by Luis F. Ortiz.
9176         Contributed under X11 license.
9177         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9179 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9181         * object.c, object.h: Changed array related functions to use
9182         mono_array_size_t instead of guint32.
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 Rodrigo Kumpera  <rkumpera@novell.com>
9190         * object.h: Introduced mono_array_size_t typedef. This must be used
9191         in all places an array length is expected. This is 64bits wide if
9192         MONO_BIG_ARRAYS is enabled.
9194         Patch by Luis F. Ortiz.
9195         Contributed under X11 license.
9196         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9198 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
9200         * security-manager.c class.c: Set the class exception info by calling
9201         mono_class_set_failure ().
9203         * class.c (mono_class_get_exception_data): New accessor function.
9204         (mono_class_set_failure): Store exception_data in the property hash.
9206         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
9207         the struct as a property.
9209         * loader.c (mono_get_method_full): Store the lookup result for method
9210         tokens in method_cache, the others in methodref_cache to decrease the memory
9211         usage of hash tables.
9213         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
9214         (mono_image_init): method_cache is lazy inited now.
9216         * metadata-internals.h (struct _MonoImage): Change method_cache to
9217         a MonoValueHashTable, add a separate methodref_cache.
9219 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
9221         * number-formatter.h: Fix tables to avoid arithemtic overflow in
9222           Double.ToString as exposed by Bug #383531.
9224 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
9226         * number-formatter.h: Make some tables static.
9228         * class.c (mono_method_set_generic_container): New accessor function.
9229         (mono_method_get_generic_container): Ditto.
9231         * class-internals.h (struct _MonoMethod): Remove rarely used 
9232         'generic_container' field, store it in the property hash instead. Add 
9233         'is_generic' boolean field instead.
9235         * image.c (mono_image_init): Initialize property_hash.
9236         (mono_image_close): Destroy property_hash.
9238         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
9239         hold rarely used fields of runtime structures belonging to this image.
9241         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
9242         to get/set method->generic_container.
9244         * loader.c (mono_get_method_from_token): Avoid loading the method header for
9245         generic methods.
9247 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
9249         * class.c (mono_class_inflate_generic_method_full): Don't increase
9250         mono_stats.inflated_method_count for methods found in the cache.
9252         * threads.c (mono_thread_request_interruption): Add a comment about 
9253         QueueUserAPC ().
9255 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
9257         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
9258         interface_offsets_packed table.
9259         
9260         * class.c (mono_class_init): Remove some dead code.
9262         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
9263         mono_class_setup_vtable () when CAS is active to detect security problems.
9265 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
9267         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
9269         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
9270         parameters as it's irrelevant for delegate checking.
9272 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
9274         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
9276         * class.c (mono_class_init): Control the creation of a generic vtable using
9277         a global which is true by default, but set to false by the runtime startup code.
9278         
9279         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
9280         Disabled for now since it breaks the embedding API.
9281         Move the setup of class->methods for arrays to mono_class_setup_methods ().
9282         (mono_class_setup_methods): Add a memory barrier.
9284         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
9285         when mono_class_init () doesn't compute the generic vtable.
9286         
9287 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
9288         * profiler.c: Added mono_profiler_install_statistical_call_chain,
9289         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
9290         to support call chains (backtrace) in the stat profiler.
9291         * profiler.c, profiler-private.h: Likewise.
9293 2008-05-22  Mark Probst  <mark.probst@gmail.com>
9295         * generic-sharing.c: Init generic class when a method of it is
9296         requested via a runtime generic context.
9298 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
9300         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
9302         * reflection.c (mono_type_get_object): Add a FIXME.
9304         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
9306         * class.c (mono_class_get_method_by_index): New helper function, returning an
9307         entry in the class->methods array.
9309 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
9311         * class.c (mono_class_init): Only do the array optimization for szarrays. 
9312         Avoid creating a generic vtable for generic instances as well.
9313         (mono_class_get_method_from_name_flags): Don't search in the metadata for
9314         generic instances.
9316 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
9318         * loader.c (mono_get_method_constrained): Inflate the signature
9319         with class context. Fix #325283.
9321 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
9323         * object.c (mono_class_create_runtime_vtable): Add a comment.
9325         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
9326         where needed.
9327         (setup_interface_offsets): Handle the case when this is called twice for arrays.
9328         (mono_class_setup_vtable_general): Add an assert.
9329         (mono_class_init): Avoid creating a generic vtable for arrays.
9331         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
9332         here, let mono_class_init () do that.
9334         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
9335         interfaces in mscorlib.
9337         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
9338         interfaces. Add some comments.
9339         (mono_class_init): Call mono_class_setup_methods () here since it is no
9340         longer called by mono_class_setup_vtable ().
9342         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
9343         not set in class->vtable.
9344         (mono_class_create_runtime_vtable): Reenable the disabled code.
9346         * object.c (mono_class_create_runtime_vtable): Disable the last change for
9347         now as it causes some test failures.
9349         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
9350         if using the vtable trampoline. Also remove some strange code which put the
9351         generic methods themselves into the vtable slots. Remove the AOT init_vtable
9352         stuff as it is no longer needed.
9354 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
9356         * pedump.c: Give make --verify all option check code as well.
9357         Using --verify code won't check for metadata now.
9359 2008-05-19  Martin Baulig  <martin@ximian.com>
9361         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
9363         * mono-debug.c
9364         (_mono_debug_using_mono_debugger): New global variable; it's set
9365         directly by the debugger, so mono_debug_using_mono_debugger() also
9366         works after attaching.
9368 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
9370         * object.c (mono_class_create_runtime_vtable): Use memory barriers
9371         as we do double checked locking on MonoClass::runtime_info and
9372         MonoClassRuntimeInfo::domain_vtables.
9374 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
9376         * debug-helpers.c (print_field_value): Fix a warning.
9378 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
9380         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
9381         set in the AOT case.
9383 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
9385         * class.c (mono_class_setup_vtable_general): Use memory barriers
9386         as we do double checked locking on MonoClass::vtable.
9388 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
9390         * reflection.c (resolve_object): Inflate only if the generic context
9391         is not null. Fixes #389886.
9393 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
9395         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
9396         instead of g_free.
9398         Code is contributed under MIT/X11 license.
9400 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9402         * class.c: Revert unrelated change.
9404 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9406         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
9407         a generic instantiation, use mono_class_from_mono_type instead of playing
9408         with MonoType directly.
9410 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9412         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
9413         checks must ignore generic instantiations, so mono_class_has_parent is not
9414         suitable. Fixes #390128.
9416 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
9418         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
9419         it to avoid registering tokens during metadata generation. Fixes #390023.
9421 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
9423         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
9424         consistent.
9426         Contributed under MIT/X11 license.
9428 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
9430         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
9431         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
9432         to fixup the EXE image.
9433         (mono_cleanup): Use mono_close_exe_image.
9434         (mono_close_exe_image): New function.
9435         * image.c: Include "marshal.h".
9436         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
9437         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
9438         counting when the image is loaded outside of mono_image_open_full. Set status
9439         based on GetLastError.
9440         * coree.c: Include required headers. Add init_from_coree.
9441         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
9442         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
9443         (_CorExeMain): Set init_from_coree.
9444         (CorExitProcess): Only call ExitProcess for now.
9445         (CorBindToRuntimeEx): New stub implementation.
9446         (CorBindToRuntime): New function.
9447         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
9448         (MonoFixupExe): ILONLY executables require no fixups.
9449         (mono_set_act_ctx): New function to set activation context.
9450         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
9451         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
9452         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
9453         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
9454         as MONO_INTERNAL.
9455         * domain-internals.h: Add mono_close_exe_image.
9457         Contributed under MIT/X11 license.
9459 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
9461         * metadata.c (mono_metadata_compute_size): Correctly calculate field
9462         size for generic param and event tables. Fixes #388977.
9464 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
9466         * loader.c (mono_method_signature): Use memory barriers because of the double
9467         checked locking pattern.
9469         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
9470         aborting or aborted as well. Fixes #376391.
9471         
9472         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
9473         existing runtime state in the Suspend handler during shutdown.
9475 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
9477         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
9479         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
9480         which are starting up or shutting down.
9482         * threads.c (mono_threads_set_shutting_down): Don't return a value since
9483         this function never returns if the runtime is already shutting down.
9485         * icall.c (ves_icall_System_Environment_Exit): Update after 
9486         mono_threads_set_shutting_down () signature change.
9487         
9488 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
9490         * class.c: Added can_access_instantiation to verify if the instantiation
9491         is visible. Fix access check for nested types as they returned TRUE
9492         before doing type and generic instantiation visibility checks.
9494 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
9496         * reflection.c (mono_reflection_create_generic_class): The created type
9497         must have a different container from its TypeBuilder. Otherwise they
9498         will end sharing generic arguments, which is wrong.
9500         Due to the sharing, making a generic instance of the created type using
9501         the TypeBuider generic arguments resulted in the generic type definition
9502         been returned, which is wrong as well.
9504         As a bonus the code was leaking the type_params array. This memory should
9505         be allocated from the image mempool.
9507         This fixes bug #354047.
9509 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
9511         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
9512         to here         as they are now used in assembly.c new code.
9513         Added a skipverification flag to MonoAssembly.
9514         New internal function mono_assembly_has_skip_verification.
9516         * assembly.c: New function mono_assembly_has_skip_verification. It checks
9517         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
9518         part of #387274.
9520 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
9522         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
9523         needed. Fixes #387034.
9525         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
9527 2008-05-06  Miguel de Icaza  <miguel@novell.com>
9529         * assembly.c (mono_assembly_load_reference): Prevent crash while
9530         disassembling Silverlight 2.0 executables while we still do not
9531         have GACed libraries.
9533 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
9535         * reflection.c: Special case generic type definitions as well. Fixes #383444.
9537 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
9539         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
9540         of the dynamic case. Fixes #387404.
9542 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9544         *verify.c (mono_verifier_is_class_full_trust): If under
9545         verify_all and the verifier mode was not set, only
9546         gac and corlib types are fulltrust. This makes --verify-all
9547         usable to detect unverifiable code, which is the expected
9548         use case.
9550 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9552         * verify.h: Ops, commited the header with debug
9553         enabled.
9555 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9557         * verify.c (merge_stack): Use the new value on unverifiable
9558         stack merges.
9560         * verify.c (verify_type_compatibility_full): Comparison
9561         of nullable types can't use mono_class_is_assignable_from.
9563         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
9564         that makes all verification errors be reported.
9566         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
9567         mono_method_verify.
9569 2008-05-05  Robert Jordan  <robertj@gmx.net>
9571         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
9572         support for value types. See #386415.
9574         * object.c: comments.
9576         Code is contributed under MIT/X11 license.
9578 2008-05-05  Martin Baulig  <martin@ximian.com>
9580         * debug-mono-symfile.h
9581         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
9582         for old pre-terrania symbol files.
9584 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
9586         * mono-config.c: Add ppc64 architecture.
9588         Code is contributed under MIT/X11 license.
9590 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
9592         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
9593           PPC64 uses function descriptors as well.
9595         Code is contributed under MIT/X11 license.
9597 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
9599         * object.c (compute_class_bitmap): Ignore literal static fields.
9601         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
9602         var has an invalid format.
9603         (describe_ptr): Add some sanity checks for the vtable.
9604         (add_nursery_frag): Clear unused nursery fragments.
9605         (major_collection): Clear all remaining nursery fragments.
9607 2008-05-03  Robert Jordan  <robertj@gmx.net>
9609         * image.c, metadata-internals.h: add thunk_invoke_cache.
9611         * marshal.c, marshal.h: implement
9612         mono_marshal_get_thunk_invoke_wrapper ().
9614         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
9616         Code is contributed under MIT/X11 license.
9618 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
9620         * verify.c (do_leave): Empty the stack.
9622 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
9624         * class.c (mono_class_is_assignable_from): Variance
9625         doesn't work between reference and value types. For example,
9626         given type C<T+>, C<int32> is not assignable to C<object>.
9627         Break the argument checking loop on first error. 
9629 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
9631         * icall.c : base64_to_byte_array() needs some more strict
9632           check for sequence of '=' characters. Patch by Santa
9633           Marta (http://deee.g.hatena.ne.jp/santamarta).
9635           Contributed under MIT/X11 license.
9636           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
9638 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
9640         * domain.c: Disable LoadLibrary support to fix Win32 build.
9642         Code is contributed under MIT/X11 license.
9644 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
9646         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
9647         to help with cache behaviour.
9649 2008-05-01  Miguel de Icaza  <miguel@novell.com>
9651         * appdomain.c (mono_domain_from_appdomain): Add new accessor
9652         method. 
9654 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
9656         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
9658 2008-05-01  Dick Porter  <dick@ximian.com>
9660         * process.c (process_get_fileversion): Only pass 16 bits of
9661         language ID to VerLanguageName.  Fixes bug 381204.
9663 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
9665         * verify.c (mono_method_verify): Fix the comparison
9666         operator for code bounds check.
9668 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
9670         * verify.c (mono_method_verify): Check the bounds of
9671         all access of the code array.
9673 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
9675         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
9677 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
9679         * image.c (mono_image_strong_name_position): Fix return value when the rva is
9680         not valid.
9682 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
9684         * loader.c (mono_get_method_from_token, mono_method_signature): Add
9685         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
9686         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
9687         fixup main EXE images when using mono.exe for mixed-mode assembly support.
9688         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
9689         mono_runtime_load.
9690         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
9691         runtime initialization from metadata.
9692         * assembly.c: Remove obsolete ceGetModuleFileNameA.
9693         (mono_set_rootdir): Use mono_get_module_file_name.
9694         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
9695         handles.
9696         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
9697         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
9698         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
9699         MonoCLIImageInfo. Add support for module handles.
9700         (load_cli_header): Update mono_cli_rva_image_map signature.
9701         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
9702         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
9703         (mono_image_rva_map): Add support for module handles.
9704         (mono_image_ensure_section_idx): Add support for module handles.
9705         (mono_image_close): Add support for module handles.
9706         (do_load_header): Add support for module handles.
9707         (mono_image_open_from_module_handle): New function for internal use.
9708         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
9709         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
9710         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
9711         handles.
9712         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
9713         * image.h: Add mono_image_fixup_vtable.
9714         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
9715         support.
9716         * coree.h: New file.
9717         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
9718         unsupported native code.
9719         (mono_marshal_set_callconv_from_modopt): New function splitted from
9720         mono_marshal_get_managed_wrapper.
9721         (mono_marshal_get_managed_wrapper): Use
9722         mono_marshal_set_callconv_from_modopt.
9723         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
9724         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
9725         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
9726         that results in a deadlock when the runtime is loaded in _CorDllMain.
9727         * Makefile.am: Add coree.c and coree.h.
9729         Contributed under MIT/X11 license.
9731 2008-04-28  Mark Probst  <mark.probst@gmail.com>
9733         * generic-sharing.c: Search for type arguments in array element
9734         types as well.
9736 2008-04-28  Mark Probst  <mark.probst@gmail.com>
9738         * class-internals.h, generic-sharing.c: New, small runtime generic context.
9740         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
9742         * object.c: Don't setup the RGCTX when the vtable is created,
9743         because we're setting it up lazily now.
9745 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
9747         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
9748         64 bit support.
9750 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
9752         * verify.c (verify_class_for_overlapping_reference_fields): 
9753         If class is under fulltrust allow reference types to overllap
9754         if they have the same RVA.
9756 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
9758         * pedump.c: Added new flag valid-only, that makes the verifier
9759         behaves just like --security=validil. It won't fail type load
9760         due to unverifiable restrictions.
9762 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
9764         * class-internals.h (struct MonoMethod): Added a verification_success
9765         field to cache verifier executions. Reduced MonoMethod:slot size by
9766         one bit.
9768 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
9770         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
9771         instead of a 'vt' argument to save an indirection and to allow these to be used
9772         for valuetypes.
9773         (scan_vtype): New helper function to scan an area using a gc descriptor.
9774         (mono_gc_wbarrier_value_copy): Implement this.
9775         (handle_remset): Add support for REMSET_VTYPE.
9776         (find_in_remset_loc): Ditto.
9777         (mono_gc_base_init): Allow some debugging options to be controlled through the
9778         use of the MONO_GC_DEBUG env variable.
9779         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
9780         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
9782 2008-04-23  Martin Baulig  <martin@ximian.com>
9784         * domain.c (mono_domain_create): Move the call to
9785         mono_debug_domain_create() down, after allocating the domain id.
9787 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
9789         verify.c (verify_class_for_overlapping_reference_fields): Skip
9790         static fields while verifying for overlapping fields as they
9791         don't matter at all.
9793 2008-04-23  Marek Habersack  <mhabersack@novell.com>
9795         * domain-internals.h: added a declaration of
9796         mono_make_shadow_copy.
9798         * assembly.c (mono_assembly_open_full): shadow copying of
9799         assemblies moved to here, so that all the assemblies within the
9800         application domain's private binary directories can be
9801         processed. Fixes bug #380546
9803         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
9804         mono_make_shadow_copy and made non-static. The decision whether
9805         to shadow-copy an assembly is made based on its location - it's
9806         copied if it's in one of the private application domain binary
9807         directories and its different to the target file in the shadow
9808         directory. Fixes bug #380546
9810 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
9812         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
9814         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
9815         types.
9817         * reflection.c (mono_image_create_token): Handle 
9818         Method/ConstructorOnTypeBuilderInst.
9819         (resolve_object): Ditto.
9820         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
9821         so it can be called from resolve_object. Also handle the case when the inflated
9822         class already has its methods setup.
9824 2008-04-21  Martin Baulig  <martin@ximian.com>
9826         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
9828 2008-04-20  Geoff Norton  <gnorton@novell.com>
9830         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
9831         pointer dereference.
9833 2008-04-15  Marek Habersack  <mhabersack@novell.com>
9835         * appdomain.c (try_load_from): if IOMAP is in effect, call the
9836         portability API to look up the assembly file. Fixes behavior in
9837         situations when the application has a bin/ directory, but the
9838         assembly search patch refers to Bin/ (and thus the requested file
9839         name is Bin/SomeLibrary.dll). Fixes bug #379888
9841 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
9843         verify.c (mono_type_is_generic_argument): Extracted this check
9844         from a dozen places to here.
9846         verify.c: Fixed all issues related to boxing generic arguments
9847         and their constraints.
9849 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
9851         verify.c (mono_class_interface_implements_interface): Fix win32 build.
9853 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
9855         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
9856         isn't finished yet. Fixes #363447.
9858 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
9860         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
9861         Fixes #346419.
9863 2008-04-13  Jb Evain  <jbevain@novell.com>
9865         * domain.c: update the 2.1 profile versions.
9866         Merged from the Moonlight 2 branch.
9868 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
9870         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
9871         mscorlibs for the non-refonly case as well.
9873         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
9874         in mono_assembly_load_from_full (). Fixes #378924.
9876 2008-04-11  Geoff Norton  <gnorton@novell.com>
9878         * icall.c: The global extern environ doesn't exist on Mac.  We
9879         need to call NSGetEnviron instead.
9881 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9883         verify.c: Add generic method constraint verification.
9885 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9887         class.c (mono_class_inflate_generic_method_full): Add a long
9888         explanation to the is_mb_open hack. Remove the FIXME.
9890 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9892         * verify.c (mono_method_verify): Mark all unknown opcodes
9893         as invalid. Mark jmp as unverifiable.
9895 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9897         * verify.c: Add code to do type constraint verification on class instances.
9899         * verify.c (mono_verifier_verify_class): Use the type constraint 
9900         verification code.
9902 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9904         * class.c (mono_class_get_field_default_value): Don't pass cindex
9905         as hint to mono_metadata_get_constant_index. The local is not initialized
9906         and should contain garbage most of the time. This could only work
9907         with a lot of luck.
9909 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
9911         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
9913 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
9915         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
9917         * class.c (mono_class_from_generic_parameter): Save the token of the
9918         generic param in MonoClass::sizes.generic_param_token.
9920         * reflection.c (mono_custom_attrs_from_class): If the class type is
9921         VAR or MVAR retrieve the attributes of the generic param.
9923 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9925         * class.c (mono_class_init): Do class verification if the verifier
9926         is enabled.
9928 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9930         * verify-internal.h: Added mono_verifier_verify_class.
9932         * verify.c: Added mono_verifier_verify_class. It checks for
9933         classes with explicit layout that have overlapping reference fields.
9935         * pedump.c: Init the verifier state prior to verification. Fixed
9936         command line arguments.
9938 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9940         * Makefile.am: Added verify-internals.h, hopefully fix the build.
9942 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
9944         * verify-internals.h: Fix a warning.
9946 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
9948         * verify-internals.h: New header with the verifier configuration
9949         extracted from mini.c.
9951         * verify.c: Implemented the new functions exported by verify-internals.h.
9953 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
9955         * verify.c: Add proper verification of ckfinite.
9957 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9959         * verify.c (do_conversion): Improved error message to something
9960         more meanfull.
9962         * verify.c (check_is_valid_type_for_field_ops): Fix to work
9963         with primitive types.
9965 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9967         * verify.c: Added tail prefix checking. Marked icall
9968         as unverifible.
9970 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9972         * verify.c: Fix the detection of branches to the middle
9973         of an instruction.
9975 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
9977         * verify.c: Implemented verification of volatile. and
9978         unaligned. prefix. Check if a type is valid after retrieving it.
9980 2008-04-01  Dick Porter  <dick@ximian.com>
9982         * process.c (process_get_fileversion): If there's no string block,
9983         set the file language to en_US.  Fixes the other new part of bug
9984         374600.
9986 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
9988         * class.c: New functions mono_method_can_access_field_full and
9989         mono_method_can_access_method_full. They perform type visibility
9990         and type site check.
9992         * class-internal.h: Added exported functions.
9994         * verify.c: Use new functions to implement proper visibility checks.
9996 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
9998         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
10000 2008-03-28  Dick Porter  <dick@ximian.com>
10002         * process.c (process_get_fileversion): Use the first language ID
10003         we see, rather than insisting on an invariant language.  Fixes bug
10004         374600.
10006 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
10008         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
10009         the streams to fix reading of invalid memory later.
10011         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
10012         to ease debugging.
10014 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
10016         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
10017         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
10019 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
10020         * threads.h: Added MonoThreadManageCallback type and
10021         mono_thread_set_manage_callback prototype
10022         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
10023         (used to store the mono_thread_manage callback).
10024         * threads.c: Added mono_thread_set_manage_callback, and handle
10025         "MonoThread->manage_callback" in build_wait_tids.
10027 2008-03-26  Dick Porter  <dick@ximian.com>
10029         * process.c (process_get_fileversion): Set FileVersionInfo strings
10030         to Empty when the resource doesn't have the particular info.
10031         Fixes bug 355717.
10033 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
10035         * verify.c (mono_method_verify): Proper prefix validation.
10037 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
10039         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
10040         itself in a separate argument instead of throwing them. Fixes #373448.
10042         * appdomain.c: Bump corlib version.
10044 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
10046         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
10048 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
10050         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
10051         version macros.
10053 2008-03-20  Mark Probst  <mark.probst@gmail.com>
10055         * generic-sharing.c, class-internals.h: Code for putting
10056         reflection types into the runtime generic context.
10058 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
10060         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
10061         Fixes #340662. 
10064 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
10066         * verify.c (VerifyContext): Added instruction prefix data to the struct.
10068         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
10070         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
10072         * verify.c (do_cast): Let the result value keep the boxed status.
10074         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
10076 2008-03-17  Jb Evain  <jbevain@novell.com>
10078         * reflection.c: when running on a 2.0 runtime, emit
10079         unconditionally the #~ header version as 2.0, and the
10080         CLI header version as 2.5, for symmetry's sake with csc.
10082 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
10084         * class.c: Remove the unused cache_interface_offsets stuff.
10086         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
10087         profiler.c: Fix warnings.
10089 2008-03-16  Mark Probst  <mark.probst@gmail.com>
10091         * generic-sharing.c, class-internals.h: Support for putting
10092         methods into the runtime generic context.
10094 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
10096         * class.c (mono_class_setup_fields): Ignore calls made to this function for
10097         classes which are generic instances of not-yet finished typebuilders. Fixes
10098         #351172.
10100         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
10102 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
10104         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
10106         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
10107         field, replace it with a hash table in MonoDynamicImage.
10109         * reflection.c (inflate_mono_method): Access the generic definition object from
10110         image->generic_def_objects instead of imethod->reflection_info.
10112         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
10114         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
10115         
10116         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
10117         function in reflection.c so it is easier to keep in sync with the dynamic image
10118         creation code.
10120         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
10121         mono_image_close ().
10123 2008-03-15  Mark Probst  <mark.probst@gmail.com>
10125         * class.c (mono_class_generic_sharing_enabled): Disable generic
10126         sharing for all architectures except AMD64 and x86 to fix build.
10128 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
10130         * verify.c: Use the generic definition MonoGenericContext when available.
10131         Remove code for checking generics instance compatibility in favor of
10132         mono_class_is_assignable_from.
10134 2008-03-14  Mark Probst  <mark.probst@gmail.com>
10136         * marshal.c, marshal.h, metadata-internals.h, image.c,
10137         wrapper-types.h: New wrapper for invoking a shared static method
10138         without having to pass the runtime generic context argument.
10140 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
10142         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
10144 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
10146         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
10147         
10148         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
10149         create a token from a FieldOnTypeBuilderInst.
10150         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
10151         (resolve_object): Ditto.
10153         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
10154         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
10156 2008-03-14  Martin Baulig  <martin@ximian.com>
10158         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
10160         * debug-mono-symfile.h
10161         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
10162         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
10164 2008-03-10  Martin Baulig  <martin@ximian.com>
10166         * debug-mono-symfile.h
10167         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
10168         `lexical_block_table_offset'.
10169         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
10170         `lexical_blocks'.
10171         (MonoSymbolFile): Added `version'.
10173         * mono-debug.h
10174         (MonoDebugLexicalBlockEntry): Removed.
10175         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
10176         `lexical_blocks'.
10178         * mono-debug.c (mono_debug_add_method): Don't compute lexical
10179         blocks here; the debugger now does this internally.
10181 2008-02-27  Martin Baulig  <martin@ximian.com>
10183         * object.c (mono_runtime_exec_main): Call
10184         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
10185         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
10187 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
10189         * verify.c (verify_type_compatibility_full): Allow native int to be converted
10190         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
10192 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
10194         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
10195         ldftn with a virtual method.
10197 2008-03-13  Geoff Norton  <gnorton@novell.com>
10199         * decimal.c:  Only include memory.h if the platform has it.
10201 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
10203         * assembly.c, class.c, metadata-internals.h: make sure public key
10204         tokesns are compared in a case-insensitive way. Also, all
10205         the lookups in the GAC use a lowercase public key token
10206         (gaacutil already does the lowercasing on install). Fixes
10207         bug #369541.
10209 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
10211         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
10212         and return value.
10214 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
10216         * image.c: when someone loads a mscorlib from a file, return the
10217         currently loaded mscorlib (fixes bug #369253).
10219 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
10221         * class.c: handle types with no parents by forcing them to have
10222         System.Object as a parent and marking them as broken (this currently
10223         allows the first part of bug #369173 to work as well, likely because
10224         we don't check for typeload exceptions everywhere yet).
10226 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
10228         * class.c: more complete check that types belong to corlib
10229         (fixes second part of bug #369173).
10231 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
10233         * generic-sharing.c:  Including glib.h for the MSVC builds to define
10234           "inline" to "__inline" before including mono-membar.h.
10235           
10236         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
10237           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
10238           MSVC builds.
10240         Contributed under MIT/X11 license.
10242 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
10244         * verify.c (do_invoke_method): Remove return type validation.
10246         * verify.c (do_ret): Do return type validation at return site instead of
10247         call site.
10249 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
10251         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
10253         * verify.c: Some todos cleaned and improved a few error messages.
10255 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
10257         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
10259 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
10261         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
10262         system types correctly.
10264         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
10265         function.
10267 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
10269         * assembly.c (build_assembly_name): Fix a warning.
10271 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
10273         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
10274         the called function takes an object type argument. Fixes storing or
10275         valuetypes across remoting as well as reducing memory usage.
10276         * image.c, metadata-internals.h: remove now unused ldfld_remote and
10277         stfld_remote wrapper caches.
10279 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
10281         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
10282         is not found.
10284         * reflection.c (mono_image_register_token): New helper function to save
10285         a token->object mapping.        
10287         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
10288         managed code.
10290         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
10291         one dimension arrays. Fixes #367670.
10292         (mono_reflection_get_type_internal): Ditto.
10294 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
10296         * marshal.c: mono_load_remote_field_new() always returns object.
10297         so use the proper signature (fixes bug #366445).
10299 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
10300         
10301         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
10302         add an 'inline_failure' flag instead.
10304 2008-03-04  Mark Probst  <mark.probst@gmail.com>
10306         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
10307         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
10308         contains the location of "this", used for exception handling.
10310 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
10312         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
10313         their size on all platforms for perf reasons.
10315 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10317         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
10318         object-internal.h
10320         * object-internal.h: Same.
10322 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10324         * reflection.h: Fix the build I just broke.
10326 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10328         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
10329         Test if a token is valid, this remove explicit usage of 
10330         MonoDynamicImage::tokens from the verifier code.
10332         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
10334         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
10335         instead of direct access to MonoDynamicImage::tokens.
10337 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10339         * verify.c (token_bounds_check): Fix the build I just broke.
10341 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10343         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
10345         * verify.c (verifier_load_method): Fixed the errors message.
10347         * verify.c (mono_method_verify): Fixed a debug message.
10349 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
10351         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
10352         mono-perfcounters.h, class-internals.h: support for predefined
10353         writable counters, query of categories and counters, bugfixes.
10355 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
10357         * verify.c (do_refanytype): Verify the refanytype opcode.
10359         * verify.c (mono_method_verify): Use do_refanytype.
10361 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
10363         * verify.c (do_mkrefany): Verify the mkrefany opcode.
10365         * verify.c (mono_method_verify): Use do_mkrefany.
10367 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
10369         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
10370         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
10371         implementation.
10373 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
10375         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
10376         the type load exception.
10378 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
10380         * verify.c: Added a few FIXME for method signatures
10382         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
10383         of mono_method_get_signature and get vararg call working. Removed unused
10384         checks for return value.
10386         * verify.c (do_refanyval): Verify the refanyval opcode.
10388         * verify.c (mono_method_verify): Implemented verification of arglist and
10389         use do_refanyval.
10391 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
10393         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
10394         vtypes to marshal.c.
10396         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
10397         it works for AOT as well.
10399 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
10401         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
10402         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
10403         the system time is adjusted.
10405 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
10407         * icall.c, icall-def.h: use the new time functions (fixes the
10408         non-monotonic behaviour of TickCount).
10410 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
10412         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
10413         it breaks the build.
10414         
10415         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
10416         cattr is not finished yet.
10418 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
10420         * verify.c: Proper token validation for field, method and type.
10422 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
10424         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
10426         * loader.c (method_from_memberref): Generate type load error instead of method missing
10427         if the type is not found.
10429 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
10431         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
10432         some of the conversions caused the generation of a marshal directive exception.
10434 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
10436         verify.c: Report which exception should be thrown by the JIT.
10437         Added a lot of FIXME notes.
10439 2008-02-22  Mark Probst  <mark.probst@gmail.com>
10441         * generic-sharing.c: Runtime generic context slots are not
10442         instantiated on init anymore.  Instead, provide function to do the
10443         instantiating on demand.
10445         * class-internals.h: Added vtable to runtime generic context.
10446         Macros for encoding direct and indirect slot offsets in one
10447         guint32.
10449 2008-02-21  Mark Probst  <mark.probst@gmail.com>
10451         * object.c, generic-sharing.c: Moved some generic sharing code
10452         from object.c to generic-sharing.c.
10454         * generic-sharing.c: Added support for extensible runtime generic
10455         context.
10457         * metadata-internals.h: Two new hash tables in MonoImage for
10458         extensible runtime generic context support.
10460         * domain.c: Unregister generic vtables upon domain unloading.
10462         * image.c: Destroy new hash tables upon image unloading.
10464         * metadata.c: Unregister generic subclasses upon image unloading.
10466         * class-internals.h: New data structure for runtime generic
10467         context template.  New fields in the runtime generic context for
10468         extensible part.
10470         * Makefile.am: Added generic-sharing.c.
10472 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
10474         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
10475         there is a pending loader exception, raise it.
10477         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
10478         same.
10480         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
10481         same.
10483         Fixes #363450.
10485 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
10487         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
10489         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
10490         
10491         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
10492         ref-only requests for compatibility with MS.
10494 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
10496         * reflection.c (mono_custom_attrs_from_method): Don't silently
10497         return an empty list for generic method instances.
10498         (mono_custom_attrs_from_param): Likewise.
10500 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
10501             Raja R Harinath  <harinath@hurrynot.org>
10503         Fix #354757
10504         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
10505         * class.c (mono_class_inflate_generic_method_full): Initialize it
10506         when a fully-open method is instantiated.
10507         * metadata.c (inflated_method_equal, inflated_method_hash): Update
10508         to new field.
10509         * reflection.c (inflate_mono_method): Don't create a temporary context.
10511 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
10513         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
10514         Compute correct value, to prepare for imethod->reflection_info going away.
10516 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
10518         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
10520 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
10522         * verify.c: Implement skip visibility flag.
10524 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
10526         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
10527         which contains an extra field to tell the kind of exception that should be thrown.
10529         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
10531 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
10533         * loader.c (mono_method_get_param_names): Initialize 'klass' after
10534         'method' is updated.
10536 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
10538         * class.c (mono_class_layout_fields): Set class->min_align for classes using
10539         explicit layout as well. Fixes #360375.
10541 2008-02-11  Geoff Norton  <gnorton@novell.com>
10543         * loader.c: Guard and dereference against inflated generic methods
10545 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
10547         * class.c: Include Retargetable spec in assembly name.
10548         * assembly.c: Always include PublicKeyToken spec in assembly name
10549         (with value "null" if assembly is not signed), and include
10550         Retargetable spec.
10551         * icall-def.h: Added icall for Assembly.get_fullname.
10552         * icall.c: Added icall returning the fullname of an assembly.
10554 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
10556         * class.c (mono_class_setup_vtable_general): Add a missing call to
10557         mono_class_setup_methods () which is needed in the AOT case.
10559 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
10561         * verify.c (mono_type_get_stack_name): Added. Return the name for the
10562         stack type of the given MonoType.
10564         * verify.c (verify_type_compatibility_full): Handle the void type.
10566         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
10567         way stack merging works.
10569         * verify.c (store_local): Improved verification message.
10571         * verify.c (do_branch_op): If the merging is invalid, the method
10572         is unverifiable and not invalid. Improved error message.
10574         * verify.c (merge_stacks): Properly merge a boxed valuetype and
10575         a reference type diferent than System.Object. Improved error
10576         message.
10578 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
10580         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
10582         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
10583         type of an enum even if the argument is byref.
10585         * verify.c: Replace all explicit uses of enumtype and enum_basetype
10586         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
10588         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
10590         *verify.c (verify_type_compatibility_full): Make enum types
10591         compatible with their base types.
10593         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
10594         types are compatible for the special case of a boxed valuetype and
10595         System.Object.
10597         * verify.c (verify_stack_type_compatibility): The function
10598         is_compatible_boxed_valuetype was extracted from here.
10600         * verify.c (push_arg): Only set ctx->has_this_store if the method
10601         is not static.
10603         * verify.c (do_ldelem): Fixed a typo in an error message and added
10604         strict check for mixing int32 and native int as the array type
10605         and ldelem type.
10607         * verify.c (merge_stacks): Consider boxed valuetypes in the
10608         compatibility checks.
10610 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
10611         * profiler.h: (MonoGCEvent): Added start-stop the world events.
10613 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
10614         *class.c: use_new_interface_vtable_code: renamed the env var to have
10615         a "MONO_" prefix, and fix the logic to enable it by default.
10617 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
10618         *class.c:
10619         mono_class_setup_vtable_general: rewrote the way in which interface
10620         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
10621         makes the code more maintainable.
10622         For now the old code is still there, and can be activated setting
10623         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
10625 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
10627         * verify.c: guarded some debug functions around and #ifdef.
10629         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
10631 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
10633         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
10634         changes for now since they seem to break too many things.
10636 2008-02-05  Mark Probst  <mark.probst@gmail.com>
10638         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
10639         mono_marshal_find_nonzero_bit_offset): Added macro and function
10640         for finding the byte- and bit-offset of a bitfield within a
10641         struct.
10643 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
10645         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
10646         (mono_marshal_get_struct_to_ptr): Ditto.
10648         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
10649         cctor_signature.
10651 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
10653         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
10654         between methods for non-corlib types.
10656 2008-02-02  Geoff Norton  <gnorton@novell.com>
10658         * loader.c (mono_method_get_param_names): Populate the parameter name for 
10659         generic parameters as well. (Fixes #342536)
10661 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
10663         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
10665         * verify.c (do_invoke_method): Fix for calling with byref structs.
10667         * verify.c (do_cast): push a boxed value type based on the type token and not
10668         the type of stack.
10670 2008-01-31  William Holmes  <billholmes54@gmail.com>
10672         * process.c (process_module_string_read): Check the size returned form 
10673           VerQueryValue to avoid out of memory exception. 
10675 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
10677         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
10678         Handle properly modules which are not in the moduleref table. Fixes
10679         #356938.
10681 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
10683         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
10684         the dynamic case which is now in managed code.
10685         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
10687         * marshal.c (mono_string_to_bstr): Fix a warning.
10688         (init_com_provider_ms): Ditto.
10690         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
10692         * exception.c (mono_get_exception_out_of_memory): New helper function.
10694 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
10696         * marshal.c: Add support for BSTR marshalling
10697         using other COM systems.
10699         Code is contributed under MIT/X11 license.
10701 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
10703         * object.c (mono_runtime_invoke_array): reverted previous
10704         commit as it breaks the build.
10706 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
10708         * object.c (mono_runtime_invoke_array): Verify arguments for
10709         invalid types. Fixes #348522.
10711 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
10713         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
10714         non-final virtual calls using call. 
10716         * verify.c (do_invoke): fixed some TODOs.
10718         * verify.c (push_arg): set has_this_store for "ldarga 0".
10720 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
10722         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
10723         which belong to an inflated class. Fixes #356531.
10725 2008-01-26  Robert Jordan  <robertj@gmx.net>
10727         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
10728         which resort to FindFirstFile when a certain error condition
10729         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
10730         Code is contributed under MIT/X11 license.
10732 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
10734         * marshal.c (emit_marshal_string): Fix out string marshalling
10735         to use specified encoding. Fixes #323900.
10737         Code is contributed under MIT/X11 license.
10739 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
10741         * class.c (mono_class_inflate_generic_method_full): Don't modify
10742         iresult->context after cache check.
10744 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
10746         * class.c (mono_class_inflate_generic_method_full): Change the
10747         struct assignments to memcpy for better visibility and add some comments.
10749 2008-01-23  Dick Porter  <dick@ximian.com>
10751         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
10752         procedure, and make it work on windows.
10754 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
10756         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
10757         a MonoReflectionTypeBuilder since it is always of that type.
10759         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
10761         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
10763         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
10764         
10765         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
10767         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
10769         * reflection.c (mono_reflection_create_runtime_class): Remove already created
10770         instantiations from the type cache.
10772 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10774         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
10776         * verify.c (do_unbox_value): push a controled mutability managed pointer.
10778 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10780         * verify.c (do_ldstr): added, verifies if the #US token is valid.
10782         * verify.c (mono_method_verify): removed old TODO
10784 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10786         * verify.c (do_newobj): add visibility check.
10788 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
10790         * verify.c (do_load_function_ptr): add visibility check.
10792 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
10793         *class.c:
10794         mono_generic_class_get_class: hook profiler events.
10795         mono_field_get_offset: added to support heap-shot in the new profiler.
10796         *class.h: exported mono_field_get_offset.
10797         * reflection.c:
10798         mono_reflection_setup_internal_class: hook profiler events.
10800 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
10802         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
10803         argument here too and use it to avoid checking for pending exceptions if 
10804         possible.
10806 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
10808         * assembly.c (build_assembly_name): add arg for passing the assembly
10809         flags. Do not consider a PublicKey with value "null" valid.
10810         (mono_assembly_name_parse_full): added boolean argument that will be
10811         set if the assembly name contains a PublicKeyToken spec. Added support
10812         for the Retargetable spec for which only Yes or No are allowed as valid
10813         value. Consider assembly name invalid if Retargetable spec is set, but
10814         either version, culture or public key (token) are not specified.
10815         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
10816         with implementation in assembly.c.
10817         * icall.c (fill_reflection_assembly_name): also copy assembly flags
10818         from MonoAssemblyName.
10819         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
10820         introduced argument for mono_assembly_name_parse_full to know if the
10821         assembly name has a PublicKeyToken spec, and if it has instruct
10822         fill_reflection_assembly_name to use default value for keyToken (if
10823         PublicKeyToken is null).
10825 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
10827         * verify.c (mono_method_verify): fixed ovf ops with
10828         float values. They are unverifiable now.
10830 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
10832         * class.c (set_failure_from_loader_error): add BadImageException to the
10833         list of exceptions that can cause a type to fail to load.
10835         * class.c (mono_class_get_exception_for_failure): same.
10837 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
10839         * verify.c (in_any_exception_block): added, check if offset
10840         is part of any exception handling clause.
10842         * verify.c (get_stack_type): added VAR and MVAR types.
10844         * verify.c (do_stobj): better error messages.
10846         * verify.c (do_cpobj): added, check cpobj.
10848         * verify.c (do_initobj): added, check initobj.
10850         * verify.c (do_sizeof): added, check sizeof.
10852         * verify.c (do_localloc): added, check localloc.
10854         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
10856 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
10858         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
10859         save_lmf/restore_lmf opcodes.
10861         * threads.c (mono_threads_install_notify_pending_exc): New function to
10862         install a callback notifying the JIT there is a pending exception on a thread.
10863         (mono_thread_request_interruption): Call the new callback.
10864         (mono_thread_get_and_clear_pending_exception): New function to return the
10865         exception pending on a thread.
10867         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
10868         to turn off checking for pending exceptions.
10869         (mono_marshal_get_native_wrapper): Ditto.
10871 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
10873         * threads-types.h: Get rid of the unnecessary extern declarations.
10875 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
10877         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
10878         return field from parent class if not private.
10879         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
10880         returns fields from parent class if they are not private.
10881         (method_nonpublic): added function to determine if a given method
10882         should be considered non-public. Returns false for private methods
10883         on parent class, and internal methods from parent on the 1.0 profile.
10884         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
10885         use method_nonpublic function to determine whether method should be
10886         returned.
10887         (property_accessor_public): use newly introduced method_nonpublic
10888         function to determine whether accessor is non-public. 
10889         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
10890         event from parent class if not private. Only return static event if
10891         Static flag is set, and only return static event from parent class if
10892         FlattenHierarchy flag is set.
10893         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
10894         include non-private events from parent class.
10896 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
10898         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
10899         warning.
10901 2008-01-16  Wade Berrier <wberrier@novell.com>
10903         * security.c: Add assembly.h header to appease some warnings
10905 2008-01-16  Dick Porter  <dick@ximian.com>
10907         * process.c (process_module_string_read): Remove trailing null
10908         when saving string.
10910 2008-01-16  Mark Probst  <mark.probst@gmail.com>
10912         * class-internals.h: A new data structure describing the layout of
10913         a runtime generic context (MonoRuntimeGenericContextTemplate).
10915         * metadata-internals.h: Added a hash table to MonoDomain that maps
10916         from open generic classes to their runtime generic context
10917         templates.
10919         * object.c: Building of the runtime generic context, including
10920         proper handling of generic type arguments of superclasses.
10921         Building of the runtime generic context according to the template.
10923 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
10925         * class.c (mono_class_setup_fields): Set field.count for generic instances.
10926         Fixes #350856.
10928         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
10929         mono_portability_find_file (). Fixes #325466.
10930         (mono_image_get_public_key): Fix a warning.
10932 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
10934         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
10935         Fixes #353550.
10936         (mono_class_from_name_case): Ditto.
10938 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
10940         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
10941           common storage for the tables used in the System/NumberFormatter class.
10943 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
10945         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
10947 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
10949         * verify.c (get_boxable_mono_type): check if the token is valid.
10951         * verify.c (set_stack_value): changed to add an error if an
10952         invalid type is set on stack. Changed all callers due to signature change.
10954         * verify.c (do_stobj): implement stobj validation.
10956 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
10958         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
10959         set container->is_method, it was set earlier.
10961         * metadata.c (type_in_image): Handle MVARs which belong to not finished
10962         generic methods.
10964         * reflection.c (mono_reflection_initialize_generic_parameter): Set
10965         is_method of the generic container to TRUE for methods.
10967 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
10969         * metadata.c (type_in_image): Handle type parameters properly.
10971         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
10972         memory ownership of this structure.
10974 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
10976         * verify.c (get_boxable_mono_type): make typedref types been just
10977         unverifiable. check for void type.
10979         * verify.c (do_unbox_any): added, verify opcode unbox.any.
10981         * verify.c (do_load_function_ptr): accept method spec tokens.
10983 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
10985         * marshal.c (mono_class_native_size): Always set *align even if this is called
10986         recursively.
10988 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
10990         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
10991         out-of-date.
10993 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
10995         * verify.c: removed some old unused tables. A huge bunch of small fixes
10996         to things found while testing the verifier with mono basic.
10998         * verify.c (dump_stack_value): dump null literal flag to.
11000         * verify.c (verify_type_compatibility_full): fix comparison
11001         for types that have a generic super type.
11003         * verify.c (verify_stack_type_compatibility): fix compatibility
11004         between null literals and reference types. fix compatibility between
11005         boxed valuetypes and object. fix corner case test for enums.
11007         * verify.c (do_cmp_op): proper verification of cgt.un in case
11008         of reference types.
11010         * verify.c (do_invoke_method): fix error message.
11012         * verify.c (do_store_indirect
11014         * verify.c (check_is_valid_type_for_field_ops): proper verification
11015         of managed pointers to valuetypes and boxed valuetypes. proper verification
11016         of null literals.
11018         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
11019         allow token to be a reference type.
11021         * verify.c (do_cast): proper handling of boxes valuetypes.
11023         * verify.c (do_stelem): proper handling of storing a boxed valuetype
11024         in object[].
11026         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
11027         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
11028         fixed the decoding of unbox_any
11030 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
11032         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
11034 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
11036         * verify.c (do_newobj): do delegate verification.
11038         * verify.c (verify_delegate_compatibility): perform delegate
11039         verification.
11041         * verify.c (verify_ldftn_delegate): perform tests related to
11042         ldftn delegates.
11044         * verify.c (mono_delegate_signature_equal): perform the
11045         slightly diferent signature comparison required by delegates.
11047         * metadata.c (mono_metadata_type_equal_full): added and exported
11048         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
11049         allows signature only comparison.
11051         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
11052         as MONO_INTERNAL.
11054 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
11056         * verify.c: added a bunch of stack_slot_* functions to
11057         make access to stack slot type easier. This is required to
11058         allow optional flags, like null literal, boxed value and
11059         this pointer.
11060         All access paths to IlStackDesc::stype have been changed 
11061         to use these new funcions.
11062         Removed a bunch of unused functions and cleared all warnings.
11063         This patch introduces the usage of the this pointer and 
11064         boxed value flags.
11066 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
11068         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
11070 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
11072         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
11073         match managed version.
11075         * appdomain.c: Bump corlib version.
11076         
11077         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
11078         argument.
11080 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
11082         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
11083         Set public key token to zero-length byte array if assembly is not
11084         strongnamed.
11086 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
11088         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
11089         writing a vtype array elem.
11091 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
11093         * assembly.c (build_assembly_name): return FALSE if length of token is
11094         not 16 (if not "null").
11095         (mono_assembly_name_parse_full): return FALSE if value of version,
11096         culture, token or key is 0.
11097         * icall.c (fill_reflection_assembly_name): add boolean arguments to
11098         specify whether public key and public key token must be set to default
11099         value (zero-length byte array) if not available. Set versioncompat to
11100         SameMachine. If public key is available or the default is set, then
11101         set PublicKey flag.
11102         (ves_icall_System_Reflection_Assembly_FillName): if no public key
11103         is available, use empty byte array as default value. On the 2.0
11104         profile, use default value for public key token if not set.
11105         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
11106         profile, use default value for public key if not set. On the 2.0
11107         profile, use default value for public key token if not set.
11108         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
11109         default values for public key and public key token.
11111 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
11113         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
11114         field to keep it in synch with the managed object.
11116         * marshal.c (emit_marshal_object): Add support for byref marshalling of
11117         delegates. Fixes #351520.
11119         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
11120         contains defined memory.
11121         
11122         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
11124         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
11125         
11126         * sgen-gc.c (check_consistency): New helper function to do a consistency check
11127         of the GC data structures.
11129         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
11131         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
11132         
11133         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
11134         barrier.
11135         (mono_array_clone_in_domain): Ditto.
11136         (mono_array_clone_in_domain): Ditto.
11138         * threads.c (start_wrapper): Register the thread start argument as a GC root.
11139         (cache_culture): Use a write barrier.
11141         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
11142         (ves_icall_get_property_info): Ditto.
11144         * object.h (MONO_STRUCT_SETREF): New macro.
11146         * class-internals.h (MonoStats): Add some GC statistics.
11148         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
11150 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
11152         * exception.c (mono_exception_from_name_two_strings):
11153         Break from loop after method is found.
11155 2008-01-04  Dick Porter  <dick@ximian.com>
11157         * process.c (process_module_string_read): Rename variable to
11158         reflect correct usage, after fixing bug 345972.
11160 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
11162         * verify.c (mono_type_create_fnptr_from_mono_method): 
11163         created a MonoType function pointer instance to be used during
11164         verification. The verifier releases this memory at end.
11166         * verify.c (mono_method_is_constructor): extracted repeated
11167         checks for constructor into a single class.
11169         * verify.c (do_push_field): use new extracted method
11170         for constructor check.
11172         * verify.c (do_newobj): same.
11174         * verify.c (do_ldftn): renamed to do_load_function_ptr
11175         and make it verify ldvirtftn too.
11177         * verify.c (mono_method_verify: proper verification
11178         of ldvirtftn. release created MonoMethod instances.
11180 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
11182         * verify.c (token_bounds_check): added.
11184         * verify.c (do_ldftn): added.
11186         * verify.c (mono_method_verify): proper verificartion of ldftn.
11188 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
11190         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
11191         than the table row count. It's the resposibility of the caller to
11192         make the bounds check and raise the correct error.
11194         * metadata.c (mono_metadata_decode_row_col): Same.
11196         * loader.c (mono_get_method_from_token): perform bounds check
11197         on token for methoddef table.
11199 2007-12-29  Miguel de Icaza  <miguel@novell.com>
11201         * icall.c
11202         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
11203         assert into a negative result, the managed code already coped with
11204         that.
11206         Some folks on Windows reported this error. 
11208 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
11210         * appdomain.c: Bump corlib version.
11211         * icall.c:
11212         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
11213         CultureInfo.CreateCulture to create CultureInfo for name.
11214         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
11215         create CultureInfo for name. Fixes bug #347174.
11217 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
11219         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
11220         flags.
11222         * verify.c (is_valid_branch_instruction): allow branching to the
11223         first instruction of the protected block.
11225         * verify.c (is_valid_cmp_branch_instruction): same.
11227         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
11228         avoid double initialization.
11230         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
11231         detect which cases the eval stack should just be copied.
11233         * verify.c (mono_method_verify): check if the eval stack
11234         is empty when entering a protected block.
11236 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
11238         * verify.c: added is_clause_in_range, is_clause_inside_range,
11239         is_clause_nested and verify_clause_relationship. They perform
11240         the verifications stated in P1 12.4.2.7.
11242         * verify.c (mono_method_verify): remove some unused variables,
11243         add the new exception clause checks, add instruction border
11244         checks for protected block start/end, improved some error 
11245         messages and fixed a bug in the way invalid instruction access
11246         is detected.
11248 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
11250         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
11251         from GC 7.0 if available.
11253         * object.c: Remove an unused define.
11254         
11255         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
11257         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
11259         * null-gc.c (mono_gc_make_descr_for_array): Implement.
11261         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
11263         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
11264         to take the same arguments as the other make_descr functions.
11266         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
11268         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
11269         directly.
11271         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
11272         mini.c.
11274         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
11275         call to boehm-gc.c.
11277         * boehm-gc.c (mono_gc_register_root): Fix a warning.
11279         * null-gc.c (mono_gc_register_root): Fix a warning.
11281         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
11283         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
11284         (mono_gc_base_init): Call GC_init ().
11286         * null-gc.c: Define mono_gc_register_root () as a no-op.
11288         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
11290 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
11292         * verify.c: add prototype for merge_stacks at top
11294         * verify.c (do_switch): added.
11296         * verify.c (merge_stacks): on some cases the stack merging
11297         was not happening properly. Unequal stack sizes at merge
11298         points should be invalid.
11300         * verify.c (mono_method_verify): added more debug info on stack state.
11301         verify switch properly.
11303 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
11305         * method-builder.h: New file, moved the mono_mb_ declarations here from 
11306         marshal.h.
11308         * boehm-gc.c marshal.c: Include method-builder.h.
11310         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
11312         * marshal.c: Remove some code which is now in method-builder.c.
11314 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
11316         * method-builder.c: New file, extraction of the method builder functionality 
11317         from marshal.c.
11319         * marshal.c: Move the mb functions into method-builder.c.
11321         * marshal.h marshal.c: Export some mono_mb_... functions.
11323         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
11325         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
11326         the caller.
11328         * class.c (mono_class_get_full): Check the token type in the dynamic case.
11330         * loader.c (mono_field_from_token): Ditto.      
11332         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
11333         type as well.
11334         
11335         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
11336         Fixes #342565.
11338         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
11339         a helper function for setting it.
11341         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
11343         
11344         * assembly.c: Significally simplify code now that referenced assemblies are 
11345         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
11347         * threads.h: Don't include  the internal threads-types.h header file. Fixes
11348         #349952.
11350 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
11352         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
11353         instructions that were target of branches or are at protected block boundaries.
11355         * verify.c (in_same_block): handle filter clauses.
11357         * verify.c (is_valid_branch_instruction): added. checks the target of
11358         instructions br or brtrue/false.
11360         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
11361         binary branch instructions such as beq and bge.
11363         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
11364         and made it pin the instruction as been part of the exception block.
11366         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
11367         of in_same_block.
11369         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
11370         of in_same_block.
11372         * verify.c (do_ret): ret from a protected block is unverifiable and
11373         not invalid.
11375         * verify.c (do_static_branch): verify br and br.s instructions.
11377         * verify.c (merge_stacks): add extra param to support detection
11378         of branches in the middle of instructions.
11379         
11380         * verify.c (mono_method_verify): verify branches and exception blocks
11381         that target the middle of instructions. Proper verification of br and br.s.
11383 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
11385         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
11386         skip_visibility field.
11387         (reflection_methodbuilder_from_dynamic_method): Ditto.
11389         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
11390         registrations. Fixes #348193.
11392         * threads.h: Move the internal mono_thread_get_pending_exception () to
11393         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
11395 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
11397         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
11398         icall registration. Fixes #348193.
11400         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
11401         for corlib classes into object. Fixes #349621.
11403 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
11405         * icall.c (property_accessor_nonpublic): new function to determine
11406         whether an accessor allows a property to be considered non-public.
11407         Returns false for private accessor(s) from parent class, and internal
11408         accessor(s) from parent on 2.0 profile (and higher).
11409         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
11410         to determine whether property should be included if NonPublic flag
11411         is set. Fixes bug #349078.
11413 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
11415         * verify.c (init_stack_with_value): added.
11417         * verify.c (mono_method_verify): extracted common
11418         code for exception initialization into init_stack_with_value.
11420         * verify.c (mono_method_verify): initialize the exception
11421         for handler clauses as well.
11423         * verify.c (mono_method_verify): fix the exception clause
11424         ordering rules, it should use handler end offset and not
11425         start offset.
11427 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
11429         * rawbuffer.c: remove useless warning.
11431 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
11433         * threads.h, threads-types.h: move functions to the correct header
11434         (fixes bug#349952).
11436 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11438         * verify.c (mono_method_verify): proper verification
11439         of exception handling clauses ranges and fallthru in
11440         and out of protected blocks.
11442 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11444         * verify.c (mono_method_verify): fixed compilation issue.
11446 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11448         * verify.c (mono_method_verify): a printf slipped in, changed
11449         to use verifier debug macro.
11451 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
11453         * verify.c (is_correct_leave): check for filter clauses.
11455         * verify.c (do_filter): added.
11457         * verify.c (mono_method_verify): property verification of leave.
11460 2007-12-18  Mark Probst  <mark.probst@gmail.com>
11462         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
11463         Win32 build, until we figure out how to do the proper thing on
11464         Win32.
11466 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
11468         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
11469         by the previous patch.
11470         
11471         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
11472         the assembly resolve handler for refonly assemblies.
11474 2007-12-17  Mark Probst  <mark.probst@gmail.com>
11476         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
11477         Make sure only one thread is allowed to commence shutdown, and
11478         don't allow new threads to be started once shutdown is in
11479         progress.
11481 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
11483         * verify.c (is_correct_endfilter): added.
11485         * verify.c (is_unverifiable_endfilter): added.
11487         * verify.c (do_endfilter): added.
11489         * verify.c (mono_method_verify): property verification of endfilter
11490         and fixed a corner case or endfinally.
11492 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
11494         * verify.h: new flags to support fail fast of unverifiable code and
11495         do non-strict verification. Non-strict verification is required to
11496         have MS runtime compatibility. There are a huge amount of unverifiable
11497         code that it accepts as verifiable. The strict mode verifies the code
11498         as the specs says.
11499         Non-strict mode will be required in cases where code needs to be
11500         accepted as verifiable but fails under strict mode.
11502         * pedump.c: added support to fail fast and non-strict verification.
11504         * verify.c: added support for both fail fast and non-strict verification.
11506 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
11508         * verify.c (is_correct_endfinally): added.
11510         * verify.c (mono_method_verify): property verification of endfinally.
11512 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
11514         * verify.c (in_any_block): check for filter clauses.
11516         * verify.c (is_correct_rethrow): added.
11518         * verify.c (mono_method_verify): property verification of rethrow.
11520         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
11522 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
11524         * verify.c (do_throw): added.
11526         * verify.c (mono_method_verify): property verification of throw
11528 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
11530         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
11531         assemblies. Fixes #346425.
11533 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
11535         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
11536         FieldBuilders.
11538         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
11540         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
11541         prevent asserts when this is called with a token which might not be valid.
11543         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
11544         lookup_dynamic_token_class with valid_token == FALSE.
11546         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
11548         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
11550         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
11551         
11552 2007-12-10  Mark Probst  <mark.probst@gmail.com>
11554         * gc.c: Don't delay threadpool thread finalization unless Mono is
11555         shutting down.
11557 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
11559         * threads.c: turn an assert into a non-fatal warning.
11561 2007-12-09  Robert Jordan  <robertj@gmx.net>
11563         * icall.c (GetVirtualMethod): Add missing argument validation.
11565 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11567         * verify.c (do_cast): added.
11569         * verify.c (mono_method_verify): property verification of castclass and isinst.
11572 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11574         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
11576         * verify.c (do_stelem): added.
11578         * verify.c (mono_method_verify): property verification of stelem.X.
11580 2007-12-07  Mark Probst  <mark.probst@gmail.com>
11582         * class.c, class-internals.h: Introduce an environment variable
11583         (MONO_GENERIC_SHARING) through which the extent of generic code
11584         sharing can be controlled (share all classes, share only corlib
11585         classes, or share nothing).
11587         * object.c: Only create runtime generic context for classes for
11588         which sharing is enabled.
11590 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11592         * verify.c (do_ldelem): refactor it to work with ldelem.any.
11594         * verify.c (mono_method_verify): property verification of ldelem.any.
11596 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11598         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
11599         added ldelem.X opcodes.
11601         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
11603         * verify.c: proper verification of ldelem.X 
11605 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
11607         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
11609 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
11611         * verify.c (mono_method_verify): null literal requires special handling,
11612         the value pushed on stack need to be flagged as so.
11614         * verify.c (do_ldelema): Verify ldelema properly.
11616 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
11618         * verify.c: Verify ldlen properly.
11620 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
11622         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
11623         to the target object's type. Fixes #346160.
11625 2007-12-05  Dick Porter  <dick@ximian.com>
11627         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
11628         Solaris needs the same workaround as BSD-derived systems.  Fixes
11629         bug 323524, patch by Burkhard Linke
11630         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
11632 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
11634         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
11635         handle to use when error dialog is shown; otherwise, update mask
11636         to show no error dialog when an error occurs.
11638 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
11640         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
11642         * class.c (mono_class_get_field_default_value): New helper function to initialize
11643         field->def_type and field->data.
11645 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
11647         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
11648         the general one.
11650         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
11652         * marshal.c: Avoid depending on delegate->method_info being set.
11654         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
11655         
11656         * object.c (mono_delegate_ctor): Set delegate->method.
11658         * object-internals.h (struct _MonoDelegate): Add 'method' field.
11660         * appdomain.c: Bump corlib version.
11662 2007-11-27  Raja R Harinath  <harinath@gmail.com>
11664         * metadata.c (mono_generic_inst_equal_full): Short-circuit
11665         equality check if we're comparing canonicalized MonoGenericInsts.
11667 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
11669         * class.c (generic_array_methods): Call mono_class_setup_methods () before
11670         accessing class->methods.
11672 2007-11-22  Dick Porter  <dick@ximian.com>
11674         * threads.c: Ensure that the synch_cs is set before trying to use
11675         it.
11677 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
11679         * profiler.c: r89126 broke the statistial profiler, unbreak.
11681 2007-11-22  Martin Baulig  <martin@ximian.com>
11683         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
11685         * mono-debug.c
11686         (mono_debug_debugger_version): Bump to 3.
11687         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
11688         -> mono_debugger_class_initialized().
11690         * mono-debug-debugger.c
11691         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
11693         * class.c
11694         (mono_debugger_start_class_init_func): Removed.
11695         (mono_debugger_class_loaded_methods_func): Added.
11696         (mono_class_setup_methods): Call it here.
11698 2007-11-22  Martin Baulig  <martin@ximian.com>
11700         * mono-debug.c
11701         (mono_debug_add_delegate_trampoline): New public method.
11702         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
11704         * mono-debug.h
11705         (MonoSymbolTable): Added `global_data_table'.
11706         (MonoDebuggerTypeKind): Removed.
11708 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
11710         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
11711         these methods.
11713         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
11714         
11715 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
11717         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
11719 2007-11-20  Martin Baulig  <martin@ximian.com>
11721         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
11723         * mono-debug-debugger.c
11724         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
11725         (mono_debugger_remove_breakpoint): Likewise.
11726         (mono_debugger_check_breakpoints): Likewise.
11727         (mono_debugger_register_class_init_callback): New public method.
11728         (mono_debugger_remove_class_init_callback): Likewise.
11729         (mono_debugger_add_type): Likewise.
11731         * mono-debug-debugger.h
11732         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
11734 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
11736         * class.c: more interface implementations needed for the
11737         array enumerator (fixes bug #341112).
11739 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
11741         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
11742         fix ParamName of ArgumentNullExceptions.
11744 2007-11-17  Miguel de Icaza  <miguel@novell.com>
11746         * reflection.c (mono_reflection_encode_sighelper): Generate the
11747         modopts and modreqs.   I have a useless test that crashes monodis,
11748         but that shows the code working.
11750 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
11752         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
11753         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
11755 2007-11-15  Dick Porter  <dick@ximian.com>
11757         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
11758         When joining a thread, it's the thread that's calling Join that
11759         gets WaitSleepJoin state not the target.  Fixes the standalone
11760         test case in bug 334740, and hopefully the whole bug too.
11762 2007-11-15  Dick Porter  <dick@ximian.com>
11764         * process.c: Read file version info from the files pointed at by
11765         process modules, not the current process.  Fixes bug 315969.
11767         Use windows typedef names in some places to fix warnings on the
11768         windows build.
11770 2007-11-15  Mark Probst  <mark.probst@gmail.com>
11772         * image.c, metadata-internals.h: Added a generic_class_cache hash
11773         to MonoImage for looking up generic classes when sharing generics.
11775 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
11777         * sgen-gc.c: warning cleanups.
11779 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
11781         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
11782         inherited properties.
11784 2007-11-14  Mark Probst  <mark.probst@gmail.com>
11786         * object.c, class-internals.h: Added more information to the
11787         runtime generic context.
11789 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
11791         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
11792         instead of just the target method. Generalize the abstract method handling to
11793         handle any non-static method.
11795         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
11796         mono_marshal_get_delegate_invoke () signature change.
11798 2007-11-13  Mark Probst  <mark.probst@gmail.com>
11800         * class.c, class-internals.h: Made
11801         mono_type_get_basic_type_from_generic () public.  Fixed member
11802         access check for shared generics.
11804         * loader.c: Don't insert field into field cache if it's part of a
11805         non-inflated generic class.
11807         * domain.c, domain-internals.h: The generic sharing context is now
11808         part of the jit info data structure.  Added two accessor
11809         functions.
11811 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
11813         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
11814         the array Get/Set/Address methods, since the JIT inlines them.
11816         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
11818         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
11819         (mono_image_init): Initialize runtime_invoke_direct_cache.      
11821         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
11822         mono_marshal_get_delegate_invoke signature change.
11824         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
11825         an additional argument. Add support for invoking abstract methods.
11827         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
11829         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
11831 2007-11-09  Mark Probst  <mark.probst@gmail.com>
11833         * class.c: Do field layout for open generic classes as well.
11835 2007-11-09  Mark Probst  <mark.probst@gmail.com>
11837         * gc.c, gc-internal.h: Don't finalize threadpool threads with
11838         other objects, because the threadpool is still around.  Put them
11839         in a list instead and after finalizing all other objects in the
11840         root domain shut down the thread pool and then finalize the
11841         threads.  Fixes bug #337383.
11843         * threads.c, thread-types.h: New mono_thread_create_internal()
11844         function for marking a thread with the threadpool flag before it
11845         started.  Set synch_cs to NULL after freeing it.
11847         * threadpool.c: Mark threadpool threads before they start.
11849 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
11851         * reflection.h, reflection.c: don't export random functions
11852         and lazy load dbnull and missing objects.
11854 2007-11-07  Jonathan Chambers <joncham@gmail.com>
11856         * class.c: Initialize COM types if COM interfaces
11857         are present (not just COM classes).
11858         
11859         Code is contributed under MIT/X11 license.
11861 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
11862         * reflection.c:
11863         create_dynamic_mono_image: hook module profiler events (dynamic case).
11864         mono_image_basic_init: hook assembly profiler events (dynamic case).
11866 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
11867         * profiler.c:
11868         simple_appdomain_unload: completely terminate the profiler
11869         instead of only processing the statistical samples.
11870         simple_shutdown: make sure this is really called exactly once,
11871         even in multithreaded applications, and always listen to
11872         appdomain events.
11873         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
11874         here, the "[un]load" functions will do it.
11875         Fixes bugs #333791 and #325261.
11877 2007-11-07  Geoff Norton  <gnorton@novell.com>
11879         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
11880         rather than depend on __APPLE__.
11882 2007-11-07  Mark Probst  <mark.probst@gmail.com>
11884         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
11886 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
11888         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
11889         UTF16 MonoString. Fix the crash from bug #335488
11891 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
11893         * marshal.c: Correct (for non-Win32 OS) length != size in 
11894         mono_string_from_bstr. Fix #339530.
11896 2007-11-06  Geoff Norton  <gnorton@novell.com>
11898         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
11899         to succeed
11901 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
11903         * process.c: Added run-time GetProcessId API detection for Windows.
11905 2007-11-04  Miguel de Icaza  <miguel@novell.com>
11907         * reflection.c  (mono_param_get_objects): If a parameter has the
11908         attribute [System.Runtime.InteropServices.Optional] we should
11909         set the DefaultValue of the ParameterInfo to be
11910         System.Reflection.Missing instead of DBNull.
11912         See bug #339013.
11914         (mono_get_reflection_missing_object): New method,
11915         returns the System.Reflection.Missing.Value singleton instance.
11917 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
11919         * culture-info-table.h : regenerated.
11921 2007-11-02  Jonathan Chambers <joncham@gmail.com>
11923         * icall.c: Use GetEnvironmentStrings on windows
11924         so we are using the same environment block as 
11925         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
11926         #333740.
11927         
11928         Code is contributed under MIT/X11 license.
11930 2007-10-31  Martin Baulig  <martin@ximian.com>
11932         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
11934         * mono-debug-debugger.h
11935         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
11937 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
11939         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
11940         classes.
11942 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
11944         * culture-info-table.h : regenerated.
11946 2007-10-30  Robert Jordan  <robertj@gmx.net>
11948         * icall-def.h, icall.c:
11949         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
11951         Code is contributed under MIT/X11 license.
11953 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
11955         * class.c (mono_class_setup_vtable): Find the inflated methods in the
11956         inflated class instead of inflating them again.
11957         
11958         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
11959         dynamic case.
11961         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
11962         Call setup_supertypes () after klass->parent is set.
11963         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
11965         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
11966         for inflated instances of not yet created dynamic generic classes.
11967         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
11968         times from inflated_method.
11969         (methodbuilder_to_mono_method): Ditto.
11971 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
11973         * gc.c: code cleanup and removed old untested option of not creating the
11974         finalizer thread.
11976 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
11978         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
11979         creating a jump trampoline for dynamic methods.
11981 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
11983         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
11984         generic TypeBuilders when called from another method of the same type (bug #335131).
11987 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
11989         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
11990         doesn't seem to work perfectly.
11991         
11992         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
11993         called multiple times.
11994         (methodbuilder_to_mono_method): Ditto.
11995         (resolve_object): Inflate FieldBuilder's.
11997 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
11999         * string-icalls.c, string-icalls.h, appdomain.c: patch from
12000         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
12001         RemoveEmptyEntries in the string.Split implementation (bug #322375).
12003 2007-10-26  Dick Porter  <dick@ximian.com>
12005         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
12006         Thread initialisation changes
12008 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
12010         * verify.c: fix compatibility check between arrays and System.Array
12012 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
12014         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
12015         too. Fixes #336999.
12017 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
12019         * object.c (mono_value_box): Use typed allocation here.
12021 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
12023         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
12024         trampoline instead of compiling the method right away.
12026         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
12028 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
12030         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
12031         related fields for dynamic classes. Fixes #334493.
12033 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
12035         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
12036         
12037         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
12039         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
12040         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
12042         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
12044         * reflection.c (create_generic_typespec): Initialize klass->generic_container
12045         if needed.
12046         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
12048 2007-10-18  Jonathan Chambers <joncham@gmail.com>
12050         * marshal.c: Use correct key when removing item
12051         from ccw_hash.
12052         
12053         Code is contributed under MIT/X11 license.
12055 2007-10-17  William Holmes  <billholmes54@gmail.com>
12057         *marshal.c: Adding a case to marshal booleans to U1
12059         Code is contributed under MIT/X11 license.
12061 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
12063         * class.c (mono_class_from_name): Search the modules compromising dynamic
12064         assemblies. Fixes #331601.
12066 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
12068         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
12069         exception if the type name contains an assembly component. Fixes #334203.
12071         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
12072         modules inside dynamic assemblies. Fixes #334200.
12073         
12074         * reflection.c: Set image->public_key and image->public_key_length;
12076         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
12077         fields.
12079         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
12080         
12081 2007-10-16  Mark Probst  <mark.probst@gmail.com>
12083         * metadata.c: Implemented correct comparing of generic classes.
12084         An inflated generic class can be equal to a non-inflated one if it
12085         is inflated with generic type variables as type arguments.  Fixes
12086         bug #333798.
12088 2007-10-15  Dick Porter  <dick@ximian.com>
12090         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
12091         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
12092         81646.
12094         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
12095         instead of a monitor lock.  This means that monitor_try_enter and
12096         co can set the thread state safely.
12097         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
12098         thread_interrupt_requested, so interrupt actually works.
12100         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
12101         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
12102         state accessor function
12104 2007-10-15  Martin Baulig  <martin@ximian.com>
12106         * mono-debug.h
12107         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
12108         the debugger with the current runtime.
12110 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
12112         * object.c, object-internals.h: added the ability to set a single
12113         trampoline for all the slots in a vtable.
12115 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12117         * marshal.c: deal with a possible race condition during multicast
12118         delegate invocation.
12120 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12122         * class.c: ensure value type methods don't have the synchronized
12123         flag set.
12125 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
12127         * string-icalls.c, string-icalls.h: reverted unapproved patch that
12128         breaks the build.
12130 2007-10-11  Joel Reed  <joelwreed@comcast.com>
12132         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
12133         to take an options parameter so that empty entries can be removed during
12134         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
12136 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12138         * marshal.c: make sure we don't store the signature from a dynamic
12139         method into the runtime invoke cache (bug #327189).
12141 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12143         * marshal.c: make sure the wrapper methods are properly initialized.
12145 2007-10-11  Mark Probst  <mark.probst@gmail.com>
12147         * metadata.c, metadata-internals.h: Generalized
12148         mono_type_stack_size() to mono_type_stack_size_internal() which
12149         takes an additional argument specifying whether it allows open
12150         types.
12152 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
12154         * verify.c (do_invoke_method): handle typedbyref params
12155         correctly and check for unverifiable return values.
12157         * verify.c (do_newobj): fix a warning.
12159 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
12161         * verify.c: don't tread typedbyref as allways unverifable,
12162         so uses, like (ld/st)loc.0 are valid. verify for the cases
12163         that it matters, like boxing related operations.
12165 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
12167         * verify.c: add verification of the newobj opcode. verification
12168         of delegate instantation still missing due ldftn and virldftn not
12169         pushing the function type on stack
12171 2007-10-08  Mark Probst  <mark.probst@gmail.com>
12173         * class-internals.h: Runtime generic context data structure
12174         definition.
12176         * object.c: Initialization of runtime generic context at runtime
12177         vtable creation time.
12179 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
12180         * class.c (mono_class_create_from_typedef,
12181         mono_class_from_generic_parameter, mono_ptr_class_get,
12182         mono_fnptr_class_get, mono_bounded_array_class_get)
12183         * domain.c (mono_domain_create, mono_domain_free)
12184         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
12185         * image.c (do_mono_image_load, mono_image_close):
12186         Hooked up load-unload profiler events.
12188 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
12190         * domain.c: track statistics about the actual amount of native code
12191         allocated.
12193 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
12195         * class.c: the valuetype enumerators don't have the additional
12196         supertypes interfaces.
12198 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12200         * class.c: need more interfaces setup for the IEnumerator<T>
12201         object created for arrays (tests/ienumerator-interfaces.2.cs).
12203 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
12205         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
12207 2007-10-05  Alp Toker  <alp@atoker.com>
12209         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
12210         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
12211         #315863.
12213 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
12215         * verify.c (verify_type_compatibility_full): verification of
12216         compatibility improved, validates correctly non-strict checks between
12217         native int and I4 types different than (unsigned)int32.
12219         * verify.c (do_store_indirect): added, do all verification of
12220         ldind.X opcodes. 
12222         * verify.c (get_load_indirect_mono_type): renamed to
12223         get_indirect_op_mono_type, as it now returns the MonoType for 
12224         ldind.X and stind.X opcodes.
12226 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
12228         * reflection.c: Fix the encoding of generic type definition for
12229         TypeBuilders.
12231         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
12232         mono_image_typedef_or_ref but allows to specify if typespec lookups should
12233         be made. Typespec check is done prior to typeref cache lookup.
12235         * reflection.c (mono_image_typedef_or_ref): now just delegate to
12236         mono_image_typedef_or_ref_full.
12238         * reflection.c (encode_generic_class): encode the generic class
12239         directly instead of calling encode_type.
12241         * reflection.c (encode_type): encode the generic type definition
12242         MonoClass as a generic instantiation.
12244         * reflection.c (create_typespec): cache typespec tokens in
12245         the assembly->typespec cache. Don't create typespec for a generic
12246         instance MonoClass. Create typespec for the generic type defintion.
12248         * reflection.c (create_generic_typespec): encode the generic
12249         class directly instead of calling encode_type.
12251         * reflection.c (mono_image_create_token): encode the generic
12252         type definition not using a typespec for MonoType instances.
12255 2007-10-04  Raja R Harinath  <rharinath@novell.com>
12257         Fix #328812
12258         * class.c (mono_image_init_name_cache): Don't return nested
12259         'protected internal' classes.
12260         (mono_class_from_name_case): Likewise.
12262 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
12264         * icall-def.h, icall.c : get_bundled_machine_config() is now the
12265           common function used by both DefaultConfig in System.dll and
12266           InternalConfigurationHost in System.Configuration.dll.
12268 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12270         * class.c: automatically add to vectors only a few essential explicit
12271         generic interfaces. The rest of the interfaces that arrays should
12272         provide are currently implicitly added (but still not lazily, see the
12273         design in the discussion of bug#325495 for the details of what is
12274         needed for that). Additionally, implicit interfaces are assigned the
12275         same vtable slot as the explicit interfaces (as they are compatible):
12276         this enables huge memory savings since we don't need to instantiate
12277         as many memthods and as large vtables anymore. Also, Since
12278         GetEnumerator<T> returns an instance of a type that is required to
12279         support a similarly large set of interfaces as arrays, we add
12280         implicit interfaces and interface offset sharing support to those
12281         types, too. This change adds all the required interfaces so that
12282         the anonarray.cs test case in the bug report works (we don't add
12283         all the interfaces to arrays of arrays 3-level deep and more because
12284         of the memory requirements explained in the bug and since they are much
12285         less common: the lazy-loading support will enabled them to work, too).
12287 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
12289         * verify.c (merge_stacks): major clean up, all type compatibility
12290         checks are done by verify_type_compatibility. This fix my earlier lack
12291         of understanding of the CLR type system and merge_stacks no longer looks
12292         scary.
12294         * verify.c: fixed some bad spelling.
12296 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
12298         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
12299         a given stack slock.
12300         
12301         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
12302         verify_type_compatibility_full. This removed a near indentical function and fixed
12303         handling of Int32 and IntPtr across all opcodes.
12305 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
12307         * class.c: only vectors have the additional generic interfaces.
12309 2007-10-01  Jonathan Chambers <joncham@gmail.com>
12311         * mono-config.c: Use g_strcasecmp instead of
12312         strcasecmp like everywhere else to fix
12313         compilation with MSVC.
12314         
12315         Code is contributed under MIT/X11 license.
12317 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12319         * object.c, object-internals.h: refactored the IMT code to enable
12320         building a single slot at a time and lazily creating the IMT trampolines
12321         and thunks.
12323 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
12325         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
12327         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
12328         Fixes #328501.
12329         
12330 2007-09-29  Raja R Harinath  <harinath@gmail.com>
12332         * loader.c (method_from_methodspec): Rearrange to avoid
12333         un-necessary exposition.  Don't assert out if the method's
12334         declaring type is a generic type definition.
12336 2007-09-28  Martin Baulig  <martin@ximian.com>
12338         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
12340 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
12342         * class-internals.h: optimize field layout of MonoClass to
12343         requires less cachelines at runtime and save a few bytes on 64 bit
12344         systems.
12346 2007-09-28  Jb Evain  <jbevain@novell.com>
12348         * reflection.c: when encoding type names in custom attributes,
12349         if the type is a closed generic type, its generic arguments
12350         have to be serialized as AssemblyQualifiedName, so that when
12351         they are deserialized, it's possible to re-create them properly.
12352         Fixes #329450.
12355 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
12357         * object.c, class-internals.h: added delegate-creation counter.
12359 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
12361         * class.c: cleanup of the code that synthetizes interfaces for
12362         arrays in 2.0: saves quit a bit of corlib mempool memory.
12363         Code to fix bug #325495 ifdeffed out for now until the issues
12364         with memory usage and O(n^2) behaviour are fixed.
12366 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
12368         * marshal.c: when possible, do not duplicate the name of the methods
12369         in the method builder and in the generated MonoMethod.
12371 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
12372         * verify.c: added support for type checking ldind_* opcodes.
12374 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
12376         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
12377         which is used to distinguish the fully open instantiation of a TypeBuilder
12378         with the rest. This temporary hack is required to restore the property that
12379         the fully open instantiation is the same type of the generic type definition.
12381         * class-internals.h (mono_generic_class_is_generic_type_definition):
12382         new function as part of the internal API.
12384         * class.c (inflate_generic_type): return NULL when the generic inst is
12385         fully open. The fully open generic type is now the same as the generic type
12386         definition for non TypeBuilder types.
12388         * class.c (mono_generic_class_get_class): removed assert since it is
12389         no longer valid, gklass->cached_class can point to the generic type definition.
12391         * class.c (mono_generic_class_is_generic_type_definition): new.
12393         * metadata.c (mono_generic_class_hash): added is_tb_open field
12394         to the hash calculation.
12396         * metadata.c (free_generic_class): if the generic class is associated
12397         with the generic type definition, its field will come from the mempool and
12398         must not be freed.
12400         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
12401         new, this function identifies the corner case of a TypeBuilder fully open
12402         instantiation.
12404         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
12405         for lookup. Set gclass->cached_class to be the container class in case of
12406         the fully open instantiation of non TypeBuilder types.
12408         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
12409         to compare generic classes.
12411         * reflection.c (method_encode_methodspec): remove assert that
12412         no longer is valid.
12414         * reflection.c (mono_reflection_generic_class_initialize): add
12415         an aditional assert to ensure the proper type is used.
12417 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
12419         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
12420         to enjoy it.
12422 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
12424         * verify.c (push_arg): Fixed support for ldarga
12425         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
12426         MonoType used as first arg in case of instance calls.
12428 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
12430         * verify.c: Support for verifying VAR and MVAR types, 
12432 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
12434         * icall.c (ves_icall_get_property_info): Set the reflected type of the
12435         accessors correctly.
12437 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
12439         * threads.c: support OSX and other systems in
12440         mono_thread_get_stack_bounds (bug #328026).
12442 2007-09-25  Martin Baulig  <martin@ximian.com>
12444         * mono-debug.h
12445         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
12447 2007-09-24  Martin Baulig  <martin@ximian.com>
12449         * mono-debug.h
12450         (MonoDebugClassEntry): Moved the definition of this struct into
12451         mono-debug.c to make it private.
12453         * mono-debug.c
12454         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
12455         type table per symbol file, we don't need to store the symfile id
12456         any longer.
12458 2007-09-24  Martin Baulig  <martin@ximian.com>
12460         Create one type table per symbol file, since a `MonoClass *' gets
12461         invalid when its image is unloaded.
12463         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
12464         (MonoDebugHandle): Added `type_table'.
12466 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
12468         * mempool.c, mempool.h: added mono_mempool_new_size () API
12469         to be able to specify a smaller initial size for the pool.
12470         Adjusted the code to slowly increase pool size before using
12471         the previous default size.
12472         * image.c: use a small initial size for image mempools.
12474 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
12476         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
12477         Fixes ##320990.
12479         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
12480         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
12482 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
12484         * metadata.c (mono_type_create_from_typespec): Remove an invalid
12485         free. Fixes #327438.
12487 2007-09-21  Raja R Harinath  <harinath@gmail.com>
12489         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
12490         generic instantiations, etc.
12491         <MONO_TYPE_ARRAY>: Likewise.
12493 2007-09-21  Martin Baulig  <martin@ximian.com>
12495         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
12496         these structs were never defined.
12497         (MonoDebugHandle): Removed the `_priv' field, it was never used.
12499 2007-09-21  Martin Baulig  <martin@ximian.com>
12501         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
12503 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
12505         * image.c: removed the guid hash tables: we can get the same info
12506         without the additional memory usage hit (partially fixes also bug #327052).
12508 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
12510         * profiler.h, profiler-private.h, profiler.c: add a new profiler
12511         event to handle unloading methods. After the event is called, the
12512         corresponding MonoMethod* must be considered invalid.
12513         * loader.c (mono_free_method): call the new mono_profiler_method_free
12514         event.
12516 2007-09-20  Mark Probst  <mark.probst@gmail.com>
12518         * domain-internals.h: New flag in MonoJitInfo which marks shared
12519         generic methods.  New hash table (shared_generics_hash) in
12520         MonoDomain to keep track of shared generic methods.  Prototypes
12521         for functions to register and lookup shared generic methods.
12523         * domain.c: Support for registering and looking up shared generic
12524         methods via a hash table (shared_generics_hash) in MonoDomain.
12526         * class-internals.h: New exception to signal failure of shared
12527         compilation of a generic method.  New counters for generics
12528         sharing in MonoStats.
12530 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
12532         * image.c, metadata-internals.h: don't keep a file descriptor open
12533         for loaded assemblies (bug#325988).
12535 2007-09-19  Raja R Harinath  <rharinath@novell.com>
12537         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
12538         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
12539         use the corresponding datatypes.
12540         (type_in_image): Update to changes.
12541         (CleanForImageUserData): Simplify.
12542         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
12543         Avoid quadratic behaviour in handling the "stolen" list by
12544         separating the filter predicate out, and by prepending the stolen
12545         items rather than appending them.
12546         (steal_ginst_in_image): Likewise.
12547         (mono_metadata_clean_for_image): Update to changes.
12549 2007-09-19  Martin Baulig  <martin@ximian.com>
12551         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
12553 2007-09-19  Martin Baulig  <martin@ximian.com>
12555         * mono-debug.c (mono_debug_cleanup): Don't call
12556         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
12558 2007-09-19  Raja R Harinath  <harinath@gmail.com>
12560         Fix crash on 'make run-test' in mcs/errors
12561         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
12562         Avoid more potential allocations in mono_class_from_mono_type.
12563         (ginst_in_image): Update to changes.
12564         (gclass_in_image): Rearrange slightly.
12566 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
12568         * class.c (mono_class_init): Move the code that sets up class->methods to 
12569         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
12571         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
12572         canonical instance of an inflated generic signature.
12573         (mono_type_create_from_typespec): Remove an invalid free.
12575         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
12577 2007-09-18  Marek Habersack  <mhabersack@novell.com>
12579         * domain-internals.h: added a declaration of the
12580         mono_assembly_load_full_nosearch internal function.
12582         * assembly.c (mono_assembly_load_with_partial_name): use
12583         mono_try_assembly_resolve return value properly.
12584         (mono_assembly_load_full_nosearch): copied the function body from
12585         mono_assembly_load_full, without the code to invoke assembly
12586         search hooks.
12587         (mono_assembly_load_full): calls the above new function and if the
12588         assembly is not resolved, invokes the search hooks.
12590         * appdomain.c (mono_runtime_init): restore the global postload
12591         assembly search handlers.
12593 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
12595         * class.c (mono_class_init): Make sure class->methods and class->properties
12596         are never NULL in the generics case.
12598         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
12600 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
12602         * metadata.c (free_generic_class): Disable some code to fix the build.
12604         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
12606         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
12607         from the image mempool.
12609         * metadata.c (free_generic_class): Free more data from the inflated class.
12611         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
12613         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
12614         mempool.
12615         (mono_type_create_from_typespec): Ditto.
12617         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
12618         MonoImage to the caller.
12619         (mono_init_internal): Save the opened image in a global variable.
12620         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
12622         * reflection.c (resolve_object): Fix a leak.
12624         * metadata.c: Fix the freeing of data in the generics caches.
12625         
12626         * metadata.c (free_generic_inst): Comment this out to fix the build.
12627         (free_generic_class): Ditto.
12629         * metadata.c: Free cached generic methods, instantinations and classes when
12630         they are removed from the caches.
12631         (mono_metadata_free_type): Free the type itself.
12633         * class.c: Free the result of mono_class_inflate_generic_type () in a few
12634         places.
12636 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12638         * boehm-gc.c: restrict managed allocs to __thread supporting
12639         architectures.
12641 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
12643         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
12644         (mono_generic_class_get_class): Fix a leak.
12646         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
12647         mono_metadata_free_type ().
12648         (mono_metadata_inflate_generic_inst): Fix a leak.
12650 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
12652         * mono-debug.c (free_header_data): Fix a leak missed earlier.
12654         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
12655         mempool.
12657         * mono-debug.c (mono_debug_close_image): Fix call to 
12658         g_hash_table_remove ().
12660 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
12662         * icall-def.h: redirect all the string ctor to the managed
12663         CreateString () methods.
12664         * string-icalls.c, string-icalls.h: removed dead code for string
12665         ctors and icalls.
12667 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
12669         * mono-debug.c: Fix memory leaks.
12671 2007-09-14  Jonathan Chambers <joncham@gmail.com>
12673         * threads-types.h: Implement mono_hazard_pointer_set and 
12674         mono_hazard_pointer_clear macros using do/while(0) to fix
12675         compilation with MSVC.
12676         
12677         Code is contributed under MIT/X11 license.
12679 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
12681         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
12682         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
12684 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12686         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
12687         icalls.
12689 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12691         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
12692         managed-code allocated as well.
12694 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
12696         * class.c (mono_class_is_assignable_from): Add support for generic variance.
12698 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
12700         * boehm-gc.c: fixed the build after the AOT changes.
12702 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
12704         * wrapper-types.h: Add an ALLOC wrapper type.
12706         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
12707         reference managed allocator methods.
12709 2007-09-12  Marek Safar  <marek.safar@gmail.com>
12711         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
12712         of Type array and not MonoType, a fix suggested by Hari.
12713         
12714 2007-09-12  Jonathan Chambers <joncham@gmail.com>
12716         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
12717         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
12718         
12719         Code is contributed under MIT/X11 license.
12721 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
12723         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
12725 2007-09-12  Marek Habersack  <mhabersack@novell.com>
12727         * image.c (do_mono_image_open): if assembly file fails to open and
12728         MONO_IOMAP is in effect, try to find the path in a
12729         case-insensitive way.
12731         * appdomain.c (mono_runtime_init): do not install postload hooks -
12732         tests show that MS.NET doesn't use anything of that sort to
12733         trigger the AppDomain.AssemblyResolve event.
12734         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
12735         made non-static.
12736         (mono_runtime_init): init portability helpers here.
12738         * assembly.c (mono_assembly_load_with_partial_name): if other   
12739         attempts fail, trigger the AppDomain.AssemblyResolve event handler
12740         to resolve the assembly.
12742         * domain-internals.h: added mono_try_assembly_resolve and marked
12743         it as internal.
12745 2007-09-11  Jb Evain  <jbevain@novell.com>
12747         * object-internals.h (MonoReflectionDynamicMethod): add
12748         a `MonoReflectionType *owner` field. The owner is used
12749         * reflection.c:
12750         (mono_reflection_create_dynamic_method): use the owner of the dynamic
12751         method as the class declaring the dynamic method.
12752         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
12753         dynamic method to the declaring type of the methodbuilder.
12755 2007-09-11  Mark Probst  <mark.probst@gmail.com>
12757         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
12758         rules for calling methods via reflection.
12760 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
12762         * reflection.c (resolve_object): Add support for MonoGenericClass. 
12763         Inflate MonoType's.
12765 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
12767         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
12768         provide a managed method that does fast allocations without needing
12769         a managed->unmanaged transition. Boehm GC implementation currently
12770         enabled for ptrfree objects on sane architectures.
12772 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
12774         * marshal.c, marshal.h: exported a couple of useful functions and
12775         added mono_mb_get_label () to easily handle backward branches.
12777 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
12779         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
12781 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
12783         * loader.c (find_method): Fixed the regression introduced while
12784         fixing bug #81466.
12786 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
12788         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
12789         well.
12790         
12791         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
12792         icall.c reflection.c: Pass a MonoGenericContext argument to 
12793         mono_lookup_dynamic_token ().
12795         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
12796         #82744.
12797         
12798 2007-09-09  Robert Jordan  <robertj@gmx.net>
12800         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
12801         for generic methods.
12803         * object.c (mono_object_get_virtual_method): Handle generic methods.
12804         Fixes bug #78882.
12806         Code is contributed under MIT/X11 license.
12808 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
12810         * image.c: fix locking in mono_image_load_file_for_image ().
12812 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
12814         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
12815         used only as a cache: added an icall to fill it.
12817 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
12819         * reflection.h: exposed mono_reflection_free_type_info
12820         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
12821         since mono_reflection_bind_generic_parameters makes a copy of it.
12822         * reflection.c (free_type_info): subinfos should be freed.
12823         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
12824         made non static.
12825         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
12826         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
12827         this fixes #82695 and #81726.
12828    
12830 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
12832         * process.h, process.c:  added support for user profile/info in
12833           ProcessStartInfo. For now only Windows works.
12835 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12837         * metadata.c: consider the generic arguments when comparing
12838         signatures (bug #82614).
12840 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
12842         * cil-coff.h, image.c: updated assembly loader to cope with the
12843         PE32+ 64 bit file format.
12845 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
12847         * assembly.c, class.c, domain.c, loader.c: remove useless
12848         inclusion of cil-coff.h.
12850 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
12852         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
12853         if interface is marked with CoClassAttribute. 
12854    
12855         Code is contributed under MIT/X11 license.
12857 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12859         * sgen-gc.c: ensure no object from the to space is copied again or finalized
12860         if it's seen twice in major collections.
12862 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
12864         * sgen-gc.c: big objects are not copied to the gray area, but they
12865         need to be considered for scanning, too, if they are brought alive
12866         by an object ready for finalizations or a survived one.
12868 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12870         * sgen-gc.c: properly account the number of disappearing links when
12871         they are nullified.
12873 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
12875         * sgen-gc.c: share the code to scan the registered roots between the
12876         different types of collections.
12878 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
12880         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
12882 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
12884         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
12885         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
12887 2007-08-28  Mark Probst  <mark.probst@gmail.com>
12889         * security-manager.c (mono_security_manager_get_methods):
12890         LinkDemandSecurityException now has 2 arguments instead of 3.
12892 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
12894         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
12895         platforms which need it.
12897 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
12899         * sgen-gc.c: unregister thread data structures with a pthread_key_t
12900         dtor.
12902 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
12904         * threads.c: free the thread static data on thread exit.
12906 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
12908         * class.c: walk the hierarchy to find the generic definition for
12909         a class (fixes runtime part of bug #82498).
12911 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
12913         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
12914         ...
12916         * image.c (mono_image_close): Here. Hopefully fixes #82510.
12918 2007-08-24  Mark Probst  <mark.probst@gmail.com>
12920         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
12922 2007-08-24  Robert Jordan  <robertj@gmx.net>
12924         * appdomain.c: don't perform the ':'->';' substitution on Win32.
12926 2007-08-24  Jb Evain  <jbevain@novell.com>
12928         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
12929         for byref types.
12931 2007-08-24  Mark Probst  <mark.probst@gmail.com>
12933         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
12934         #82286.
12936 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
12938         * assembly.c: Fix a warning.
12939         
12940 2007-08-23  Marek Habersack  <mhabersack@novell.com>
12942         * appdomain.c: parse the <runtime> section looking for the probing
12943         element with the 'privatePath' attribute, which sets additional
12944         directories in which the runtime should look for assemblies.
12946 2007-08-23  Robert Jordan  <robertj@gmx.net>
12948         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
12949         Fixes #82499.
12951 2007-08-23  Martin Baulig  <martin@ximian.com>
12953         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
12954         _mono_debug_init_corlib() and remove it from the header file.
12956 2007-08-23  Martin Baulig  <martin@ximian.com>
12958         * mono-debug-debugger.c
12959         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
12960         don't notify the debugger about it.
12962         * mono-debug-debugger.h
12963         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
12965 2007-08-23  Robert Jordan  <robertj@gmx.net>
12967         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
12968         Code is contributed under MIT/X11 license.
12970 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
12972         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
12974 2007-08-22  Martin Baulig  <martin@ximian.com>
12976         * mono-debug.c: Store debugging info on a per-domain basis and
12977         free it on domain unload.  Add support for unloading symbol files.
12979         * mono-debug.h
12980         (MonoDebugList): New typedef.
12981         (MonoSymbolTable):
12982         - add `data_tables and `type_table'.
12983         - replace 'symbol_files' and `num_symbol_files' with a
12984           `MonoDebugList *'.
12985         (mono_debug_data_table): Removed.
12986         (mono_debug_list_add): New public function.
12987         (mono_debug_list_remove): New public function.
12988         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
12989         (mono_debug_init_2_memory): Renamed into
12990         mono_debug_open_image_from_memory().
12991         (mono_debug_close_image): New public function.
12992         (mono_debug_domain_create): Likewise.
12993         (mono_debug_domain_unload): Likewise.
12994         (MONO_DEBUGGER_VERSION): Bump to 60.
12996         * mono-debug-debugger.h
12997         (MonoDebuggerEvent):
12998         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
12999         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
13000         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
13001         - rename `THREAD_CREATED' and `THREAD_EXITED' into
13002           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
13003         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
13004           meaning.
13005         (mono_debugger_add_symbol_file): Removed.
13006         (mono_debugger_add_type): Removed.
13007         (mono_debugger_lookup_type): Removed.
13008         (mono_debugger_lookup_assembly): Removed.
13010         * domain.c
13011         (mono_domain_create): Call mono_debug_domain_create().
13012         (mono_init_internal): Call mono_debug_init_corlib().
13014         * assembly.c
13015         (mono_assembly_close): Call mono_debug_close_image().
13017 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
13019         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
13020         mmap call.
13022 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
13024         * sgen-gc.c: ensure section->pin_queue_end is initialized
13025         correctly when non pinning objects in the section have been found.
13027 2007-08-22  Marek Habersack  <mhabersack@novell.com>
13029         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
13030         containing a list of directories separated by ':'. MSDN docs say
13031         the directories should be separated with ';'. Part of a bugfix for
13032         bug #81446
13034 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
13036         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
13037         it should MonoType and not MonoClass.
13039 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
13041         * culture-info-table.h : regenerated.
13043 2007-08-20  William Holmes  <billholmes54@gmail.com>
13045         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
13046          to call ReplaceFile Kernel32 on windows or in io-layer.
13047         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
13048         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
13049          as an internal call.
13051         Code is contributed under MIT/X11 license.
13053 2007-08-20  Jb Evain  <jbevain@novell.com>
13055         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
13056         and MONO_EXCEPTION_FIELD_ACCESS.
13058         * debug-helpers.[c|h]: new mono_field_full_name function.
13060 2007-08-20  Mark Probst  <mark.probst@gmail.com>
13062         * class.c: Removed class_security_level() and moved it to
13063         security-core-clr.c.
13065         * security-core-clr.c, security-core-clr.h: class_security_level()
13066         is now public and renamed to mono_security_core_clr_class_level().
13067         It also looks for security attributes in the classes a class is
13068         nested in.
13070 2007-08-20  Mark Probst  <mark.probst@gmail.com>
13072         * security-core-clr.c, security-core-clr.h: CoreCLR security
13073         utility functions.
13075         * Makefile.am: Added security-core-clr.[ch].
13077         * security-manager.c, security-manager.h: Functions and enum for
13078         setting and getting the security mode.
13080         * class.c: CoreCLR security checks.
13082 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
13084         * icall-def.h, process.c, process.h: implemented icall to get
13085         user/system processor times.
13087 2007-08-17  Mark Probst  <mark.probst@gmail.com>
13089         * domain.c, threads.c, class-internals.h, domain-internals.h: New
13090         reader-lock-free jit_info_table.
13092 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
13094         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
13096         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
13098         * object-internals.h (MonoException): Add missing _data member.
13100 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
13102         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
13103         checking that only methods with matching qname or fqname are picked
13104         from implemented interfaces.
13106 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13108         * verify.c (do_newarr):added, do type verification of
13109         newarr ops, push the right value on the eval stack.
13110         * verify.c (mono_method_verify): use do_newarr
13113 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13115         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
13116         factored the common code into get_boxable_mono_type, which
13117         is now using mono_type_get_full, this fixed byref related tests.
13119 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13121         * class.c: added mono_type_get_full, this function has the same
13122         behavior of mono_class_get_full but the returned MonoType has
13123         all metadata of the associated token in case of a typespec token.
13124         * class.c: added mono_type_retrieve_from_typespec, used by 
13125         mono_type_get_full to retrieve the token type.
13126         * class.c (mono_class_create_from_typespec): changed to use
13127         mono_type_retrieve_from_typespec.
13128         * class.c (mono_ldtoken): changed to use mono_type_get_full
13129         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
13130         * class-internals.h: exported mono_type_get_full for internal use.
13132 2007-08-16  Jb Evain  <jbevain@novell.com>
13134         * domain.c (supported_runtimes): add entry for
13135         the 'moonlight' runtime version.
13137 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13139         * verify.c (mono_method_verify): small typo sliped in.  
13141 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13143         * verify.c (do_unbox_value): added, do type verification of
13144         unboxing ops
13145         * verify.c (mono_method_verify): use do_unbox_value
13148 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13150         * verify.c (dump_stack_value): fixed typo, was printing string
13151         instead of object on stack.
13152         * verify.c (do_box_value): moved the byref check up as it leads
13153         to invalid code and should be done earlier.
13154         * verify.c: improved error messages for and ldobj
13156 2007-08-15  William Holmes  <billholmes54@gmail.com>
13158         * marshal.c (emit_marshal_custom): Omit the call to 
13159           marshal_native_to_managed when calling native to managed 
13160           and the argument is specified as an out argument.
13162         Code is contributed under MIT/X11 license.
13164 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13166         * verify.c: fixed the type checks for generics, function pointers and vectors.
13167         Added type verification for ldobj and ldtoken. The verifier
13168         would segfault if header or signature of a method contained references
13169         to non-existant types.
13171 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
13173         * marshal.c (cominterop_get_ccw): Patch from
13174         Bill Holmes to no walk up interface hierarchy. 
13175         All parent methods should be present in the interface for COM.
13176    
13177         Code is contributed under MIT/X11 license.
13179 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
13181         * marshal.c (emit_marshal_com_interface): Patch from
13182         Bill Holmes to handle COM Interfaces as return values
13183         for native->managed calls.
13184    
13185         Code is contributed under MIT/X11 license.
13187 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
13189         * marshal.c (cominterop_get_idispatch_for_object): Implement
13190         for runtime callable wrappers.
13191    
13192         Code is contributed under MIT/X11 license.
13194 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
13196         * pedump.c (main): changed from mono_init to mono_init_from_assembly
13197         so 2.0 types are accessible
13200 2007-08-13  Miguel de Icaza  <miguel@novell.com>
13202         * domain.c (mono_init_internal): Call mono_assembly_load_friends
13203         once we load mscorlib.   Due to the order in which we initialize,
13204         the mono_assembly_load_full routine that loads mscorlib did not
13205         load friends.   We now load it once we load the
13206         mono_defaults.internals_visible_class class. 
13208         * assembly.c: Expose the mono_load_friend_assemblies method.
13210 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
13212         * verify.c: improved the handling of boxing, better
13213         type checking for unary ops and conversion. Fix bug
13214         regarding managed pointer compatibility checking
13216 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
13218         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
13220         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
13222 2007-08-09  Raja R Harinath  <rharinath@novell.com>
13224         * reflection.c (dup_type): Remove.
13225         * class.c (dup_type): Remove.
13226         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
13227         instead of the dodgy 'dup_type'.
13228         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
13229         handle the case where 'dup_type' needed the second argument.
13231 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
13233         * domain.c: Fix a warning.
13235 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
13237         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
13238         checking that methods with the same fqname are not overridden
13239         with a method from an ancestor.
13241 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
13243         * threads.c (free_thread_static_data_helper): Avoid a crash if
13244         thread->static_data is not yet set.
13246 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
13248         * marshal.c: Use correct image when emitting
13249         native wrapper for COM calls.
13250    
13251         Code is contributed under MIT/X11 license.
13253 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
13255         * icall-def.h, security.c, security.h :
13256           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
13258 2007-08-07  Martin Baulig  <martin@ximian.com>
13260         * mono-debug-debugger.h
13261         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
13263         * domain.c (mono_domain_free): Call
13264         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
13266 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
13268         * verify.c (check_underflow, check_overflow): error message now returns IL offset
13269         * verify.c (in_same_block): code should test if either offset is inside the clauses
13270         * verify.c (mono_method_verify): push the exception into the eval stack of exception
13271         and filter blocks
13273 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
13275         * image.c (mono_image_close): Fix a leak.
13277         * object.c (mono_runtime_invoke_array): Avoid using alloca.
13279         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
13281 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
13283         * domain.c, threads.c, threads-types.h: fix memory retention issue
13284         with thread static variables not being cleared on domain unload.
13285         Reuse thread static slots after domain unload.
13287 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
13289         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
13290         nullable type.
13292         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
13293         now done in mono_runtime_invoke_array.
13295         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
13296         receiver is a nullable type.
13298         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
13299         generic parameter.
13301 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
13303         * marshal.c: Implement COM Objects as return type for 
13304         managed->unmanaged calls. Added Release calls for COM Object
13305         out/return values in managed->unmanaged calls.
13307         Code is contributed under MIT/X11 license.
13309 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
13311         * threads.h, threads-type.h: move the hazard pointer declarations
13312         to the private header.
13314 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
13316         * file-io.c, appdomain.c: memory leak fixes.
13318 2007-08-02  Dick Porter  <dick@ximian.com>
13320         * socket-io.c
13321         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
13322         SO_REUSEADDR setting into io-layer/sockets.c.
13324 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
13326         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
13327         from Object when called on a generic parameter. Fixes #82211.
13329 2007-08-01  Dick Porter  <dick@ximian.com>
13331         * file-io.c (convert_share): Test FileShare values bit-by-bit.
13332         Fixes bug 79250 yet again.
13334 2007-07-30  Martin Baulig  <martin@ximian.com>
13336         Merged the `debugger-dublin' branch.
13338         * mono-debug.h
13339         (MonoDebugDataTable): New typedef.
13340         (MonoDebugMethodAddressList): New typedef.
13341         (MonoDebugWrapperData): Removed.
13342         (MonoDebugSymbolTable): Removed `current_data_table',
13343         `current_data_table_size', `current_data_table_offset'.
13344         (MonoDebugDataItemType): Moved into mono-debug.c.
13345         (MonoDebugMethodJitInfo): Remove `address'.
13346         (mono_debug_data_table): New global variable.
13347         (mono_debug_lookup_method_addresses): New public function.
13348         (mono_debug_find_method): Take a `MonoMethod *', not a
13349         `MonoDebugMethodInfo *'.
13351         * mono-debug.c: Drop support for the old symbol tables.
13353 2007-06-28  Martin Baulig  <martin@ximian.com>
13355         * mono-debug.c (mono_debug_debugger_version): New public variable.
13357 2007-07-31  William Holmes  <billholmes54@gmail.com>
13359         * metadata.c Changed mono_type_create_from_typespec to not insert
13360           the type into the hash map until after
13361           do_mono_metadata_parse_type has completed.
13362         Fixes Bug #82194
13363         Code is contributed under MIT/X11 license.
13365 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
13367         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
13368         generic parameter. Fixes #82211.
13370 2007-07-27  Jb Evain  <jbevain@novell.com>
13372         * pedump.c (dump_metadata, dump_metadata_header): dump
13373         versions contained in the metadata header.
13375 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13377         * threads.c: register small_id_table with the GC.
13379 2007-07-27  Mark Probst  <mark.probst@gmail.com>
13381         * threads.c, threads.h, class-internals.h, object-internals.h:
13382         Hazard pointers, to be used by lock-free parallel algorithms.
13384 2007-07-26  Dick Porter  <dick@ximian.com>
13386         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
13387         routine on non-windows platforms, as I've not managed to think of
13388         a non-kludgy way of doing this.  Finishes off bug 78739.
13390 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
13392         * object.c: properly setup interface_bitmap in proxy vtables.
13394 2007-07-25  Marek Habersack  <mhabersack@novell.com>
13396         * appdomain.c (get_shadow_assembly_location): do not use TickCount
13397         to create unique shadow copy target directories, use the domain's
13398         serial number instead. Each domain gets a unique target directory
13399         that way.
13401         * domain.c (mono_domain_create): added code to increment domain
13402         shadow copy serial number and cache the value in the current
13403         domain structure.
13405         * domain-internals.h (struct _MonoDomain): added a new field -
13406         shadow_serial to hold the serial number used in generation of
13407         shadow-copy directories. This is to make sure that the directory
13408         name is unique for each and every domain created. We avoid a race
13409         condition with overriding assemblies already in use by other app
13410         domains.
13412 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
13414         * class.c (mono_bounded_array_class_get): fixed memory leak when 
13415         binding generic parameters.
13417 2007-07-24  Raja R Harinath  <rharinath@novell.com>
13419         * metadata.c (do_mono_metadata_parse_generic_class): Use
13420         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
13421         error.
13423 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
13425         * loader.c, class-internals.h, reflection.c: removed the per-method
13426         generics hashtable: we use the global one through the call of
13427         mono_class_inflate_generic_method ().
13429 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
13431         * class.c, metadata.c, class-internals.h: introduce yet another
13432         generics global cache for inflated methods (fixes 98% of the perf
13433         issue in bug #81806).
13435 2007-07-23  Raja R Harinath  <rharinath@novell.com>
13437         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
13438         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
13439         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
13440         return a MonoGenericInst containing (a copy) of those types.
13441         (mono_metadata_inflate_generic_inst): Update to changes.
13442         (mono_metadata_parse_generic_inst): Likewise.
13443         (mono_get_shared_generic_inst): Likewise.
13444         * reflection.c (mono_class_bind_generic_parameters): Likewise.
13445         (mono_reflection_bind_generic_method_parameters): Likewise.
13446         * metadata-internals.h: Likewise.
13447         * icall.c (free_generic_context): Kill.
13448         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
13450         * reflection.c (reflection_methodbuilder_to_mono_method): Use
13451         mono_metadata_type_dup.
13452         * marshal.c (mono_mb_create_method): Likewise.
13454         * metadata.c (mono_metadata_type_dup): Rename from
13455         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
13456         MonoImage.  Handle a few more cases, esp. when no mempool is given.
13457         * marshal.c, metadata-internals.h: Update to changes.
13459 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13461         * class.c: fixed a small leak for array classes and removed warning.
13463 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
13465         * loader.c (mono_method_get_param_token): Make this work on generic methods.
13466         Return 0x8000000 for return parameters. Fixes #82161.
13468 2007-07-21  Marek Habersack  <grendello@gmail.com>
13470         * appdomain.c (get_shadow_assembly_location): append the current
13471         ticks value to the path. Avoids overwriting the same assemblies by
13472         several threads at the same time.
13474 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
13475         and Raja R Harinath  <rharinath@novell.com>
13477         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
13478         Simplify slightly.
13479         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
13480         property for testing if a method is a generic method definition.
13482 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
13484         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
13486 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13488         * verify.c: used function from private branch, reverted to the one in class.h 
13490 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13492         * verify.c: a typo slipped in and the code wont compile
13494 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13496         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
13497         disabled box instruction as it is doing the wrong thing
13498         improved stack dump messages, now it is easier to debug type related issues
13501 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
13503         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
13505 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13507         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
13508         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
13509         grouped with class and valuetype. This change will simply 
13510         the code as it should be handled just like unmanaged pointers.
13512 2007-07-19  Mark Probst  <mark.probst@gmail.com>
13514         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
13516 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13518         * verify.c: several stack merge issues fixed, reference comparisons now
13519         check the type size. strict type check now works correctly.
13520         added more uses of IS_MANAGED_POINTER macro.
13521         fixed issues pointed by running the test suite against .net.
13522         
13524 2007-07-19  Mark Probst  <mark.probst@gmail.com>
13526         * class.c, loader.c, class-internals.h: Removed the
13527         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
13528         defines.
13530         * icall.c: Better error checking in some internal reflection
13531         methods.
13533 2007-07-18  William Holmes  <billholmes54@gmail.com>
13535         * filewatcher.c : removed unused variable 'filename' in 
13536           ves_icall_System_IO_FSW_SupportsFSW
13538 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
13540         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
13541         obsolete, removed.
13543 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
13545         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
13546         
13547         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
13549 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
13551         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
13552         Implement generics support.
13553         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13555         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
13556         type_args and method_args arguments.
13557         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
13558         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13559         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
13561 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
13563         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
13564           It adds a rootimage parameter to mono_reflection_get_type_internal,
13565           adds new function mono_reflection_get_type_with_rootimage and use
13566           the rootimage to resolve the types instead of the current image
13568 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
13570         * culture-info-table.h: Forgot to update after r78304.
13572 2007-07-13  Raja R Harinath  <rharinath@novell.com>
13574         * class.c (mono_class_is_open_constructed_type)
13575         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
13577 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
13579         * class.c (mono_bounded_array_class_get):  method fails if used with
13580         an incomplete TypeBuilder enum (no basetype field), fixed it by 
13581         avoiding calculating the size for such array as it cannot be instantiated.
13582         Fix bug #82015
13584 2007-07-12  Raja R Harinath  <rharinath@novell.com>
13586         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
13587         field.
13588         * metadata.c, reflection.c: Update to changes.
13590 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
13592         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
13593         mono_class_is_valid_enum, they are used to valide a enum when loading.
13594         * reflection.c: used new functions to throw TypeLoadException when and
13595         invalid enum is build with TypeBuilder. Fixes #82018
13596   
13597 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
13599         * object.c: forgot commit of mono_class_setup_methods () to access
13600         iface->methods.
13601         * object-internals.h: added a few more handy fields to
13602         MonoIMTCheckItem.
13604 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
13606         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
13607         iface->methods.
13609 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
13611         * class-internals.h, object-internals.h, object.c: IMT-based
13612         interface invocation core from Massimiliano Mantione
13613         (massi@ximian.com) with a reworked arch-specific interface,
13614         bsearch implementation and a few bugfixes and memory savings by me.
13616 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
13618         * class.c (mono_class_create_from_typedef): mono would segfault if 
13619         an enum did not have a __value field. It now throws a TypeLoadException
13620         for such cases. Fix bug #82022
13622 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
13624         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
13626 2007-07-09  Mark Probst  <mark.probst@gmail.com>
13628         * class.c (mono_class_init): If a class is already inited but has
13629         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
13631 2007-07-09  Mark Probst  <mark.probst@gmail.com>
13633         * class.c: Properly handle the case of an unimplemented interface
13634         method.  Fixes: 81673.
13636 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
13638         * class-internals.h, object.c: cleanup patch from massi: use
13639         MonoVTable->interface_bitmap since the vtable interfaces offset array
13640         is going away.
13642 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
13644         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
13645         GetMDStreamVersion icall instead.
13647 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
13649         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
13650         not use mono_dl_build_path() with a full library name: makes
13651         fallbacks to libgaim and libfam work.
13653 2007-07-06  William Holmes  <billholmes54@gmail.com>
13655         * assembly.c: Added a continue statement in probe_for_partial_name when
13656          parse_assembly_directory_name fails.  Fixes : 82002
13658 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
13660         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
13661         and added a verification  for TYPEDBYREF.
13662         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
13663         make native int interchangeable with int32 and some small cleanup and formating.
13664         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
13665         handle byref of byref.
13666         * verify.c (push_local): handle byref of byref.
13667         * verify.c (do_binop): invalid mix of values is unverifiable
13668         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
13669         added visibility checks
13670         * verify.c (field related method): added visibility checks
13671         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
13673 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
13675         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
13676         string.
13678 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
13680         * profiler.c (mono_profiler_load): Fix an off-by-one error.
13682         * marshal.c (emit_marshal_string): When returning a string from managed code,
13683         allways make a copy even for unicode strings. Fixes #81990.
13685 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
13687         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
13688         of byref generic inst types (bug #81997).
13690 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
13692         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
13693         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
13695 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
13697         * marshal.c (emit_marshal_string): Add support for unicode strings in
13698         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
13700 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
13702         * verify.c: field load/store are now verified, missing only access checks now
13704 2007-06-28  Martin Baulig  <martin@ximian.com>
13706         * mono-debug.c (mono_debug_debugger_version): New public variable.
13708 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
13710         * locales.c: When constructing DateTimeFormat or NumberFormat for
13711         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
13712         MonoCultureInfo contructed from the current locale is always
13713         read-only and has UseUserOverride set to true. All MonoCultureInfo
13714         instances returned for GetCultures have both IsReadOnly and
13715         UseUserOverride set to true. Fixes part of bug #81930.
13717 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
13719        * icall-def.h: Update System.__ComObject icalls
13720        * marshal.c: Avoid managed transition (and object creation)
13721        when looking up COM interface in RCW.
13722        * marshal.h: Ditto.
13723        
13724        Code is contributed under MIT/X11 license.
13726 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
13728         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
13729         to avoid crashes during assembly unloading.
13731 2007-06-22  Raja R Harinath  <rharinath@novell.com>
13733         Fix MethodInfo.IsGenericMethodDefinition
13734         * reflection.c (mono_reflection_bind_generic_method_parameters):
13735         Rearrange code to ensure we always uses a generic method definition.
13736         * class.c (mono_class_inflate_generic_method_full): Set
13737         'generic_container' field only for generic method definitions.
13738         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
13739         Use presense of 'generic_container' field as indication of being a
13740         generic method definition.
13742 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
13744         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13746         * object-internals.h: Reflect changes in the layout of the managed Delegate
13747         class.
13748         
13749         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
13750         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
13751         runtime memory used by the dynamic method. Fixes #77146.
13753 2007-06-21  Dick Porter  <dick@ximian.com>
13755         * file-io.h: 
13756         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
13757         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
13758         81767.
13760 2007-06-21  Raja R Harinath  <rharinath@novell.com>
13762         * reflection.c (method_encode_methodspec): Add a tripwire.
13763         * class.c (inflate_generic_type): The fully open generic type is
13764         not the same as the generic type definition.
13766 2007-06-21  Martin Baulig  <martin@ximian.com>
13768         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
13770         * mono-debug-debugger.h
13771         (MonoDebuggerBreakpointInfo): Removed.
13772         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
13773         (mono_debugger_remove_breakpoint): Likewise.
13774         (mono_debugger_breakpoint_callback): Likewise.
13775         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
13777 2007-06-21  Raja R Harinath  <rharinath@novell.com>
13779         * metadata.c (mono_metadata_lookup_generic_class): The fully open
13780         generic type is not the same as the generic type definition.
13781         * class.c (mono_generic_class_get_class): Likewise.
13783 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
13785         * icall.c: The second argument to 
13786         System.Reflection.MethodBase.GetMethodFromHandleInternalType
13787         is a MonoType not a MonoClass.
13789 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
13791         * verify.c: support for function pointers in the verifier
13793 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
13795         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
13797 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
13799         * assembly.c: removed Mono.Data.SqliteClient from the list of
13800         forward-compatible assemblies as it breaks the ABI (bug #81899).
13802 2007-06-19  Raja R Harinath  <rharinath@novell.com>
13804         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
13805         lookup/update with the loader lock.
13806         * reflection.c (mono_class_bind_generic_parameters): No need to
13807         protect mono_metadata_lookup_* with the loader lock.
13808         * class.c (inflate_generic_type): Likewise.
13809         
13810         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
13811         on a generic instantiated type.
13813 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
13815         *verify.c: produce meanfull error messages on verification error
13816         *verify.c: fixed some cases of verification errors reported as validation errors
13817         *pedump.c: fixed the error name array, now it shows validation errors properly
13818         *verify.h: fixed the contant that should be used for verification errors
13820 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
13822         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
13823         for bug #77596, 81858 and 80743 (generics data structures on domain
13824         unload).
13826 2007-06-15  Raja R Harinath  <rharinath@novell.com>
13828         Avoid allocating 'MonoGenericContext' on the heap.
13829         * class-internals (_MonoMethodInflated::context): Make field
13830         inline, not a pointer.
13831         * loader.c (method_from_methodspec): Allocate 'new_context' on the
13832         stack.  Use the context embedded within the inflated method as the
13833         hash key, rather than 'new_context'.
13834         * class.c (inflate_generic_context): Simplify.  Return a struct
13835         rather than allocating on the heap.
13836         (mono_class_inflate_generic_method_full): Update to changes.  Now,
13837         doesn't salt away a copy of the context -- simplifying the
13838         lifetime rules of a 'MonoGenericContext *'.
13839         (mono_method_get_context): Return pointer to embedded context.
13840         (setup_generic_array_ifaces): Allocate temporary context on stack.
13841         * reflection.c (inflate_mono_method): Likewise.
13842         (mono_reflection_bind_generic_method_parameters): Likewise.
13843         Use the context embedded within the inflated method as the hash key.
13845         Avoid a source of allocation of 'MonoGenericContext'.
13846         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
13847         and 'cached_context' fields into embedded 'MonoGenericContext' field.
13848         * class.c: Update to changes.
13849         (mono_generic_class_get_context): Simplify drastically.  Now just
13850         returns a pointer to the field.
13851         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
13852         argument as a const pointer.
13853         (mono_metadata_generic_context_equal): Likewise.
13854         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
13855         Update to changes.
13857 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
13859         * verify.c improved the handling of brtrue/brfalse, factored out common code
13861 2007-06-14  Raja R Harinath  <rharinath@novell.com>
13863         Kill MonoGenericMethod.
13864         * class-internals.h (MonoGenericContext::method_inst): Rename from
13865         'gmethod' and convert to a MonoGenericInst.
13866         (MonoGenericMethod): Remove.
13867         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
13868         * loader.c (method_from_methodspec): Update to changes.  Use a
13869         MonoGenericContext as the key to the hashtable.
13870         * metadata.c (mono_metadata_generic_context_equal): Rename from 
13871         'mono_metadata_generic_method_equal' and take MonoGenericContext.
13872         (mono_metadata_generic_context_hash): Likewise from
13873         'mono_metadata_generic_method_hash'.  Change hash function.
13874         (mono_metadata_load_generic_params): Update to changes.
13875         (mono_get_shared_generic_method): Remove.
13876         * metadata-internals.h (mono_get_shared_generic_method): Remove.
13877         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
13878         (inflate_generic_context): Likewise.
13879         (mono_class_inflate_generic_method_full): Likewise.
13880         (setup_generic_array_ifaces): Likewise.
13881         (mono_class_create_from_typespec): Likewise.
13882         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
13883         (method_encode_methodspec): Update callsite.
13884         (reflection_methodbuilder_to_mono_method): Update to changes.
13885         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
13886         MonoGenericContext as the key to the hashtable.
13887         (inflate_mono_method): Update to changes.
13889         * class-internals.h (MonoGenericMethod::container): Remove.
13890         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
13892 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
13894         * profiler-private.h, profiler.c, profiler.h: added API to profile
13895         exception events.
13897 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
13899         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
13901 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
13903         * verify.c: method invocation is now validated, now we verify parameter types on stack.
13904         Fixed overflow and underflow not aborting the verification process.
13906 2007-06-13  Mark Probst  <mark.probst@gmail.com>
13908         * class-internals.h (MonoStats): Added stats entries for dynamic
13909         code allocations.
13911 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
13913         * loader.c (mono_free_method): Free header->locals and header->clauses.
13915         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
13916         dynamic case.
13918         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
13920         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
13922 2007-06-12  Raja R Harinath  <rharinath@novell.com>
13924         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
13925         the tables.
13927 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13929         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
13931 2007-06-11  Raja R Harinath  <harinath@gmail.com>
13933         MonoGenericMethod on a diet
13934         * class-internals.h (_MonoMethodInflated::reflection_info): Move
13935         here ...
13936         (_MonoGenericMethod::reflection_info): ... from here.
13937         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
13938         Update to changes.
13939         * reflection.c (inflate_mono_method): Likewise.
13940         (mono_reflection_bind_generic_method_parameters): Likewise.
13942 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13944         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
13945         *verify.c: factored long ldarg forms to share code with short forms
13947 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13949         *verify.c: fixed code formating factored some duplicate code
13950         into a new function
13952         *verify.h: fixed binary incompatibility introduced earlier
13954         *pedump.c: fixed formating
13956 2007-06-11  Raja R Harinath  <harinath@gmail.com>
13958         Fix assertion when disassembling Mono.C5.dll
13959         * loader.c (method_from_methodspec): Avoid inflating a method
13960         twice with the same context.  If the methodref is inflated, use
13961         the declaring method instead.
13963         * class.c (mono_class_from_generic_parameter): Fix case similar to
13964         bug #81830 handled below, but for method containers.
13966 2007-06-10  Raja R Harinath  <harinath@gmail.com>
13968         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
13969         get_shared_generic_class.  Directly inflate the instance.
13970         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
13971         (inflate_generic_class): Delete.
13972         (get_shared_generic_class): Delete.  Move setting of
13973         'cached_class' and 'cached_context' ...
13974         * metadata.c (mono_metadata_lookup_generic_class): ... here.
13976         * metadata.c (mono_metadata_lookup_generic_class): Change
13977         signature to take the components of a MonoGenericClass rather than
13978         an allocated MonoGenericClass.  Change semantics to be intern-like.
13979         * reflection.c (mono_class_bind_generic_parameters): Update to
13980         changes.  Make locking region tighter.
13981         * class.c (inflate_generic_class): Update to changes.
13982         (get_shared_generic_class): Likewise.
13983         * metadata-internals.h: Likewise.
13985         * reflection.c (mono_class_bind_generic_parameters): Take and
13986         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
13987         (mono_reflection_bind_generic_parameters): Use
13988         'mono_class_bind_generic_parameters' rather than duplicate the code.
13989         * class.c (mono_bounded_array_class_get): Update to changes.
13990         * object-internals.h: Likewise.
13992         * reflection.c (mono_class_bind_generic_parameters): Only support
13993         parameterizing generic type definitions.  Remove support for other
13994         open types.
13996 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
13998         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
14000         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
14001         in the dynamic case.
14003 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
14005         * threads.c: When cleaning up thread, reset the Background bit.
14006         Fixes bug #81720.
14008 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
14010        * metadata.c: Move variable declarations to top of scope.
14011        * verify.c: Move variable declarations to top of scope.
14013        Code is contributed under MIT/X11 license.
14015 2007-06-08  Raja R Harinath  <rharinath@novell.com>
14017         * reflection.c (mono_class_bind_generic_parameters): Replace
14018         open-coded loop with mono_metadata_inflate_generic_inst.
14020         * class.c (get_shared_generic_class): Don't call
14021         mono_get_shared_generic_inst.  Use the container's own
14022         'class_inst'.
14024         * metadata.c (mono_metadata_load_generic_params): Move
14025         initialization of 'context' field here from ...
14026         * class.c (mono_class_create_from_typedef): ... here, and ...
14027         * loader.c (mono_get_method_from_token): ... here.
14029         * class.c (get_shared_generic_class): Rename from
14030         mono_get_shared_generic_class and make static.
14031         (mono_get_shared_generic_inst): Move to metadata.c.
14032         * loader.c (mono_get_shared_generic_method): Likewise.
14033         * class-internals.h, metadata-internals.h: Update to changes.
14035         Fix #81830
14036         * class.c (mono_class_from_generic_parameter): Don't assume a
14037         generic container owner exists.  Generic containers from monodis
14038         don't have any.
14040 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
14042         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
14043         * verify.h: new typedefs to returns the non-verifiable status
14044         * verify.c: initial implementation of generics, stack merging and object compatibility check
14046 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14048         * class.c, image.c, class-internals.h (MonoImage): class_cache is
14049         a MonoInternalHashTable again (fixed bug in internal hash table
14050         code).
14052 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14054         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
14055         MonoInternalHashTable again (fixed bug in internal hash table
14056         code).
14058 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14060         * class.c, image.c, class-internals.h, domain.c,
14061         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
14062         changes.  Have to figure out what makes them break the SWF
14063         regression.
14065 2007-06-04  Mark Probst  <mark.probst@gmail.com>
14067         * class.c, image.c, class-internals.h (MonoImage): class_cache is
14068         a MonoInternalHashTable now.
14070 2007-06-04  Mark Probst  <mark.probst@gmail.com>
14072         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
14073         MonoInternalHashTable now.
14075 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
14077         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
14078         invoke_impl code.
14080         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
14082         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
14083         dependent trampoline.
14085         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
14087         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
14089 2007-05-29  Robert Jordan  <robertj@gmx.net>
14091         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
14093 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
14095         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
14097 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
14099        * marshal.c: Fix interface lookup loops for
14100        cominterop_get_com_slot_for_method and 
14101        cominterop_get_method_interface. Only need to lookup
14102        if type is a class, else use interface type method is on.
14104        Code is contributed under MIT/X11 license.
14106 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
14108         * reflection.c: HasSecurity can be present even if no specially 
14109         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
14110         SecurityAttribute). Fix CAS regression tests on buildbot.
14112 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
14114        * appdomain.c: Add configure checks for header files.
14115        * image.c: Add configure checks for header files.
14116        * file-io.c: Add configure checks for header files.
14117        * debug-mono-symfile.c: Add configure checks for header files.
14118        * threadpool.c: Add configure checks for header files.
14119        * console-io.c: Add configure checks for header files.
14120        * profiler.c: Add configure checks for header files.
14121        * rawbuffer.c: Add configure checks for header files.
14122        * icall.c: Add configure checks for header files.
14123        * rand.c: Add configure checks for header files.
14124        * socket-io.c: Add configure checks for header files.
14126        Code is contributed under MIT/X11 license.
14128 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
14130         * reflection.c (mono_custom_attrs_from_builders): Remove the 
14131         assertion as it breaks the build.
14132         
14133         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
14135         * reflection.c (lookup_custom_attr): Make a copy here too.
14137         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
14138         dynamic images.
14140         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
14141         images.
14143         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
14144         info.
14146 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
14148         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
14149         (load_cattr_value): Ditto.
14151 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
14153         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
14155 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
14157         * threads.c: In "start_wrapper", set apartment_state to MTA if
14158         apartment_state is Unknown and we're running on 2.0 profile or
14159         higher.
14160         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
14161         to main method, then set apartment_state to Unknown on 1.0 profile,
14162         and MTA on 2.0 profile.
14164 2007-05-16  Jb Evain  <jb@nurv.fr>
14166         * class-internals.h (MonoDefaults): Add an attribute_class and
14167           customattribute_data_class.
14168         * domain.c (mono_init_internal): Populate them.
14169         * reflection.c: Use them to remove duplicates. Make a vew
14170         MonoClass variables `static'.
14172 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
14174         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
14175         step in implementing IMT, so that all isinst checks now can go
14176         through the bitmap.
14177         This was needed because vtables for TransparentProxy need to look
14178         like the vtable of the "target" class, so they need to point to
14179         its interface bitmap directly.
14181         * object.c: inside "mono_class_create_runtime_vtable" and
14182         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
14184 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
14186         * object-internals.h
14187           culture-info.h : added territory field in MonoCulture and
14188           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
14189         * locales.c : fill territory field above too.
14190         * culture-info-table.h : regenerated.
14192 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
14194         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
14195         Fixes #81599.
14197 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
14199         * object.c: Always initialize apartment, even if 
14200         there is no custom attributes on entry point.
14201         
14202         Code is contributed under MIT/X11 license.
14204 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
14206         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
14207         * metadata.c: If no encoding is set, check for unicode
14208         on class.
14209         
14210         Code is contributed under MIT/X11 license.
14212 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
14214         * threads.c: Handle if mono_thread_current returns NULL 
14215         
14216         Code is contributed under MIT/X11 license.
14218 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
14220         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
14221         in start_wrapper. Added mono_thread_init_apartment_state and
14222         mono_thread_cleanup_apartment_state.
14223         * object.c: Initialize thread apartment state on main thread
14224         by checking for STAThreadAttribute on entry point.
14225         * object-internals.h: Add apartment_state field to MonoThread.
14226         * threads-types.h: Add unmanaged definition of 
14227         System.Threading.ApartmentState, MonoThreadApartmentState.
14228         
14229         Code is contributed under MIT/X11 license.
14230         
14231 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
14233         * class.c: Fix windows build.
14234         * class-internals.h: Fix windows build.
14235         
14236         Code is contributed under MIT/X11 license.
14238 2007-05-08  Robert Jordan  <robertj@gmx.net>
14240         * process.c (CreateProcess_internal):
14241         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
14242         .CreateNoWindow was specified. Fixes #81496.
14244 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
14246         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
14247         step in implementing IMT, replaced it with two compact arrays
14248         (interfaces_packed and interface_offsets_packed) and a bitmap that
14249         is used for isinst checks (interface_bitmap).
14251         * class.c: (compare_interface_ids): compare function to pass to
14252         bsearch when looking for an interface with a given id.
14253         (mono_class_interface_offset): reimplemented using bsearch on
14254         interfaces_packed, getting the offset from interface_offsets_packed.
14255         (print_implemented_interfaces): utility debugging function.
14256         (setup_interface_offsets): reworked to initialize interfaces_packed,
14257         interface_offsets_packed and interface_bitmap.
14259         * object.c: replaced all accesses to "MonoClass.interface_offsets"
14260         with uses of interfaces_packed and interface_offsets_packed.
14262 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
14264         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
14265         mono_class_interface_offset prototype to wrap all accesses to
14266         "MonoClass.interface_offsets".
14268         * class.c: Implemented mono_class_interface_offset, and wrapped all
14269         accesses to "MonoClass.interface_offsets".
14271         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
14272         "MonoClass.interface_offsets".
14274 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
14276         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
14277         GetMethodFromHandle overloads (bug #78637).
14279 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
14281         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
14282         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
14284 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
14286         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
14287         #81498.
14289         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
14290         gracefully.
14291         (mono_custom_attrs_from_index): Ditto.
14293         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
14294         Fixes #81501.
14296 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
14298         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
14299         is now allocated from a mempool.
14301 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
14303         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
14304         caller holds threads_lock, leading to deadlocks. Fixes #81476.
14306 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
14308         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
14309         mono_loader_clear_error () too late. Fixes #81463.
14311 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
14313         * culture-info-table.h : regenerated.
14315 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
14317         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
14318         is missing.
14320 2007-04-25  Dick Porter  <dick@ximian.com>
14322         * Makefile.am: Put the mingw enforced-optimisation back into the
14323         PLATFORM_WIN32 section.
14325 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
14327         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
14328         patch.
14330         * image.c (mono_image_load_module): New API function to load a module reference.
14332         * image.c (load_modules): Load modules lazily. Fixes #80812.
14334         * class.c (mono_class_from_typeref): Use mono_image_load_module.
14335         
14336         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
14338         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
14339         to mono_image_load_module_dynamic.
14341 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
14343         * marshal.c: Fix calling convention for CCW on non-windows
14344         platforms. STDCALL on windows, CDECL everywhere else to work 
14345         with XPCOM and MainWin COM.
14346         
14347         Code is contributed under MIT/X11 license.
14349 2007-04-23  Martin Baulig  <martin@ximian.com>
14351         Fix #80969.
14353         * loader.c
14354         (method_from_memberref): Added `gboolean *used_context' argument.
14355         (mono_get_method_from_token): Likewise.
14356         (mono_get_method_full): Don't insert the method in the cache when
14357         `used_context' is true.
14359 2007-04-23  Raja R Harinath  <rharinath@novell.com>
14361         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
14363         * reflection.c (mono_reflection_bind_generic_parameters): Don't
14364         create new MonoTypes for returned types.
14365         * class.c (mono_generic_class_get_class): Export mono-internal.
14366         * class-internals.h: Update to changes.
14368 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
14370         * threadpool.c, threadpool.h, icall-def.h: patch from
14371         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
14373 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
14375         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
14376         
14377         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
14379         * threads.c (mono_thread_get_stack_bounds): New helper function.
14381         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
14382         Correctly compute stack bounds when attaching. Fixes #81394.
14384 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
14386         * reflection.c: fix handling of doubles in custom attributes
14387         for the arm-fpa format (bug #81368).
14389 2007-04-18  Raja R Harinath  <rharinath@novell.com>
14391         * reflection.c (assembly_add_win32_resources): Mildly relax an
14392         bounds check to let the end pointer point just past the end of the
14393         allocated buffer.  (may fix #81384)
14395 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
14397         * culture-info-table.h : regenerated.
14399 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
14401         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
14402         the thread is aborted early.
14404 2007-04-05  Dick Porter  <dick@ximian.com>
14406         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
14407         FindFirstFile()/FindNextFile() to find entries.  This lets the
14408         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
14409         81038.
14411         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
14412         the parameters of
14413         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
14415 2007-04-04  Martin Baulig  <martin@ximian.com>
14417         * debug-helpers.c
14418         (mono_method_desc_full_match): Add support for nested classes.
14420 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
14422         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
14424 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
14426         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
14427         waiting for too many threads.
14429 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
14431         * environment.c: Fix return value check on uname so we can get the 
14432         executing version on Solaris operating systems.
14434 2007-03-28  Jb Evain  <jbevain@gmail.com>
14436         * class.c (mono_type_get_name_recurse): Complete the
14437         fix for the creation of assembly qualified names for
14438         pointer types. Fixes #81208.
14440 2007-03-27  Dick Porter  <dick@ximian.com>
14442         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
14443         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
14444         changed.
14446         * threads.c
14447         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
14448         the value of ReleaseMutex().
14450 2007-03-27  Dick Porter  <dick@ximian.com>
14452         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
14453         in little-endian order, not network endian, so must be converted
14454         to host endian here.  Fixes bug 80593.
14456 2007-03-22  Jb Evain  <jbevain@gmail.com>
14458         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
14459         qualified names for pointer types. Fixes #81208.
14461 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
14463         * marshal.c: Add support for PreserveSigAttribute. 
14464         
14465         Code is contributed under MIT/X11 license.
14467 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
14469         * process.c: Fix endianness issues. Fixes #81126.
14471         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
14472         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
14474         * image.c (mono_image_lookup_resource): Make this work on big-endian
14475         machines.Change API contract so the caller needs to free the return value.
14476         
14477         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
14478         API change.
14479         
14480 2007-03-14  Martin Baulig  <martin@ximian.com>
14482         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
14483         mono_type_get_desc() as well.
14485 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
14487         * icall.c:  Fix environ access in VS.  
14488         
14489 2007-03-13  Alp Toker  <alp@atoker.com>
14491         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
14492         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
14493         #63841.
14495 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
14497         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
14498         circular references among dynamic methods. Fixes #81091.
14500         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
14502 2007-03-09  Martin Baulig  <martin@ximian.com>
14504         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
14506 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
14508         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
14509         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
14510         
14511         Code is contributed under MIT/X11 license.
14512         
14513 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
14515         * loader.c: Reapply patch for bug #79424.
14517 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
14519         * metadata.c (mono_type_to_unmanaged): Only convert object to
14520         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
14522 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
14524         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
14525         (and incorrectly set) is_reference field from MonoGenericInst.
14527 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
14529         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
14530         a little earlier.
14532         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
14534         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
14536 2007-03-05  Miguel de Icaza  <miguel@novell.com>
14538         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
14539         FileOptions.1 value to mean "temporary", map that to
14540         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
14542         Fixes 80688
14544 2007-03-03  Marek Habersack  <mhabersack@novell.com>
14546         * appdomain.c: implement MS .Net style shadow copying. Copies of
14547         the assemblies are made in a subdirectory of the dynamic base
14548         directory, the assembly names are preserved.
14549         Copy .mdb and .config files along with the assemblies being shadowed.
14551 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
14553         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
14554         (emit_marshal_handleref): Ditto.
14556         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
14557         on Visual C++. Fixes #80671.
14559 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
14561         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
14562         for clone operations.
14564 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
14566         * marshal.c: Fix warnings.
14568 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
14570         * loader.c: allow case-insensitive matching of the dll name
14571         in dllmap handling when prefixed with "i:".
14573 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
14575         * threads.c: Fix #ifdef for dummy_apc function for VS.
14577 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
14579         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
14581 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
14582         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
14583         giving precedence to the methods with a fully qualified name
14584         (InterfaceName.MethodName) when building the interface sections
14585         of the vtable.
14587 2007-02-16  Dick Porter  <dick@ximian.com>
14589         * threadpool.c (append_job): Fix fast-path array handling, so it's
14590         less likely the array will grow exponentially when the load is
14591         heavy.
14593 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
14595         * metadata-internals.h, loader.c: fix dllmap lookup order
14596         for non-function maps, too, and prepare for fallback code.
14598 2007-02-12  Robert Jordan  <robertj@gmx.net>
14600         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
14601         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
14602         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
14603         GlobalFree. Fixes a part of bug #77075.
14605 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
14607         * loader.c: implemented typedef parent in field memberref.
14609 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
14611         * marshal.c: Fix warnings and remember to call Release on
14612         IUnknown of RCW.
14613         
14614         Code is contributed under MIT/X11 license.
14616 2007-02-10  Miguel de Icaza  <miguel@novell.com>
14618         * class-internals.h: Add MonoHandleRef definition, and
14619         handleref_class to mono_defaults. 
14621         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
14622         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
14624         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
14625         (do nothing on this stage)
14626         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
14627         (emit_marshal_handleref): New method, used for argument handling
14628         of HandleRefs. 
14630 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
14632         * class.c (mono_class_setup_parent): Lazily init com types.
14633         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
14634         init com types.
14635         * object.c (mono_remote_class_vtable): Lazily init com types.
14636         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
14637         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
14638         * domain-internals.h: Expose mono_init_com_types.
14639         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
14640         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
14641         Add support for COM Callable Wrapper marshalling.
14642         * marshal.h: Add icall definitions.
14643         * gc.c: Handle freeing of CCWs in finalizer code.
14644         
14645         Code is contributed under MIT/X11 license.
14647 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
14649         * reflection.c: changed all the signature encoding code to use
14650         a variable-sized buffer.
14652 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
14654         * marshal.c: locking fixes: never take the loader lock
14655         or other runtime locks when holding the marshal lock
14656         (fixes bug#80664).
14658 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
14660         * marshal.c: make the delegate function pointer mapping
14661         work for the moving GC.
14663 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
14665         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
14666         for bug #80618.
14668 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
14670         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
14671         gmodule.
14673 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
14675         * threadpool.c: made the code moving-GC safe.
14677 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
14679         * assembly.c, boehm-gc.c, class-internals.h, class.c,
14680         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
14681         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
14682         warning cleanup.
14683         * reflection.c: warning cleanup, some threading and moving GC fixes.
14685 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
14687         * class.c, loader.c: create the needed Set/Get/Address array methods
14688         as well as the .ctors in mono_class_init (), fixes bug #80567.
14690 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
14692         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
14693         we doesn't decrease its alignment. Should fix the sparc build.
14695 2007-01-24  Dick Porter  <dick@ximian.com>
14697         * socket-io.c
14698         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
14699         Create the returned object if we need to ignore an unsupported
14700         socket option.  Fixes a segfault reported by Atsushi.
14702 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
14704         * class.c, object.c: restrict GC-tracked fields to
14705         UIntPtr fields used inside corlib, so we provide better
14706         type info to the GC and also allow broken packing as in
14707         bug #80580.
14709 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
14711         * sgen-gc.c: removed duplicated function.
14713 2007-01-19  Miguel de Icaza  <miguel@novell.com>
14715         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
14716         value that means that the value is not supported, but that we
14717         should not return a failure, but instead report this as a
14718         successful operation.
14720 2007-01-19  Raja R Harinath  <rharinath@novell.com>
14722         Fix tests/bug79956.2.il
14723         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
14724         (mono_generic_class_get_class): If the generic definition in an
14725         enum, copy over other fields related to it.
14727 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
14729         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
14730         genericinst enums (bug #79215).
14732 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
14733         * class.c: Fix bug 80307.
14735 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
14737         * image.c: if the file table is not present, try to load
14738         all the modules, since we don't have info about them
14739         having or not metadata (bug #80517).
14740         * assembly.c: allow mono_assembly_load_references () to
14741         work for netmodules.
14743 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
14745         * image.c, metadata-internals.h, object.c: execute module
14746         cctors when running on the 2 runtime if present (bug #80487).
14748 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
14750         * icall.c: optimized InitializeArray() on bigendian.
14752 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
14754         * icall.c: fix for the broken ARM FPA double format.
14756 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
14758         * icall.c: handle endian issues for r4 and r8 types, too, in
14759         the InitializeArray() icall.
14761 2007-01-15  Miguel de Icaza  <miguel@novell.com>
14763         * loader.c (mono_loader_error_prepare_exception): Clear the error
14764         once we have extracted the information from it, do this before we
14765         call into the JIT's class loading mechanisms.
14767         * object.c (mono_class_create_runtime_vtable): Do not clear the
14768         loader error before calling mono_class_get_exception_for_failure
14769         as the loader error is needed inside
14770         mono_class_get_exception_for_failure to throw the error (thinko).
14772         Fixes #80521
14773         
14774 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
14776         * reflection.c: align fields rva data so it's faster to load at
14777         runtime.
14779 2007-01-12  Raja R Harinath  <rharinath@novell.com>
14781         Prepare to simplify GenericMethod handling.
14782         * class-internals.h (mono_method_get_context): New accessor function.
14783         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
14784         rather than directly accessing '->context' field.
14786         * class-internals.h (_MonoGenericParam.method): Move ...
14787         (_MonoGenericContainer): ... here.  Add into union with klass field.
14788         * class.c, icall.c, loader.c, metadata.c, reflection.c:
14789         Update to changes.
14791 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
14793         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
14794         the wrapper type enum and reduce relocations.
14796 2007-01-12  Raja R Harinath  <rharinath@novell.com>
14798         * reflection.c (inflate_mono_method): Reuse method instantiation
14799         from the generic method, if available.
14801 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
14803         * marshal.c (emit_marshal_variant): Fix conv_arg
14804         type in last commit, based on whether parameter is byref.
14805         
14806 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
14808         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
14809         marshalling.
14810         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
14811         MONO_TYPE_OBJECT back for VARIANT support.
14813 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
14815         * marshal.c, marshal.h, icall-def.h: Implement 
14816         Marshal.ReAllocCoTaskMem.
14818 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
14820         * marshal.c: memory retention fixes: use the proper
14821         image cache for runtime_invoke method lookups.
14823 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
14825         * mempool.c: added code to help debug mempool allocations.
14827 2007-01-11  Dick Porter  <dick@ximian.com>
14829         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
14830         support (experimenting with faking it with IP_MTU_DISCOVER for
14831         systems that don't have IP_DONTFRAGMENT.)
14832         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
14833         icall.
14835         * icall-def.h: new System.Net.Sockets.Disconnect icall.
14837         * socket-io.h: Add new fields to MonoSocketAsyncResult
14838         corresponding to the new ones in Socket.cs.
14840 2007-01-11  Raja R Harinath  <rharinath@novell.com>
14842         Fix IronPython regression mentioned in #80249
14843         * metadata.c (do_mono_metadata_parse_generic_class): Clear
14844         'cached_context' field, since it may have been initialized as a
14845         side-effect of metadata parsing.
14847         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
14848         (_MonoGenericClass.cached_class): Move here and rename from lone
14849         remaining field of ...
14850         (_MonoInflatedGenericClass): ... this.  Remove.
14851         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
14852         to changes.
14854         Fix mcs/tests/test-128.cs regression.
14855         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
14856         2007-01-10 change below.
14857         [MONO_TYPE_OBJECT]: Recurse into array case.
14859 2007-01-11  Raja R Harinath  <harinath@gmail.com>
14861         * class-internals.h (mono_get_inflated_generic_class): Remove.
14862         * class.c (mono_get_inflated_generic_class): Remove.
14863         (mono_generic_class_get_class): Rename from
14864         mono_class_create_generic.
14865         (mono_class_from_mono_type) [GENERICINST]: Use it.
14866         * reflection.c, metadata.c: Update to changes.  Use
14867         'mono_class_from_mono_type'.
14869 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
14871         * reflection.c: use passed type when encoding an array element
14872         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
14874 2007-01-09  Robert Jordan  <robertj@gmx.net>
14876         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
14877         result arguments (someDelegate.EndInvoke (unrelatedAres)).
14878         Fixes bug #80392.
14880 2007-01-09  Raja R Harinath  <rharinath@novell.com>
14882         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
14884         * object.c (set_value): Avoid aliasing between type->data.klass
14885         and type->data.generic_class.
14887         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
14889 2007-01-08  Raja R Harinath  <rharinath@novell.com>
14891         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
14892         between type->data.klass and type->data.generic_class.
14894 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
14896         * marshal.c: In MS.NET, StringBuilder objects are not copied by
14897         value in out parameters.
14899 2007-01-08  Raja R Harinath  <rharinath@novell.com>
14901         Simplify invariant for MonoGenericClass::klass field.
14902         * class.c (mono_class_create_generic): Verify 'klass' is null.
14903         * metadata.c (do_mono_metadata_parse_generic_class): Don't
14904         initialize 'klass' field.
14906 2007-01-05  Raja R Harinath  <rharinath@novell.com>
14908         Ongoing work to avoid redundant data and simplify invariants.
14909         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
14910         'generic_class', and change type to a GenericInst.
14911         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
14912         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
14914 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
14916         * class.c : skip io-layer under PLATFORM_WIN32.
14918 2007-01-03  Tor Lillqvist  <tml@novell.com>
14920         Fix #80305: In a bundled executable, look in the bundled exe
14921         assembly to determine the runtime version. Add the possibility to
14922         bundle also the machine.config file.
14923         
14924         * assembly.c (mono_assembly_open_from_bundle): Make
14925         non-static. Allow being called even if we have no bundled
14926         assemblies, and return NULL right away in that case.
14928         * domain-internals.h: Declare mono_assembly_open_from_bundle()
14929         here.
14931         * domain.c (app_config_parse): Take an assembly exe file name as
14932         parameter instead of a config file name. Check for a bundled
14933         config file for that assembly by calling
14934         mono_config_string_for_assembly_file() (see below) before looking
14935         for one in the file system.
14936         (get_runtimes_from_exe): Corrsponding change to call of
14937         app_config_parse().
14938         (get_runtimes_from_exe): Check for bundled assembly exe file first
14939         by calling mono_assembly_open_from_bundle(). If no bundled
14940         assembly exe file is found, call mono_image_open() as before to
14941         look it up in the file system.
14943         * mono-config.c: Add variable bundled_machinec_onfig.
14944         (mono_config_string_for_assembly_file): New function.
14945         (mono_config_for_assembly): Move code snippet that looks for a
14946         bundled assembly .config file into the above new function. Call
14947         it.
14948         (mono_register_machine_config, mono_get_machine_config): New
14949         functions to set and retrieve
14951         * assembly.h: Declare mono_register_machine_config().
14953         * mono-config.h: Declare mono_get_machine_config() and
14954         mono_config_string_for_assembly_file().
14956         * icall.c: No declaration of environ necessary on Win32. It is
14957         declared (as a macro expanding to a function call) in stdlib.h.
14958         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
14959         New internal mono function. Returns the value of
14960         mono_get_machine_config() as a Mono string.
14962         * icall-def.h: Add get_bundled_machine_config().
14964 2007-01-04  Raja R Harinath  <rharinath@novell.com>
14966         Remove redundant field
14967         * class-internals.h (_MonoGenericContext.container): Remove field.
14968         * loader.c (mono_method_get_signature_full): Don't parse a
14969         "container" for a signature parse when the signature is inflated
14970         immediately.
14971         (method_from_methodspec): Likewise, for a generic_inst.
14972         * class.c, metadata.c, reflection.c: Update to changes.
14974 2006-01-04  Raja R Harinath  <rharinath@novell.com>
14976         * class-internals.h (_MonoGenericClass): Rename 'context' field to
14977         'cached_context', and change semantics -- it starts off NULL, and
14978         is initialized on demand.
14979         * class.c (mono_generic_class_get_context): New accessor to
14980         replace 'context' field accesses.
14981         (mono_class_get_context): New helper.
14982         (*): Update to changes.
14983         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
14985 2007-01-03  Miguel de Icaza  <miguel@novell.com>
14987         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
14988         before the memcpy.   Fixes Marshal2 regression.
14990 2007-01-02  Jb Evain  <jbevain@gmail.com>
14992         * blob.h: add a MONO_TYPE_ENUM definition
14993         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
14994         fix the encoding of arrays of enums in custom attributes.
14996         Fixes #79666.
14998 2007-01-01  Miguel de Icaza  <miguel@novell.com>
15000         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
15001         string is null terminated, but only cut the string short if it
15002         overflows the buffer.   
15003         
15004         (mono_string_to_byvalstr): Also fix this routine.   The code here
15005         was not properly terminating a string (it was only terminated
15006         because of the previous catch-all memset). 
15008         I left the memset, because I do not know if applications expect
15009         the runtime to clear this region. 
15011         Fixes #79944.
15013         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
15014         Clear the error before returning to unmanaged code to prevent the
15015         runtime from being confused later on (fixes  80420).
15016         (ves_icall_type_from_name): Always call mono_loader_clear_error
15017         after parsing a type that could have failed.
15018         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
15020         * loader.c (mono_loader_clear_error): Fix indentation.
15022 2006-12-28  Martin Baulig  <martin@ximian.com>
15024         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
15026 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
15028         * reflection.c: patch from Rolf Bjarne Kvinge to fix
15029         getting a token for an EnumBuilder.
15031 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
15033         * reflection.c: be more careful in case resource generation
15034         fails to create the data array.
15036 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
15038         * sgen-gc.c: write barrier for clone and fix unregister handles.
15040 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
15042         * reflection.c: some fixes needed in the generics code for the moving GC.
15044 2006-12-22  Robert Jordan  <robertj@gmx.net>
15046         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
15047         account. Fixes bug #80299.
15049 2006-12-21  Raja R Harinath  <rharinath@novell.com>
15051         Fix WaitHandle usage in delegates.
15052         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
15053         * object.c (mono_wait_handle_new): Use the property set method to
15054         initialize the handle.
15055         (mono_wait_handle_get_handle): New.
15056         * threadpool.c (mono_async_invoke): Use it.
15057         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
15058         Likewise.
15059         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
15061 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
15063         * marshal.c (emit_marshal): Call emit_marshal_variant and
15064         emit_marshal_com_interface when applicable.
15065         (emit_marshal_variant, emit_marshal_com_interface): Add
15066         methods for this case and remove if's from emit_marshal_object.
15067         
15068 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
15070         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
15072 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
15074         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
15075         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
15076         and GlobalFree on Windows. Remove FIXME.
15078 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
15080         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
15081         implementation for managed objects.
15083 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
15085         * object.c: implemented code to be used for checking
15086         that no reference field overlaps with non-references.
15088 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15090         * threadpool.c: fix queue code to be compatible with the
15091         moving GC.
15093 2006-12-18  Miguel de Icaza  <miguel@novell.com>
15095         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
15096         in structures by throwing ArgumentNullException.
15098         (emit_marshal_safehandle): Also when they are null parameters.
15100         (emit_marshal_safehandle): Add support for ref
15101         SafeHandles parameters
15103 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
15105         * profiler.c: updated to use the mono-dl API instead of
15106         gmodule.
15108 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15110         * profiler.c: updated to use the mono-dl dynamic loading
15111         API instead of gmodule.
15113 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
15115         * profiler.c: use readlink, older versions of glib don't have
15116         g_file_read_link ().
15118 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
15120         * profiler.c: try to detect the path to mono if libc fails to provide
15121         a useful name (bug #80286).
15123 2006-12-16  Raja R Harinath  <rharinath@novell.com>
15125         Fix #80242
15126         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
15127         instance, use the generic type definition instead.
15128         (ves_icall_Type_GetNestedTypes): Likewise.
15129         * class.c (mono_class_create_generic): Always set the
15130         nested_classes of a generic instance to NULL, even if the generic
15131         type definition has nested types.
15133 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
15135         * marshal.c (mono_string_from_bstr): Revert previous Windows change
15136         and fix on Linux.
15137         
15138 2006-12-15  Miguel de Icaza  <miguel@novell.com>
15140         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
15141         my arguments were in the wrong order.   I also fixed the Windows
15142         version which seems to have had the same issue.
15144         (mono_free_bstr): On Unix, this is g_free.
15145         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
15146         conversions (for the tests in corlib to pass).
15148 2006-12-14  Miguel de Icaza  <miguel@novell.com>
15150         * marshal.c (emit_ptr_to_object_conv): For now, ignore
15151         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
15152         exception if a ref SafeHandle in a struct has changed).
15153         
15154         (emit_struct_conv): Do not perform layout checks for classes
15155         derived from SafeHandle, as those are specially handled. 
15157         (emit_object_to_ptr_conv): Add support for
15158         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
15160         (emit_marshal_safehandle): Implement conversion of return values
15161         of safehandles (MARSHAL_ACTION_CONV_RESULT).
15162         
15163         * threads.c: WaitHandle now is compiled with two different handles
15164         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
15165         for 2.0.
15166         
15167         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
15168         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
15169         these routines to cope with both kinds of fields.
15171 2006-12-12  Miguel de Icaza  <miguel@novell.com>
15173         * metadata.c (mono_type_to_unmanaged): Handle the case where
15174         type->data.klass is a SafeHandle, and in that case, return the
15175         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
15176         MONO_MARSHAL_CONV_SAFEHANDLE. 
15178 2006-12-11  Miguel de Icaza  <miguel@novell.com>
15180         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
15181         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
15182         calling emit_marshal_object.
15184         (emit_marshal_safehandle): Implement marshalling of
15185         SafeHandle parameters (no ref support yet).
15187         (MarshalAction): Document the defines as I implement
15188         them for SafeHandle.
15190         (emit_marshal_object): indentation police.
15192         * class-internals.h: Define MonoSafeHandle.
15193         Add safehandle_class to MonoDefaults type.
15195         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
15196         list of classes to check for fields. 
15198         * domain.c (mono_init_internal): Add SafeHandle to the list of
15199         mono_defaults loaded.
15201 2006-12-15  Raja R Harinath  <rharinath@novell.com>
15203         Fix #80253
15204         * reflection.c (mono_reflection_bind_generic_parameters): If the
15205         generic type definition is a type builder, ensure that it is fully
15206         initialized before instantiating it.  Kill some dead code.
15208 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
15210         * object.c: clear the loader_error () before loading
15211         more metadata stuff (bug #80258).
15213 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
15215         * icall.c, icall-defs.h: type modifiers icalls for
15216         parameters and properties.
15218 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
15220         * object.c, icall.c: fixed warnings.
15222 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
15224         * marshal.c: fixed a couple of leaks and coding style in a few places.
15226 2006-12-08  Dick Porter  <dick@ximian.com>
15228         * process.c: Cope with NULL ProcessStartInfo arguments on windows
15229         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
15230         80173.
15232 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
15234         * process.c: ProcessStartInfo may have only filename set and
15235         arguments can be NULL.
15237 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
15239         * icall.c: fix leak found by Robert Jordan.
15241 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
15243         * marshal.c, marshal.h: generate managed method to access an element
15244         of a multi-dimensional array.
15246 2006-11-30  Paolo Molaro (lupus@ximian.com)
15248         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
15250 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15252         * icall.c: back out GetFields () fix until the serialization code is
15253         fixed to not depend on the incorrect behaviour.
15255 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
15257         * profiler.c: provide defaults if none are set.
15259 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
15261         * Makefile.am, attrdefs.h: new public header file with
15262         constants for attributes for use by embedders.
15264 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
15266         * icall.c: GetFields () fix for bug #80064.
15268 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
15270         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
15271         removed long unused icalls.
15273 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
15274   
15275         * marshal.c: 
15276                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
15277                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
15278                 can be generated without a delegate class.
15279                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
15280         
15281         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
15283 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15285         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
15286         #80069.
15288 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
15290         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
15291         icall-def.h: added icalls needed by System.GC.
15293 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
15295         * loader.c: ensure the class in catch clauses is handled
15296         correctly for generics methods (fixes bug#79980).
15298 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
15300         * monitor.h, monitor.c: added mono_locks_dump () function
15301         to help debug deadlocks involving managed locks.
15303 2006-11-13  Dick Porter  <dick@ximian.com>
15305         * file-io.c (get_file_attributes): If the file is a symlink try
15306         and get the stat data for the target, but also add the
15307         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
15308         the specs for the windows symlink support, but will probably have
15309         to be reworked when I have test data from a vista machine.  Fixes
15310         bug 79887.
15312 2006-11-13  Dick Porter  <dick@ximian.com>
15314         * gc.c (mono_domain_finalize): 
15315         * marshal.c (mono_delegate_begin_invoke): 
15316         * threadpool.c (socket_io_init, mono_thread_pool_init)
15317         (mono_thread_pool_finish): 
15318         * monitor.c (mono_monitor_try_enter_internal): 
15319         * threads.c (mono_thread_resume, mono_thread_init)
15320         (mono_thread_suspend_all_other_threads)
15321         (mono_thread_execute_interruption): 
15322         * appdomain.c (mono_domain_unload): Check for NULL error returns
15323         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
15324         75733.
15326 2006-11-11  Miguel de Icaza  <miguel@novell.com>
15328         * process.c
15329         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
15330         Only close the handle if the value of the handle is not
15331         INVALID_HANDLE_VALUE.  This just makes the process a bit more
15332         robust.
15334         Improvement for #75733, so that we do not run into this problem. 
15336         
15337         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
15338         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
15339         internal variables.  Fixes #79462 
15340         
15342 2006-11-09  Dick Porter  <dick@ximian.com>
15344         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
15345         Use poll() not select().  Fixes bug 79397.
15347 2006-11-09  Raja R Harinath  <rharinath@novell.com>
15349         Fix #79872
15350         * assembly.c (mono_assembly_load_from_full): Check that the given
15351         image has an assembly manifest.
15353 2006-11-09  Ankit Jain  <jankit@novell.com>
15355         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
15356         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
15357         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
15359 2006-11-07  Dick Porter  <dick@ximian.com>
15361         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
15362         Put the old resolver behaviour back for pre-2.0 profiles.
15364 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
15366         * threadpool.c: precise GC and locking fixes.
15368 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
15370         * class.c: don't load types that have an explicit unaligned
15371         managed reference. Provide better info in the TypeLoad exception.
15372         Part of the fix for bug #79744.
15373         * object.c: use the correct check for class type load issues.
15375 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
15377         * class.c: enforce alignment of fields with managed references
15378         even when Pack=1 is forced by the user (bug #77788).
15380 2006-11-03  Dick Porter  <dick@ximian.com>
15382         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
15383         If the address reverse lookup fails, return it as the hostname
15384         anyway.  Fixes bug 79721.
15386 2006-11-03  Dick Porter  <dick@ximian.com>
15388         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
15389         Fix build on Windows.
15391 2006-11-02  Dick Porter  <dick@ximian.com>
15393         * icall-def.h: 
15394         * object-internals.h: 
15395         * exception.c (mono_get_exception_thread_interrupted): 
15396         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
15397         Fixes bug 74525.
15399         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
15400         Check for pending Thread.Interrupt.
15402 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
15403         * loader.c: Fixed bug 79684.
15405 2006-10-27  Dick Porter  <dick@ximian.com>
15407         * file-io.c (get_file_attributes): Force symlinks to directories
15408         to be returned as a regular file.  Fixes bug 79733.
15409 2006-10-26  Dick Porter  <dick@ximian.com>
15411         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
15412         CreateFile to open a directory then we need to set the
15413         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
15415 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
15417         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
15418         friends.
15420 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
15422         * sgengc.c: small cleanup of timer code.
15424 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
15426         * sgen-gc.c: fix some warnings and start adding support for
15427         complete object removal on domain unload.
15429 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
15431         * assembly.c: build_assembly_name should not consider a version
15432         number without build or revision number invalid. Fixes bug #79715.
15434 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
15436         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
15437         call kernel32 function OutputDebugString directly.
15438         
15439         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
15440         
15441 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
15443         * reflection.c: small cleanup, using a function to insert a MonoString
15444         in the string heap.
15446 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
15448         * reflection.c: moving GC fixes.
15450 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
15452         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
15453         all the objects with finalizers belonging to an unloading appdomain.
15455 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
15457         * sgen-gc.c: added ability to allocate even when the nursery is fully
15458         pinned and fixed a couple of bugs.
15460 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
15462         * threads.h: Revert the last change for now.
15464         * threads.h (mono_thread_get_pending_exception): Rename this to
15465         mono_thread_get_undeniable_exception ().
15467 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
15469         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
15470         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
15471         when fname does not refer to valid assembly. This result in a more
15472         meaningful error message.
15473         * exception.c: added mono_get_exception_bad_image_format2 which 
15474         constructs a BadImageFormatException using the ctor taking a custom
15475         message and the file name. Passing in a NULL msg results in a default
15476         message.
15477         * exception.h: define mono_get_exception_bad_image_format2 function.
15478         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
15479         when file name pointed to an invalid IL image. Use 
15480         mono_get_exception_file_not_found2 to construct FileNotFoundException,
15481         as this results in a more meaningful error message.
15483 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
15485         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
15486         #79465.
15488 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
15490         * metadata.c (mono_type_size): Change the align parameter to guint32 for
15491         consistency with the other _size functions.
15492         (mono_type_stack_size): Ditto.
15494         * class.c object.c icall.c: Fix warnings caused by the above change.
15496         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
15498         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
15500         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
15502 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
15504         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
15505         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
15506         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
15507         threadpool.h, threads-types.h: mark more internal functions.
15509 2006-10-11  Dick Porter  <dick@ximian.com>
15511         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
15512         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
15513         reproduce the bug even before applying the fix.)
15515 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
15517         * reflection.c: allow retrieving attributes for arguments in generic
15518         methods (bug #79241).
15520 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
15522         * debug-mono-symfile.c: properly check fopen () result (found by
15523         coverity).
15525 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
15527         * reflection.c: make error message clearer and fixed two
15528         issuelets found by Coverity.
15530 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
15532         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
15534 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
15536         * object-internals.h, gc-internal.h, profiler-private.h:
15537         mark internal functions.
15539 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
15541         * reflection.c: put data in the text section.
15542         * icall.c: recognize more types in type_from_typename ().
15543         * process.c, marshal.c: added some GC FIXMEs.
15545 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
15547         * loader.c: check for NULL before initializing.
15549 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
15551         * gc.c (finalizer_thread): Use a non-alertable wait here.
15553         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
15554         until the correct solution is found.
15556 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
15558         * reflection.c (mono_module_get_object): Avoid an assert when operating on
15559         modules with no metadata. Fixes #79596.
15561         * image.c (load_metadata_ptrs): Put back the error message when
15562         the #- heap is encountered since the support is not complete yet.
15564 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
15566         * gc.c: do not allow the user to SuppressFinalize () a
15567         delegate because it would leak the trampoline if present.
15569 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
15571         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
15572         PropertyPtr table.
15574 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
15576         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
15578         * metadata.c (mono_metadata_get_param_attrs): Ditto.
15580         * row-indexes.h: Add definitions for *Ptr tables.
15582         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
15584         * metadata.c (mono_metadata_translate_token_index): New helper function to
15585         translate table indexes used in uncompressed metadata.
15586         (mono_metadata_decode_table_row): Ditto.
15587         (mono_metadata_decode_table_row_col): Ditto.
15589         * metadata.c: Add table schema for *Ptr tables.
15591         * class.c loader.c: Use the new helper function to access the affected metadata
15592         tables.
15593         
15594         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
15595         #38532.
15596         
15597 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
15599         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
15600         sequences which can be unbounded in size. Fixes #79583.
15602 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
15604         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
15605         static initialization.
15607         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
15609         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
15611         * domain.c (mono_domain_free): Free up type_init_exception_hash.
15613         * object.c (mono_runtime_class_init): Implement correct semantics when a static
15614         ctor fails, i.e. throw the same exception on subsequent accesses.
15615         
15616 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
15618         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
15619         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
15620         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
15621         Handle marshalling of interfaces and VARIANTs contained in structs.
15622         
15623         Code is contributed under MIT/X11 license.
15624         
15625 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
15627         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
15628         
15629         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
15630         mempool.
15632 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15634         * console-io.c: ignore previous SIGINT handler.
15636 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
15638         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
15639         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
15640         #79460, #79461, #79485.
15642         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
15644         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
15645         #79217.
15647 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
15649         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
15650         could be generated from it.
15652 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
15654         * rand.c: fix read loop to correctly handle EINTR.
15656 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
15658         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
15659         internal calls are defined to keep methods closer to the declaring
15660         type and allow a significant reduction in runtime relocations and
15661         memory usage.
15663 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
15665         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
15666         exception message to have FileNotFoundException use the default
15667         assembly load error message. Fixes bug #79426.
15668         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
15670 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15672         * threadpool.c: (start_thread_or_queue) use the root domain when
15673         creating the thread instead of the async object one.
15675 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
15677         * class.c, object.c, class-internals.h, reflection.c:
15678         for arrays, store element_size inside MonoClass (speedup
15679         for array object creation).
15681 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
15683         * icall.c: fixed CodeBase to use the file name and not the module
15684         name (bug #79365).
15686 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
15688         * mono-debug.c, mono-debug.h: export find_method as
15689         mono_debug_find_method ().
15691 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
15693         * debug-helpers.c, class-internals.h: added a few functions useful
15694         when debugging under gdb.
15696 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15698         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
15699         characters that need special handling.
15701 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
15703         * mono-config.c: make the os/cpu specification more flexible,
15704         allowing lists and negation.
15706 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
15708         * marshal.c: COM Interop fixes. Handle case where method->klass.
15709         is interface. Handle BSTR/MonoString when null. Use CDECL as 
15710         calling convention on non-windows platforms. This is for
15711         compatibility with XPCOM and MainWin COM.
15712         
15713         Code is contributed under MIT/X11 license.
15714         
15716 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
15718         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
15719         correctly. Fixes #79217.
15721         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
15723 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
15725         * mono-config.c: allow both an os and cpu attribute for dllmap
15726         and dllentry elemnets to enable a single config file to be used
15727         for multiple architectures.
15729 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
15731         * loader.c: MonoLoaderError was cleared too soon on load failure.
15732         Fixes bug #79424.
15734 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
15736         * icall.c: use the defining class vtable when accessing a
15737         static field, not a pobblibly derived class.
15739 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
15741         * icall.c string-icalls.c: Remove references to unicode.h.
15743         * unicode.h unicode.c Makefile.am: Remove these unused source files.
15745         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
15747         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
15748         indicating the image where custom marshaller types should be looked up.
15749         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
15750         custom marshallers, instead of corlib. Fixes #79425.
15752 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
15754         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
15756 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
15758         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
15759         Implement Environment.ProcessorCount.
15760         
15761         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
15762         Implement Environment.ProcessorCount.
15763         
15764         * icall.c: 
15765         Add Environment.ProcessorCount icall.
15766         
15767         Patch by Jason McFall.
15769 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15771         * assembly.c: don't append .exe/.dll when the filename already contains
15772         one of those extensions.
15774 2006-09-12  Martin Baulig  <martin@ximian.com>
15776         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
15777         to array interfaces.
15779 2006-09-11  Martin Baulig  <martin@ximian.com>
15781         * reflection.c (mono_image_build_metadata): Create the
15782         MethodImpl's after emitting all types and methods, so we don't
15783         need another fixup pass for them.
15785 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
15787         * class.c (mono_class_from_name_case): Fix regression introduced by the last
15788         change.
15790 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
15792         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
15793         unload.
15795 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
15797         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
15798         args is not set. Fixes #78926.
15800 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
15802         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
15804         * image.c (load_class_names): Move this to class.c, and rename it to 
15805         'mono_image_init_name_cache'.
15806         (load_modules): Fix a warning.
15808         * class.c icall.c image.c: Initialize image->name_cache lazily.
15810         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
15811         on its name using information in the AOT file.
15813         * class.c (mono_class_from_name): Use the new hook function.
15815 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
15817         * reflection.c (mono_param_get_objects): Handle enum default parameter values
15818         correctly.
15820         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
15821         Fixes #79289.
15822         
15823 2006-09-06  Martin Baulig  <martin@ximian.com>
15825         * icall.c (mono_lookup_internal_call): Small fix.
15827 2006-09-05  Raja R Harinath  <rharinath@novell.com>
15829         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
15830         double g_free.
15832 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
15834         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
15835         when --debug is specified.
15837 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
15839         * class.c (setup_generic_array_ifaces): Fix a warning.
15841 2006-09-04  Miguel de Icaza  <miguel@novell.com>
15843         * Temporarily remove the patch to assemly.c that checks the
15844         assembly versions as it breaks our gacutil.
15846 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
15848         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
15850         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
15851         a net 1.0 runtime.
15853         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
15854         created using the default ctor. Fixes #79152.
15855         (mono_string_builder_to_utf16): Ditto.
15857 2006-09-01  Martin Baulig  <martin@ximian.com>
15859         Fix handling of the generic array interfaces.
15861         * class-internals.h
15862         (MonoDefaults): Removed `generic_array_class' and added
15863         `generic_ilist' class.
15865         * class.c
15866         (mono_bounded_array_class_get): Add the new generic array interfaces.
15867         (setup_generic_array_ifaces): New static method; create vtable
15868         entries for each method in the generic array interfaces.
15870         * metadata.c
15871         (select_container): Allow "parent-less" generic methods.
15873         * marshal.c
15874         (mono_marshal_get_generic_array_helper): New public method.
15876         * icall.c
15877         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
15878         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
15879         moved the interncall into System.Array.
15881 2006-09-01  Raja R Harinath  <rharinath@novell.com>
15883         A few more cases of avoiding work on types with ->byref set.
15884         Has the real fix for #79238
15885         * icall.c (is_generic_parameter): New helper.
15886         (ves_icall_Type_GetGenericParameterPosition): Use it.
15887         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
15888         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
15889         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
15890         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
15891         reference types.
15892         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
15893         reference types.
15894         (ves_icall_Type_get_IsGenericInstance): Likewise.
15895         (ves_icall_Type_get_IsGenericType): Likewise.
15897 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
15899         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
15900         class if possible.
15902         * mempool.h (mono_mempool_get_allocated): New helper function.
15904         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
15905         change.
15907         * mempool.c: Fix warnings and the calculation of stats.
15909         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
15911         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
15913         * loader.c (mono_get_method_from_token): Update method_count stat.
15915         * class-internals.h (MonoStats): Add some stats.
15917 2006-08-31 Robert Jordan  <robertj@gmx.net>
15919         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
15920         with managed variants.
15921         All code is contributed under the MIT/X11 license.
15922         
15923 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
15925         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
15926         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
15928         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
15930         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
15931         with cycles in classes.
15933         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
15935         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
15936         missing a [MarshalAs] directive. Fixes #79203.
15938         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
15939         klass->marshal_info. Fixes #79217.
15941 2006-08-30  Martin Baulig  <martin@ximian.com>
15943         Committing a patch from Joachim Ante <joe@otee.dk>:
15944         Add support for binary data symbol stores.
15946         * debug-mono-symfile.c
15947         (mono_debug_open_mono_symbol_file): Renamed into
15948         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
15949         arguments.
15951         * mono-debug.c
15952         (mono_debug_open_image): Added `raw_contents' and `size' args.
15953         (mono_debug_init_2_memory): New public function.
15955 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
15957         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
15959 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15961         * appdomain.c: implement support for ShadowCopyFiles.
15963 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
15965         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
15966         when value is NULL (and should remove CID #51).
15968 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15970         * image.c: moved 2 functions to ../utils.
15972 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
15974         * gc.c: cope with the target object of a GC handle being NULL
15975         (bug #78877).
15977 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
15979         * class.c: recursively check parent's explicit implementations
15980         of interface methods (fixes bug #79125).
15982 2006-08-19  Miguel de Icaza  <miguel@novell.com>
15984         * filewatcher.c: Avoid warnings when building, do not redefine
15985         constants that are defined.
15987         Remove warnings.
15989 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15991         * image.c: don't fail when the link points to an absolute path.
15993 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
15995         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
15996         Fix CID #3.
15998 2006-08-17  Miguel de Icaza  <miguel@novell.com>
16000         * image.c (full_path): A new method used to obtain the actual path
16001         of an assembly even in the presence of symbolic links.  
16003         This is necessary for the case where we are running a binary that
16004         has been GACed, but we are using the "published" path name
16005         ($prefix/mono/1.0/blah.exe) which happens to point to the real
16006         file in the GAC.
16008         This was the source of the failure for the `xsp' command with the
16009         recent AppDomain changes, as far as the runtime was concerned,
16010         there were two different assemblies: $prefix/mono/1.0/blah.exe and
16011         $prefix/mono/gac/blah/version/blah.exe.
16013         (do_mono_image_open): use full path
16015 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16017         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
16019 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
16021         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
16022         domain_id is supplied. Fix CID #241 and corlib's unit tests.
16024 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16026         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
16027         small structures. Fixes #78990.
16029 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16031         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
16033         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
16035 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16037         * appdomain.c:
16038         * marshal.c: don't load all the assemblies from a domain into newly
16039         created ones. The new domains might have different rules and load
16040         assemblies from different locations. Fixes bug #76757.
16042         Patch by Lluis. Conflicts resolved by Brian Crowell.
16044 2006-08-16  Alp Toker  <alp@atoker.com>
16046         * socket-io.c: First half of the fix for #79084.
16047         Set sa_size to the length of the content, not that of the struct.
16048         Don't add NULL suffix to the content, this should be done in
16049         managed code if needed.
16051 2006-08-14  Raja R Harinath  <rharinath@novell.com>
16053         Fix part of #79012
16054         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
16055         mono_metadata_parse_type returns NULL.
16057 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
16059         * normalization-tables.h : new file for string normalization data.
16060         * locales.c, locales.h, icall.c :
16061           added load_normalization_resource() for string normalization,
16062           and icall as well.
16063         * Makefile.am : added normalization-tables.h to the sources.
16065 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
16067         * marshal.c: Add more helper functions to reduce code duplication and use them
16068         everywhere.
16070 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
16072         * marshal.c: Fix non-x86 stdcall warnings.
16073         
16074         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
16075         them everywhere.
16077 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
16079         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
16080         type check on multi-dimensional arrays. Fixes #79000.
16082 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
16084         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
16085         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
16086         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
16087         * class-internals.h: add is_com_object to class structure.
16088         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
16089         null checks to COM object marshalling. Fix .ctor call on RCW.
16090         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
16091         
16092         All code is contributed under the MIT/X11 license.
16094 2006-08-09  Dick Porter  <dick@ximian.com>
16096         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
16097         racing mono_monitor_allocator_lock() somewhere, so don't delete
16098         the critical section for now.  Found by running and exiting
16099         monodevelop.
16101 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
16103         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
16104         (ves_icall_System_ComObject_FindInterface): Ditto.
16105         (ves_icall_System_ComObject_CacheInterface): Ditto.
16107         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
16108         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
16110 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16112         * threadpool.c: treat pipes from process asynchronous reads as sockets
16113         when reading from them, so we get select/poll or epoll to wait for
16114         data.
16116 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
16118         * loader.c: Fix a typo (CID #233) in the null check.
16120 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
16122         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
16123         Hopefully fixes #78949.
16124         
16125         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
16126         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
16127         bytes. Fixes #78972.
16129 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16131         * filewatcher.c: we need to set errno here.
16133 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16135         * filewatcher.c: let Win32Exception get the error value.
16137 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16139         * filewatcher.c: translate errno into win32 errors for Win32Exception
16140         to know what happened.
16142 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
16144         * threadpool.c: Fix more warnings.
16146         * assembly.c (search_loaded): Fix warnings.
16148         * threadpool.c (mono_thread_pool_finish): Fix warnings.
16149         (mono_async_invoke): Ditto.
16151 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
16153         * object.c (mono_remote_class_vtable): Need to create proxy vtable
16154         entries for __ComObject type in addition to ComImport types.
16155         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
16156         about hash table.
16157         
16158         All code is contributed under the MIT/X11 license.
16160 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
16162         * image.c: avoid tentative loading of modulerefs that contain
16163         no metadata (P/Invoke library names).
16165 2006-07-28  Dick Porter  <dick@ximian.com>
16167         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
16168         mono_loader_lock() somewhere, so don't delete the critical section
16169         for now.  Found by running and exiting monodevelop.
16171 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16173         * filewatcher.c: define the inotify syscalls when we're building on
16174         linux and have sys/syscall.h. The build system might not have support
16175         for inotify but the target system might have it.
16177 2006-07-26  Miguel de Icaza  <miguel@novell.com>
16179         * domain.c: Documentation updates.
16181         * loader.c (mono_free_method): Do not release the method
16182         information if we are being profiled, as profilers will use this
16183         information at shut down to present some data to the user.
16185         This is needed so that the profiler does not crash, as the
16186         profiler tends to keep MonoMethods around, and they might become
16187         invalid if we free these.
16189         (mono_get_method_constrained): Return the original CIL stream
16190         method as well, so verification can be performed against it.
16192 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16194         * filewatcher.[ch]: support for inotify file system watcher.
16195         * icall.c: add new internal calls for the inotify file system watcher.
16197 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16199         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
16200         #78888.
16202 2006-07-20  Dick Porter  <dick@ximian.com>
16204         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
16205         warning.
16207 2006-07-20  Dick Porter  <dick@ximian.com>
16209         * threads.c (start_wrapper): Do the thread cleanup while we still
16210         hold a reference to its object.  Fixes bug 78123.
16212 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
16214         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
16215         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
16216           "managed-to-managed".
16217         * icall.c: Redirect string constructors that take sbyte* to
16218           ves_icall_System_String_ctor_RedirectToCreateString.
16219         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
16220           to CreateString () methods with matching signature.
16221         * reflection.c: Use original security informations for
16222           MONO_WRAPPER_MANAGED_TO_MANAGED.
16223         * security-manager.c: Use original security informations for
16224           MONO_WRAPPER_MANAGED_TO_MANAGED.
16225         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
16226           that is a placeholder and only its address should be used.
16227         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
16228           that is a placeholder and only its address should be used.
16230 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
16232         Begin implementing COM Interop.
16233         * appdomain.c: Increment corlib version.
16234         * class.c: Set ComImport classes' parent to __ComObject.
16235         * loader.c: Mark cominterop methods as such.
16236         * domain.c: Add __ComObject class to MonoDefaults structure.
16237         * image.c: Add 2 hashtables to the image for COM Interop related methods
16238         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
16239         using the mempool allocator
16240         
16241         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
16242         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
16243         declaration for mono_metadata_type_dup_mp.
16244         
16245         * debug-helpers.c: Added strings for two additional wrapper types
16246         * object.c: Create proxy objects for ComImport classes
16247         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
16248         and added __ComObject class to MonoDefaults structure.
16249         
16250         * object-internals.h: Finish MonoRealProxy definition, and add definition of
16251         MonoComInteropProxy and MonoComObject.
16252         
16253         * marshal.c: Added support for COM Interop
16254         (signature_cominterop): Converts managed signature to corresponding
16255         unmanaged COM signature.
16256         (cominterop_get_function_pointer): gets unmanaged function pointer via
16257         COM object vtable
16258         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
16259         (cominterop_get_method_interface): returns interface type that method is defined on
16260         (mono_mb_emit_cominterop_call): emits native call to function pointer
16261         gotten from vtable
16262         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
16263         that matches signature of unmanaged function.
16264         (cominterop_get_native_wrapper): wrapper around adjusted method call.
16265         (cominterop_get_invoke): forwards call from proxy to __ComObject
16266         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
16267         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
16268         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
16269         
16270         * marshal.h: Added Marshal icall declarations.
16271         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
16272         so we can access them in finalizer
16273         
16274 2006-07-14  Dick Porter  <dick@ximian.com>
16276         * object.c (mono_type_initialization_cleanup): Fix a race
16277         condition by temporarily commenting out the critical section
16278         deletion.
16280 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
16282         * reflection.c (create_custom_attr): Fix some warnings.
16283         (create_custom_attr_data): Ditto.
16284         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
16285         types. Fixes #78855.
16287 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
16289         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
16291         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
16293 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
16295         * reflection.c (resolve_object): Add support for DynamicMethod.
16297         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
16298         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
16300 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
16302         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
16303         don't leak GPtrArray's pdata has we have no use (nor free) for it.
16305 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
16307         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
16308         Fixes #77888.
16310 2006-06-30  Raja R Harinath  <rharinath@novell.com>
16312         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
16313         slightly: remove a shadow local variable.
16315 2006-06-29  Raja R Harinath  <rharinath@novell.com>
16317         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
16318         definition that introduces the virtual function slot.
16319         Also fix Coverity #105.
16321 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
16323         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
16324         for dynamic assemblies. Fixes #78724.
16326 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
16328         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
16329         Fixes #78722.
16331 2006-06-21  Martin Baulig  <martin@ximian.com>
16333         * reflection.c
16334         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
16335         fixes #76484.
16337 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
16339         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
16341 2006-06-20  Raja R Harinath  <rharinath@novell.com>
16343         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
16344         nor TYPEREFs.
16345         * class.c (mono_class_create_from_typespec): Add 'context' argument.
16346         Inflate result if necessary.
16347         (mono_class_get_full): Remove old version.  Rename from
16348         'mono_class_get' and add 'context' argument.  Pass it to
16349         ..._create_from_typespec.
16350         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
16351         (mono_ldtoken): Revert change below.
16353 2006-06-20  Martin Baulig  <martin@ximian.com>
16355         * class.c (mono_ldtoken): Don't pass the generic context to
16356         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
16358 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
16360         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
16361         and later freeing it. Fixes #78638.
16363 2006-06-15  Miguel de Icaza  <miguel@novell.com>
16365         * icall.c (mono_class_get_throw): Revert over-zealous error
16366         throwing, the caller for mono_class_get_throw will cope with
16367         errors when classes are not properly initialized already.
16369         The code still copes with loader exceptions though.
16371         Fixes the regression in reftype1 and reftype3 from the CAS tests.
16372         
16373 2006-06-14  Miguel de Icaza  <miguel@novell.com>
16375         Fixes the `make run1' version of RuntimeAbort (to be commited,
16376         source is in Bugzilla).
16377         
16378         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
16379         FALSE on class loading failure instead of returning true.
16381         * class.c (mono_class_create_from_typedef): It is possible for
16382         mono_metadata_interfaces_from_typedef_full to fail if a class is
16383         not found, cope with this.
16384         
16386 2006-06-14  Dick Porter  <dick@ximian.com>
16388         * socket-io.c: 
16389         * process.c: Fix a bunch of signed/unsigned warnings from gcc
16390         4.1.1
16392 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
16394         * culture-info-table.h : oops, forgot to make it nsync with r61548.
16396 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
16398         * icall.c: Another fix for building mono in Visual Studio.
16400 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
16402         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
16403         
16404 2006-06-09  Martin Baulig  <martin@ximian.com>
16406         * debug-mono-symfile.c: Put this back and really fix it this
16407         time. Sorry for all the trouble.
16409 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
16411         * icall.c (mono_class_get_throw): Fix a warning.
16412         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
16413         ReflectionTypeLoadException if needed. Fixes #78606.
16415         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
16416         (mono_class_init): Ditto.
16418         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
16419         ref_only exceptions.
16420         (mono_loader_clear_error): Make this work even if there is no error.
16422 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
16424         * object-internals.h marshal.c marshal.h icall.c: Implement method 
16425         Marshal.GetComSlotForMethodInfo using internal call.
16427 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
16429         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
16430         a function for signalling it.
16432         * class.c (mono_class_from_typeref): Use the new kind of loader error when
16433         a referenced assembly is not found.
16435         * loader.c (mono_loader_error_prepare_exception): Add support for 
16436         LOADER_ERROR_ASSEMBLY. Fix formatting.
16438 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
16440         * domain.c appdomain.c class-internals.h marshal.c: Add support 
16441         for VARIANT marshalling on windows and increment corlib version
16442         since Variant struct was added.
16444 2006-06-03  Miguel de Icaza  <miguel@novell.com>
16446         * debug-mono-symfile.c: Revert Martin's previous patch which broke
16447         stack trace line information:
16449         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
16450         (Martin) when looking up B which is between A and C, return A not C.
16452         Bug is #78573.
16454         Thanks to Alexander Olk for tracking this down.
16456 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
16458         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
16459         
16460         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
16461         avoid clobbering its value.
16462         (mono_string_to_lpstr): Fix a warning on windows.
16464 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
16466         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
16468         * reflection.c loader.c: Removed references to 'dummy' flag.
16470         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
16472         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
16473         it gets GC tracking.
16475         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
16476         GC tracking.
16477         
16478         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
16480         * marshal.c threadpool.c: Update callers of mono_async_result_new.
16482         * appdomain.c: Bump corlib version.
16484 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
16486         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
16487         CEE_STIND_REF when working with object references.
16489 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
16491         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
16492         Fixes #78539.
16494 2006-05-30  Miguel de Icaza  <miguel@novell.com>
16496         * loader.c (method_from_memberref): Fix argument value for
16497         mono_loader_set_error_method_load (I was passing the MonoClass
16498         instead of the class name char *).
16500 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
16502         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
16503         CEE_STIND_REF when working with object references.
16505 2006-05-30  Martin Baulig  <martin@ximian.com>
16507         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
16508         mono_method_full_name() change and replace the ':' with a '.'
16509         here.
16511 2006-05-30  Martin Baulig  <martin@ximian.com>
16513         * debug-mono-symfile.c
16514         (mono_debug_symfile_lookup_location): Fix the algorithm:
16515         when looking up B which is between A and C, return A not C.
16517 2006-05-29  Martin Baulig  <martin@ximian.com>
16519         * mono-debug.h
16520         (MonoDebugMethodInfo): Make the typedef public.
16521         (MonoDebugSourceLocation): New public struct.
16523         * mono-debug.c
16524         (mono_debug_source_location_from_address): Removed.
16525         (mono_debug_source_location_from_il_offset): Removed.
16526         (mono_debug_il_offset_from_address): Removed.
16527         (mono_debug_address_from_il_offset): Removed.
16528         (mono_debug_lookup_method): New public function.
16529         (mono_debug_lookup_source_location): New public function; replaces
16530         the old mono_debug_source_location_from_*() functions; see the
16531         inline documentation.
16532         (mono_debug_free_source_location): New public function.
16533         (mono_debug_print_stack_frame): New public function; see the
16534         inline documentation.
16536         * debug-mono-symfile.c
16537         (mono_debug_find_source_location): Renamed into
16538         mono_debug_symfile_lookup_location(); only take a
16539         `MonoDebugMethodInfo *' and an `offset' argument; added inline
16540         documentation.
16541         (mono_debug_find_method): Renamed into
16542         mono_debug_symfile_lookup_method().
16544 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
16546         * assembly.c (mono_assembly_open_full): Dont overwrite the status
16547         returned by mono_image_open_full ().
16549         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
16550         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
16551         #78517.
16553         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
16554         #78518.
16556 2006-05-27  Miguel de Icaza  <miguel@novell.com>
16558         * class.c (mono_class_from_typeref): handle missing images
16559         earlier, deals with bug #78418.   Refactor code; 
16561         Fix a warning introduced in my previous commit (some stale code
16562         from before I revisited my patch).
16564         * class.c (mono_class_create_from_typedef): On failure, remove the
16565         class from the MonoImage->class_cache as the class is not
16566         initialized;   Fixes the leak pointed out by Paolo.
16568 2006-05-25  Dick Porter  <dick@ximian.com>
16570         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
16571         DeleteCriticalSections until I figure out which one may still be
16572         sometimes locked when mono_thread_cleanup is called.
16574 2006-05-24  Dick Porter  <dick@ximian.com>
16576         * threads.c (mono_thread_cleanup): Move the threading cleanup out
16577         of mono_thread_manage and back into its own function, so it can be
16578         called after the finalizer thread has finished.
16580         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
16582 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
16584         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
16585         Fixes #78495.
16587         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
16588         with non-blittable elements.
16589         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
16591 2006-05-24  Martin Baulig  <martin@ximian.com>
16593         * mono-debug-debugger.h (MonoDebuggerEvent): Added
16594         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
16596         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
16597         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
16598         `mono_debugger_event_handler' to NULL.
16600 2006-05-24  Martin Baulig  <martin@ximian.com>
16602         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
16604 2006-05-24  Martin Baulig  <martin@ximian.com>
16606         * mono-debug-debugger.h
16607         (mono_debugger_create_notification_function): Added
16608         `MonoCodeManager *' argument.
16610 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
16612         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
16614 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
16616         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
16617         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
16618         implementation.
16620 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
16622         * icall.c: precise GC support: objects can't be stored in unmanaged
16623         memory anymore, even if they are kept alive by other references: since
16624         they can move the GC needs to be able to always find them.
16626 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
16628         * object.c: precise GC support for static fields. Support
16629         for moving GCs: write barriers and pinned allocation for interned
16630         strings.
16632 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
16634         * domain.c, domain-internals.h: precise GC support for the MonoDomain
16635         structure.
16637 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
16639         * class.c, gc.c: sgen and precise GC updates.
16641 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
16643         * marshal.h, marshal.c: added write barrier wrapper and precise type
16644         fixes.
16646 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
16648         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
16649         support.
16651 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
16653         * reflection.c: precise and sgen GC updates.
16655 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
16657         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
16659 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
16661         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
16663 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
16665         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
16666         MONO_TYPE_OBJECT. Fixes #78462.
16668 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
16670         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
16671         and blittable types.
16673 2006-05-17  Miguel de Icaza  <miguel@novell.com>
16675         * class.c (mono_class_get_exception_for_failure): Implement parts
16676         of a TODO: if the loader error is set (instead of the class
16677         error), we return a Loader exception that can be properly thrown
16678         elsewhere.
16680         This was exposed by some Winforms 2.0 code that I tried to run
16681         (Atsushi pointed me to it).
16683 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
16685         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
16686         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
16687         
16688         * marshal.c (emit_marshal_vtype): Add limited support for 
16689         UnmanagedType.LPStruct. Fixes #78427.
16691         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
16692         Applied a patch from kangaroo to fix #77523.
16694 2006-05-17  Martin Baulig  <martin@ximian.com>
16696         * threads.c
16697         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
16698         (debugger_thread_created): Removed.
16699         (debugger_thread_exited): Removed.
16701 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
16703         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
16705         * object-internals.h (MonoReflectionResource): Sync with managed version.
16707 2006-05-12  Wade Berrier <wberrier@novell.com>
16709         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
16711 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
16713         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
16714         functions try to allocate from the image mempool.
16716 2006-05-12  Dick Porter  <dick@ximian.com>
16718         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
16720 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
16722         * object.c: The FieldGetter and FieldSetter methods require the full
16723         name of the class, not only the name. Fixes bug #78277.
16725 2006-05-11  Miguel de Icaza  <miguel@novell.com>
16727         * loader.c (method_from_memberref): Do not pass the NULL klass to
16728         mono_loader_set_error_() methods.  Pass the non-NULL value
16729         (class). 
16731 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
16733         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
16734         (mono_assembly_close): Null out assembly->image->references after freeing it.
16736         * image.c (mono_image_close): Free image->references.
16737         
16738         * reflection.c (mono_image_basic_init): Fix a small memory leak.
16740 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
16742         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
16743         before checking if it's NULL (g_assert).
16745 2006-05-10  Martin Baulig  <martin@ximian.com>
16747         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
16748         I thought I already killed that two months ago, but now it somehow reappeared.
16750 2006-05-10  Martin Baulig  <martin@ximian.com>
16752         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
16754 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
16756         * reflection.c: Allocate memory for dynamically created methods in the image
16757         mempools.
16759 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
16761         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
16762         don't use the ad pointer before checking if it's NULL (g_assert).
16764 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
16766         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
16767         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
16769         * marshal.c: Allocate all signatures from mempools.
16771         * marshal.c: Allocate some more signatures from mempools.
16773 2006-05-09  Miguel de Icaza  <miguel@novell.com>
16775         * object.c (mono_load_remote_field): The code used to provide a
16776         temporary variable for returning results if the user did not
16777         provide a result pointer.  But our temporary variable was allocted
16778         on the satck.
16780         Fix calling code to always pass a result area.   Coverity ID 103.
16782 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
16784         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
16785         value, not the old. Fixes #78312.
16786         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
16788         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
16789         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
16790         per-image cache.
16792         * assembly.c (mono_assembly_close): Free image->references.
16794         * assembly.c (mono_assembly_names_equal): Fix a warning.
16795         (mono_assemblies_cleanup): Cleanup more global data.
16797         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
16799         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
16800         ptr_cache and image->modules.
16802         * image.c (mono_image_init): Allocate array_cache lazily.
16803         
16804 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16806         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
16807         behavior was changed recently and has bad side effects.
16809 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
16811         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
16812         
16813         * assembly.c (mono_assembly_close): Remove a debug printf.
16815         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
16817         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
16818         to also allow for temporary references between mono_image_open ()/close ().
16820         * domain.c (get_runtimes_from_exe): Add a FIXME.        
16822 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
16824         * marshal.c: Fix support for dynamic methods.
16826         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
16828         * marshal.c (mono_marshal_cleanup): New cleanup function.
16830         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
16831         image mempools.
16833         * class.c (mono_class_init): Fix leaking class->nested_classes.
16835         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
16837         * image.c (mono_image_init): Initialize the new cashes.
16839         * image.c (mono_image_close): Destroy the new cashes.
16841         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
16843         * mempool.c (mono_mempool_strdup): New helper function.
16845         * class-internals.h: Add prototype for mono_loader_unlock ().
16847         * domain.c (mono_jit_info_table_find): Fix a warning.
16848         (mono_debugger_check_runtime_version): Ditto.
16850         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
16851         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
16852         functions to these modules.
16854         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
16855         metadata modules.
16856         
16857         * marshal.c (mono_free_bstr): Fix a warning.
16859         * assembly.c (mono_assembly_open_full): Fix another small leak.
16861         * object.c: Fix some unload leaks in the remoting code.
16863         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
16864         function.
16866         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
16868         * reflection.c: Fix some unload leaks in dynamic assemblies.
16870 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
16872         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
16873         * marshal.h: Add BSTR support on Win32
16874         * icall.c: Add BSTR icalls
16875         * metadata.h: Add BSTR enums
16877 2006-04-28  Miguel de Icaza  <miguel@novell.com>
16879         Work to catch the crash from #76795 and turn it into an
16880         exception.   As I stubbed out pieces of the VisualBasic support,
16881         I found a number of places where the code was failing and I added
16882         checks to those places. 
16883         
16884         * metadata.c (do_mono_metadata_parse_generic_class): Make this
16885         function return a status code.  If we fail to parse the signature
16886         from mono_metadata_parse_generic_inst, return FALSE.
16888         * loader.c (mono_get_method_from_token): If we fail to load the
16889         method (mono_class_get) return NULL.   
16891         * (method_from_memberref): Return NULL if we are unable to parse
16892         the method signature
16894         (mono_loader_error_prepare_exception): Since we now use the
16895         loader_error flag internally to stop processing, and obtaining
16896         exceptions that might be thrown will walk this code path the
16897         proper way of going from a MonoLoaderError into a
16898         MonoException was convoluted.   This new routine encapsulates the
16899         process of turning the error into an exception and *clearing* the
16900         error afterwards.
16901         
16902 2006-04-27  Miguel de Icaza  <miguel@novell.com>
16904         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
16905         with missing assemblies), and to cope with:
16907                 * Missing fieldref from a non-existing assembly.
16908                 * Missing methodref from a non-existing assembly.
16910         The first batch of work to address *some* of the issues from 76661.
16911         
16912         * object.c (mono_class_create_runtime_vtable): If we fail to
16913         initialize the class raise the exception here. 
16915         * metadata.c (mono_class_get_overrides_full): If any methods fail
16916         to load return the failure to the caller.
16918         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
16919         flagging assemblies that failed to load.   
16921         Do not crash if we are unable to load the assembly.
16923         (mono_assembly_close): Do nothing with REFERENCE_MISSING
16924         assemblies. 
16926         * loader.c (mono_loader_set_error_type_load): Change the
16927         convention to always pass unallocated strings, so we make our own
16928         copies (I know our own code had duplicated strings before, but
16929         this keeps the normal conventions).
16930         (method_from_memberref): Call mono_loader_set_error_method_load
16931         for all possible failures of loading the class. 
16932         Remove assert, turn into a loader error.
16934         (mono_loader_error_to_exception): Move this routine from mini
16935         (mini_loader_error_to_exception) there was no need to have that in
16936         mini. 
16938         * class.c (mono_class_from_typeref): If we were not able to load
16939         the assembly with mono_assembly_load_reference, call the
16940         mono_loader_set_error_type_load to register the problem.
16942         (mono_class_setup_fields): If we fail to load the type from
16943         mono_metadata_parse_type_full, call mono_class_set_failure and
16944         break from the loop.
16946         If class->exception_type is set, we do not layout the fields as
16947         that might crash the runtime, and instead return (from breaking
16948         from the previous loop).
16950         (mono_class_setup_vtable): This now returns a boolean indicating
16951         whether the table was properly setup.   The decision is driven by
16952         mono_class_get_overrides_full which might run into non-existing
16953         methods. 
16954         
16955         (mono_class_init): Returns TRUE on success or FALSE if there was a
16956         problem in loading the type (incorrect assemblies, missing
16957         assemblies, methods, etc).
16959         When we call mono_class_setup_fields we also check for a potential
16960         error inside this call (either a class exception or a general
16961         loader exception).
16963         (mono_class_create_from_typedef): If the parent fails to load
16964         (calling mono_class_get_full) return NULL.
16965         
16966         ** Important **
16968         calls to mono_metadata_parse_type_full should be checked
16969         everywhere and set the mono_class_set_failure
16970         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
16972         The current patch checks the places where my manually constructed
16973         tests show the errors are showing up, but we should do it
16974         everywhere. 
16976         ** Important2 **
16978         mono_class_init return values should be tested everywhere, like
16979         the previous case this is something that we should audit
16980         everywhere and not only on the cases exposed by the tests I
16981         created. 
16983 2006-04-26  Miguel de Icaza  <miguel@novell.com>
16985         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
16986         boolean parameter and instead pass the information on `options'
16987         parameter (FileOptions).
16989         * icall.c: Register the new signature for MonoIO.Open.
16991         * debug-helpers.c (dis_one): Trying to understand how coverity
16992         works.  Fix Run 5, item 78.
16994 2006-04-26  Dick Porter  <dick@ximian.com>
16996         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
16997         dereference.
16999 2006-04-25  Martin Baulig  <martin@ximian.com>
17001         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
17003         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
17004         debugger_thread_created().
17005         (debugger_gc_push_all_stacks): Don't handle the main thread in any
17006         special way.
17007         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
17008         (mono_debugger_finalize_threads): New function; undo the effects
17009         of mono_debugger_init_threads().
17010         (mono_debugger_create_all_threads): Removed.
17012 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
17014         * image.c (mono_image_close): Tidy up trace messages.
17016         * assembly.c (mono_assembly_close): Ditto.
17018         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
17019         no longer references an already freed assembly. Fixes #78168.
17021 2006-04-21  Dick Porter  <dick@ximian.com>
17023         * threads.c (mono_thread_detach): Fix reference counting when
17024         detaching threads.
17026 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
17028         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
17029         #78155.
17031 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
17033         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
17034         (mono_type_to_stind): Ditto.
17036         * marshal.c: Use the new helper functions to simplify code.
17038         * image.c (mono_image_close): Add some code for help debug assembly unloading
17039         problems.
17041         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
17042         image mempool.
17044         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
17045         assembly was already loaded in another appdomain. Fixes #78083.
17047 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
17049         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
17050         referenced assemblies.
17051         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
17053         * domain.c (mono_domain_free): Add a trace message.
17055         * appdomain.c (add_assemblies_to_domain): Ditto.        
17057         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
17058         field.  
17060 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
17062         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
17064 2006-04-12  Martin Baulig  <martin@ximian.com>
17066         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
17067         `USE_INCLUDED_LIBGC'.   
17069 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
17071         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
17072         the patch contains ../ and a small directory name later. Hopefully fixes
17073         #78035.
17075 2006-04-10  Martin Baulig  <martin@ximian.com>
17077         Clean up the debugger's thread-handling code.
17079         The debugger's thread-handling code has been moved from
17080         ../mini/debug-debugger.c to threads.c.  We now iterate directly
17081         over the `threads' hash, keep track of exiting threads and also
17082         use proper locking.
17084         We can now debug XSP and XSP based applications with the debugger.
17086         * object-internals.h (MonoThread): Added `gpointer end_stack'.
17088         * threads.h
17089         (MonoThreadCallbacks): Removed; this was only used by the debugger.
17090         (mono_install_thread_callbacks): Likewise.      
17092         * threads.c (mono_thread_callbacks): Removed.
17093         (debugger_thread_created, debugger_thread_exited): New static functions.
17094         (start_wrapper): Call debugger_thread_created().
17095         (thread_cleanup): Call debugger_thread_exited().
17096         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
17097         (mono_debugger_init_threads): New public function.
17098         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
17099         iterate directly over the `threads' hash and also use proper locking.
17101         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
17103         * mono-debug-debugger.h
17104         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
17106 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
17108         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
17109         argument type=array. Fixes #78057.
17111 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
17113         * culture-info-table.h : regenerated. Fixed bug #69652.
17115 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
17117         * loader.c metadata.c: Reapply a variant r59116.
17118         
17119         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
17121         * class.c (mono_class_setup_interface_offsets): New internal function.
17123         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
17124         interfaces too. Fixes #77398.
17126         * reflection.c (encode_cattr_value): Add support for 
17127         parameter type=object, argument type=array.
17128         (load_cattr_value): Ditto. Fixes #77916.
17130         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
17131         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
17133         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
17134         a byval char array and CharSet is Ansi.
17136         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
17138 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
17140         * metadata.c: Add some locking comments.
17141         
17142         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
17143         mempool.
17144         (mono_metadata_free_method_signature): Don't free the signature itself.
17146         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
17148         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
17149         reference the same MonoImage.
17150         (mono_assembly_load_from_full): Add an assert.
17152 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
17154         * image.c (mono_image_close): Don't put the image we are about to free into the
17155         loaded_images_guid_hash.
17157         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
17158         to reduce code duplication.
17160         * marshal.c: Register the native functions called by this module as icalls, to
17161         somewhat centralize the creation of MonoMethodSignature's.
17163         * loader.c (mono_method_signature): Add a cache for method signatures.
17165         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
17166         the parameter attributes of a method.
17167         (mono_metadata_parse_method_signature_full): Refactored the computation of
17168         parameter attributes into a separate function. Also avoid one allocation in
17169         most cases.
17171         * assembly.c (mono_assembly_close): Ditto.
17173         * image.c (mono_image_close): Log trace messages with INFO level.
17175         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
17177         * image.c reflection.c: Correct reference counting of image modules.
17178         
17179         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
17180         of this function from the image mempool.
17181         
17182         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
17183         to allow more cached types to be used.
17185         * mono-debug.c (mono_debug_add_method): Appled patch from
17186         David S. Miller  <davem@sunset.davemloft.net>: Access 
17187         minfo->lexical_blocks[] entry elements using read32().
17189 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
17191         * loader.c (mono_free_method): No longer free the method header for non-dynamic
17192         methods as it is allocated from the mempool.
17194         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
17195         image mempool.
17197         * metadata-internals.h: Add comments describing the reference counting scheme
17198         used for MonoImage and MonoAssembly.
17200         * image.c assembly.c reflection.c: Rework reference counting of images and 
17201         assemblies so they are freed when the runtime is shut down. Free some 
17202         additional memory structures when an image is unloaded.
17203         
17204 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
17206         * class.c loader.c reflection.c: Allocate more data structures in
17207         the image mempool.
17209 2006-03-31  Miguel de Icaza  <miguel@novell.com>
17211         * icall.c
17212         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
17213         build on pre glib 2.4 systems.
17215 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
17217         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
17219         * icall.c: Fix some warnings.
17221 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
17223         * culture-info-table.h : regenerated.
17225 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
17227         * threads.c, object-internals.h, verify.c: changed the culture caching
17228         code to use a normal MonoArray for storage so the GC can keep track of
17229         them easily. Fixed bits of the cache logic, too and simplified the
17230         code.
17232 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
17234         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
17235         thread for non-Boehm GCs.
17237 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
17239         * domain.c, object.c, domain-internals.h: reduce the amount of memory
17240         needed to keep track of the data for static fields.
17242 2006-03-29  Raja R Harinath  <rharinath@novell.com>
17244         Fix #75172
17245         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
17246         for interface classes.  Use 'num_methods' instead.
17247         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
17248         before using '->vtable_size' field.
17250 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
17252         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
17253         doesn't contain managed pointers, so use a normal hashtable.
17255 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
17257         * reflection.c, class-internals.h, domain.c: fixed handling of types
17258         used as values for objects in custom attributes (bug #77915):
17260 2006-03-24  Martin Baulig  <martin@ximian.com>
17262         * class.c (mono_class_setup_fields): Added support for generic
17263         instances; fixes #77580.
17265 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17267         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
17269 2006-03-24  Dick Porter  <dick@ximian.com>
17271         * file-io.c (get_file_attributes): More stat macro breakage.
17272         Fixes bug 77759.
17274 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
17276         * profiler.c: added the file=filename option in the default profiler
17277         to output the profile data to filename.
17279 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17281         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
17282         bug #77877.
17284 2006-03-22  Martin Baulig  <martin@ximian.com>
17286         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
17287         allocated `MonoClassField *' in `fb->handle'.
17289 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
17291         * class.c, image.c, metadata-internals.h: implemented new mechanism to
17292         allocate interface ID to save memory and allow better ID reuse on
17293         appdomain unload. setup_generic_vtable () removal from Martin.
17295 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
17297         * object.h, appdomain.c, domain.c, exception.c, icall.c,
17298         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
17299         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
17300         write barriers for reference stores with managed objects accessed with
17301         C structures in the runtime and in embedding programs.
17303 2006-03-20  Raja R Harinath  <rharinath@novell.com>
17305         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
17306         'interface_id' and 'max_interface_id' fields of MonoClasses
17307         representing open generic types.
17309 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
17311         * object.h, object.c, icall.c: added functions to deal with
17312         storing valuetypes that contain references in managed objects.
17313         * reflection.c, string-icalls.c, threads.c, marshal.c: small
17314         fixes and comments around uses of mono_array_addr ().
17316 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
17318         * object.h, icall.c, monitor.c: object.GetHashCode ()
17319         implementation that supports the moving garbage collector.
17321 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
17323         * icall.c, threads-types.h, threads.c: implemented finalizer for
17324         LocalDataStoreSlot.
17326 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
17328         * metadata.c (mono_type_size): Add a fixme.
17329         (mono_type_stack_size): Ditto.
17331         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
17332         'type_forwarders' field.
17334         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
17335         attribute from net 2.0.
17337         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
17338         from class.c.
17340         * class.c (mono_class_setup_fields): Fix a warning.
17341         
17342         * class.c (mono_class_from_name): Add support for assemblyref entries
17343         in the EXPORTEDTYPE table.
17345         * reflection.c: Add support for handling type forwarders under net 2.0.
17347         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
17348         
17349 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
17351         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
17352         overwriting entries in ModuleBuild->types, also clean up the code
17353         a little. Fixes #77774.
17355 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
17357         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
17358         load friend assembly info when present.
17360 2006-03-14  Raja R Harinath  <rharinath@novell.com>
17362         Fix crasher on gtest-158.cs.
17363         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
17364         the return value if the MonoClass we want is yet in an
17365         inconsistent state.
17366         * class.c (mono_class_create_from_typedef): Add an comment
17367         explaining an order dependency between mono_class_setup_parent and
17368         mono_class_setup_mono_type.
17370 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
17372         * class.c: documentation updates and events bug fix.
17374 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
17376         * class.c: some cleanup, locking fixes.
17378 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
17380         * class.c: fix the generics code to setup nested
17381         type info to the instantiated type (bug #77770).
17383 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
17385         * marshal.c: fixed a few type correctness issues.
17387 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
17389         * loader.c: the Set/Get/Addrtess array methods should be public.
17391 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
17393         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
17394         
17395         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
17396         info->wrapper.
17398 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
17400         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
17402         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
17404         * mempool.c (mono_mempool_alloc): Speed this up a bit.
17405         (mono_mempool_alloc0): Ditto.
17407 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17409         * socket-io.c:
17410         (create_object_from_sockaddr): it was allocating 4 extra bytes
17411         for the AF_UNIX data. Fixes bug #77747.
17413 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
17415         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
17417 2006-03-09  Dick Porter  <dick@ximian.com>
17419         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
17420         Fixes bug 76966 again.
17422 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
17424         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
17425         names from r57532
17426         * appdomain.c: Bumped corlib version to 48 (due to r57532)
17428 2006-03-07  Martin Baulig  <martin@ximian.com>
17430         * object.c
17431         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
17433 2006-03-07  Martin Baulig  <martin@ximian.com>
17435         * class.c
17436         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
17437         regression introduced in r56970; see gtest-252.cs.
17439         * loader.c (mono_get_method_constrained): Correctly handle generic
17440         methods; see gtest-253.cs.
17442 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
17444         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
17446 2006-03-04  Martin Baulig  <martin@ximian.com>
17448         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
17449         compute the parent type at runtime, just like we're already doing
17450         it for interfaces.
17452         * reflection.c
17453         (mono_reflection_bind_generic_parameters): Don't compute the
17454         parent type anymore.
17456         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
17458 2006-03-04  Martin Baulig  <martin@ximian.com>
17460         * mono-debug-debugger.h
17461         (mono_debugger_create_notification_function): Allocate memory at
17462         runtime and return a pointer to it.
17464 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
17466         * assembly.c: Fix windows build.
17467         
17468         * assembly.c: Fix build.
17470         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
17472         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
17473         
17474 2006-03-03  Dick Porter  <dick@ximian.com>
17476         * process.c
17477         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
17478         Check parameters before dereferencing them.  Fixes Aaron's part of
17479         bug 77393.
17481 2006-03-03  Raja R Harinath  <rharinath@novell.com>
17483         Fix performance regression.
17484         * loader.c (find_method_in_class): Add 'from_class' argument.
17485         Rename 'klass' argument to 'in_class'.  The signature is compared
17486         against the method in 'in_class', and the corresponding method is
17487         returned from 'from_class'.
17488         (find_method): Walk both 'in_class' and 'from_class' in parallel.
17489         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
17490         type definition and generic instantiation in parallel.
17491         (mono_get_method_constrained): Update to changes.
17493 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
17495         * threads.c: make sure the domain is correct, too when doing
17496         mono_thread_attach ().
17498 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
17500         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
17501         windows. Fixes #77683.
17503 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
17505         * object.h, *: introduced specific way to set elements of an array
17506         of references to be used as write barrier. Still need to audit the
17507         uses of mono_array_addr.
17509 2006-03-01  Miguel de Icaza  <miguel@novell.com>
17511         * object-internals.h: New field to cache the assmebly name, patch
17512         from Tambet Ingo (tambet@ximian.com)
17514 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
17516         * decimal.h, class-internals.h, metadata-internals.h,
17517         file-io.h: mark a few function declarations as internal, to
17518         reduce the number of PLT entries.
17520 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17522         * file-io.c: fix typo in warning message.
17524 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
17526         * loader.c: on unix, lookup the "*A" version of a function
17527         if charset is auto as a second option before failing.
17529 2006-02-28  Raja R Harinath  <rharinath@novell.com>
17531         * class.h (mono_class_inflate_generic_method): Revert to two
17532         argument version.
17533         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
17534         (mono_class_inflate_generic_method_full): Add.
17535         * class.c (mono_class_inflate_generic_method_full): Rename from
17536         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
17537         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
17538         * loader.c, reflection.c: Update to changes.
17540 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
17542         * icall.c: const fixes and small improvements.
17544 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17546         * threadpool.c: for asynchronous connect(), enable the same workaround
17547         for BSD 6 as for the Mac. Fixes bug #77637.
17549 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
17551         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
17552         formatted classes. Fixes #77524.
17554 2006-02-24  Raja R Harinath  <rharinath@novell.com>
17556         * class.c (inflate_generic_type): Add a couple more
17557         micro-optimizations.
17558         (inflate_generic_context): Don't use the 'gmethod' from
17559         'inflate_with'.
17560         (mono_class_inflate_generic_method): If the method has generic
17561         parameters, but the passed-in context doesn't have a 'gmethod',
17562         create one.  Use the possibly simplified generic instantiation
17563         from the declaring class instead of the one passed in.
17565 2006-02-24  Raja R Harinath  <harinath@gmail.com>
17567         Make generic method signature and method header handling lazy.
17568         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
17569         (inflate_generic_header): Likewise.
17570         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
17571         parameter to avoid inflating types.
17572         (mono_get_inflated_method): Empty out.
17573         * class.h (mono_class_inflate_generic_method): Update to changes.
17574         * loader.c (mono_get_method_from_token): Don't parse signature for
17575         generic methods, nor methods of generic classes.
17576         (mono_method_signature): Rename from 'mono_method_signature'.
17577         Inflate signature on demand.
17578         (mono_method_get_header): Inflate method header on demand.
17579         * reflection.c: Update to changes.
17581 2006-02-23  Raja R Harinath  <rharinath@novell.com>
17583         * metadata.c (mono_metadata_inflate_generic_inst): If the
17584         instantiation is closed, don't bother expanding it in the new
17585         context.
17586         * class.c (inflate_generic_class): If the generic instantiation
17587         doesn't change after inflation, return the argument itself.
17588         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
17589         Add bounds checks.
17590         (inflate_generic_context): If neither the generic class nor the
17591         generic method instantiations change, return the original context.
17592         * reflection.c (mono_method_get_object): Do
17593         'mono_get_inflated_method' before accessing the ->klass field.
17594         (inflate_mono_method): Don't create a MonoGenericMethod unless
17595         necessary.
17596         (inflate_method): Don't pass a constructed type as the declaring
17597         type of a methodbuilder.
17599 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
17601         * object.c: fix memory overwrite.
17603 2006-02-22  Dick Porter  <dick@ximian.com>
17605         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
17606         it doesn't work any more.
17607         (mono_threads_request_thread_dump): Fix unused variable warnings.
17609 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
17611         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
17612         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
17613         the public header file.
17615 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
17617         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
17619 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
17621         * class-internals.h, object.c: reduce the size of MonoVTable
17622         and store the interface_offsets array at negative offsets.
17624 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
17626         * metadata.c: tweak table descriptors data structures to reduce
17627         size and runtime relocations.
17629 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
17631         * marshal.c: fix some types and opcodes to be type-safe
17632         in marshaling wrappers.
17634 2006-02-21  Ankit Jain  <jankit@novell.com>
17636         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
17638 2006-02-21  Raja R Harinath  <rharinath@novell.com>
17640         * metadata.c (get_constraints): Relax debugging checks for monodis.
17642 2006-02-21  Ankit Jain  <jankit@novell.com>
17644         * metadata.c (mono_metadata_load_generic_params): Move the code
17645         checking for ambiguous generic params from here to mono/dis/get.c
17646         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
17648 2006-02-21  Raja R Harinath  <harinath@gmail.com>
17650         Fix assertion triggered when compiling nemerle.
17651         * class.c (mono_get_shared_generic_inst): Rename from
17652         get_shared_inst and make non-static.
17653         * loader.c (mono_get_shared_generic_method): New.  Used to create
17654         the MonoGenericContext-equivalent of a MonoGenericContainer.
17655         (mono_get_method_from_token): Initialize the 'context' field of
17656         the created MonoGenericContainer.
17657         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
17658         * metadata.c (get_constraints): Add sanity check.
17659         * class-internals.h: Add new internal methods.
17661         * reflection.c (verify_safe_for_managed_space): New sanity check.
17662         Currently checks that owner-less generic parameters aren't allowed
17663         in managed space.
17664         (mono_type_get_object): Use it.
17665         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
17666         that are now in mono_type_get_object.
17667         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
17669 2006-02-19  Raja R Harinath  <harinath@gmail.com>
17671         * metadata.c (mono_type_create_from_typespec): Rename from
17672         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
17673         argument and caching of types in the generic container.
17674         (unwrap_arrays, find_generic_param): Remove.
17675         * metadata-internals.h: Update.
17676         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
17678 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
17680         * class.c (mono_class_get_exception_for_failure): Fix a warning.
17682         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
17683         return values. Fixes #77581.
17685         * class.c (mono_fnptr_class_get): Switch name and name_space.
17687         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
17688         classes and add support for [In, Out] attributes.
17689         (mono_marshal_free_asany): Ditto. Fixes #77524.
17691 2006-02-18  Raja R Harinath  <harinath@gmail.com>
17693         * class.c (mono_class_from_generic_parameter): Make more robust to
17694         incomplete MonoGenericContainers from monodis.
17696 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
17698         * class-internals.h: added some more exception types.
17699         * class.c, metadata.c: added a few checks to handle missing
17700         types.
17702 2006-02-17  Raja R Harinath  <rharinath@novell.com>
17704         Use owner-less generic-params some more.
17705         * class.c (my_mono_class_from_generic_parameter): Remove.
17706         (mono_class_from_generic_parameter): Handle null image,
17707         param->name and param->owner.
17708         (mono_class_from_mono_type): Update.
17709         (mono_class_create_from_typespec): Remove 'container' parameter.
17710         If that parameter is non-null, the result is always inflated by
17711         'mono_class_get_full' anyway.
17712         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
17713         parameter.
17714         (mono_class_get_full): Update.
17716         * class.c (inflate_generic_type) [GENERICINST]: If the generic
17717         instance is not open, don't bother inflating.
17718         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
17719         parse metadata for inflated classes.
17720         (_mono_class_get): Change GenericContext* parameter to
17721         GenericContainer*.
17722         (mono_class_create_from_typespec): Likewise.  Simplify, and
17723         implement trivially.  All the cases are handled in
17724         mono_class_from_mono_type.  Don't inflate returned class.
17725         (mono_class_get_full): Delegate GENERICINST optimization to
17726         inflate_generic_type.
17727         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
17729 2006-02-16  Dick Porter  <dick@ximian.com>
17731         * socket-io.c (create_object_from_sockaddr): Fix typo.
17732         (create_sockaddr_from_object): Check array lengths before
17733         potentially accessing items off the end.
17734         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
17735         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
17736         (ves_icall_System_Net_Sockets_Socket_Send_internal)
17737         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
17738         length checks to avoid wraparound overflows.
17739         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
17740         contents of the array of sockets
17741         (hostent_to_IPHostEntry2)
17742         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
17743         Check return value of inet_ntop ().
17744         (addrinfo_to_IPHostEntry): Fix typo
17746 2006-02-16  Raja R Harinath  <rharinath@novell.com>
17748         Type metadata parsing doesn't use generic-instantiation information.
17749         * metadata.c (mono_metadata_parse_array_full): Change
17750         MonoGenericContext* parameter to MonoGenericContainer*.
17751         (mono_metadata_parse_type_full): Likewise.
17752         (mono_type_create_from_typespec_full): Likewise.
17753         (mono_metadata_parse_mh_full): Likewise.
17754         (mono_metadata_parse_generic_inst): Likewise.
17755         (do_mono_metadata_parse_generic_class): Likewise.
17756         (do_mono_metadata_parse_type): Likewise.
17757         * metadata-internals.h: Update to changes.
17758         * class.c (mono_class_find_enum_basetype): Likewise.
17759         (mono_class_setup_fields): Likewise.
17760         (mono_class_create_from_typespec): Likewise.
17761         * loader.c (method_from_methodspec): Likewise.
17762         (mono_get_method_from_token): Likewise.
17763         (mono_method_get_header): Likewise.
17765 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
17767         * marshal.c: handle additional GENERICINST case (patch from
17768         Thong Nguyen <tum@veridicus.com>).
17769         Fix a few cases where LDIND_I/STIND_I was used for references.
17771 2006-02-16  Raja R Harinath  <rharinath@novell.com>
17773         * reflection.c (mono_reflection_get_token): Remove unused variable.
17775 2006-02-16  Martin Baulig  <martin@ximian.com>
17777         * reflection.c (mono_reflection_get_token): Add support for fields
17778         in instantiated generic types.
17780         * icall.c
17781         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
17783 2006-02-15  Martin Baulig  <martin@ximian.com>
17785         * icall.c
17786         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
17787         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
17788         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
17789         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
17791 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
17793         * class.c, metadata.c, metadata.h, object.c, icall.c,
17794         marshal.c: changed mono_type_get_underlying_type () to do
17795         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
17796         Fixed handling of instantiated generic valuetypes (bug #75479).
17798 2006-02-15  Raja R Harinath  <rharinath@novell.com>
17800         * metadata.c (mono_metadata_decode_signed_value): Simplify.
17801         Delegate to mono_metadata_decode_value, and work on the returned value.
17803         * icall.c (ves_icall_MonoType_GetGenericArguments):
17804         Add consistency check here too.
17805         
17806 2006-02-15  Ankit Jain  <jankit@novell.com>
17808         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
17809         char/short etc.
17811 2006-02-15  Ankit Jain  <jankit@novell.com>
17813         * metadata.c (mono_metadata_decode_signed_value): New function to decode
17814         signed values, used only for representing lower bounds of arrays.
17815         (mono_metadata_parse_array_full): Use new
17816         mono_metadata_decode_signed_value to decode lower bounds.
17818 2006-02-14  Martin Baulig  <martin@ximian.com>
17820         * reflection.c
17821         (mono_reflection_get_token): Support "MonoGenericMethod" and
17822         "MonoGenericCMethod" and allow generic instances / methods.
17824 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
17826         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
17827         to obtain the terminal size using an ioctl.
17829         * object.c (mono_nullable_init): Revert this as nullable reference
17830         types are not valid.
17831         (mono_nullable_box): Ditto.
17833 2006-02-09  Dick Porter  <dick@ximian.com>
17835         * threads.c (mono_thread_detach): Drop a reference to the thread
17836         we're detaching.
17838 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
17840         * object.c (mono_nullable_init): Handle nullable reference types.
17841         (mono_nullable_box): Ditto. Fixes #77446.
17843 2006-02-07  Martin Baulig  <martin@ximian.com>
17845         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
17847 2006-02-07  Ankit Jain  <jankit@novell.com>
17849         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
17850         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
17851         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
17852         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
17853         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
17854         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
17856 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
17858         * class.c (mono_class_create_generic): Set type_token as well.
17860         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
17861         compatible with MS.
17863 2006-02-02  Martin Baulig  <martin@ximian.com>
17865         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
17866         has never been used so far.
17868 2006-02-02  Martin Baulig  <martin@ximian.com>
17870         * mono-debug-debugger.h: Changed comment at the top of this file;
17871         the header is not installed, but it's safe to #include it from
17872         within the JIT.
17874         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
17875         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
17877 2006-02-02  Martin Baulig  <martin@ximian.com>
17879         * mono-debug.h
17880         (MonoSymbolTable): Removed the `metadata_info' field.
17882         * mono-debug.c
17883         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
17885         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
17886         (mono_debugger_add_builtin_types): Removed.
17887         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
17888         (mono_debugger_create_notification_function): We now operate on a
17889         pre-allocated area; take a `gpointer' and return `void'.
17891         * mono-debug-debugger.c
17892         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
17893         (mono_debugger_add_builtin_types): Removed.
17895 2006-02-02  Martin Baulig  <martin@ximian.com>
17897         * threads.c (mono_debugger_create_all_threads): New public method.
17899 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
17901         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
17902         breaks on several platforms.
17904 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
17906         * assembly.c: the VS.NET build doesn't supply default values for
17907         MONO_ASSEMBLIES and MONO_CFG_DIR.
17909 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
17911         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
17912         helper function.
17914         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
17916         * loader.c (method_from_memberref): Fix a warning.
17918         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
17920         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
17921         with explicit layout. Fixes #77433.
17923 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
17925         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
17926         max_interface_id is initialized before using it. Fixes #77398.
17927         (ves_icall_Type_GetInterfaces): Ditto.
17929 2006-01-30  Raja R Harinath  <rharinath@novell.com>
17931         * metadata.c (mono_metadata_parse_method_signature_full): Don't
17932         allocate memory for parameter attributes when parsing memberref
17933         signatures.
17934         * loader.c (mono_loader_set_error_method_load): Don't warn.
17935         (method_from_memberref): Ensure MissingMethodException gets thrown
17936         if method is not found.  Make warning more informative.
17938 2006-01-29  Raja R Harinath  <harinath@gmail.com>
17940         Fix #77397
17941         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
17942         return true if is byref.
17943         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
17944         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
17945         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
17947 2006-01-27  Raja R Harinath  <rharinath@novell.com>
17949         Fix tests/find-method.2.il
17950         * loader.c (find_method, find_method_in_class): Remove is_inflated
17951         argument.  Revert 2006-01-18 change.
17952         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
17953         is generic, search for method in its generic definition.
17954         * class.c (mono_class_setup_vtable_general): Print generic
17955         arguments of generic types in debugging printf.
17957 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
17959         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
17961         * threads.c (mono_threads_request_thread_dump): New helper function.
17963 2006-01-25  Raja R Harinath  <rharinath@novell.com>
17965         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
17967 2006-01-25  Ankit Jain  <jankit@novell.com>
17969         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
17970         move definition to ..
17971         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
17972         
17973 2006-01-25  Ankit Jain  <jankit@novell.com>
17974             Raja R Harinath  <rharinath@novell.com>
17976         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
17977         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
17978         as necessary.
17980 2006-01-25  Martin Baulig  <martin@ximian.com>
17982         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
17983         `MonoDebuggerThread' into debug-debugger.c.
17985 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
17987         * profiler.c: fix printing of data.
17989 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
17991         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
17992           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
17994 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
17996         * object.c: fix deadlock related to string interning.
17998 2006-01-23  Martin Baulig  <martin@ximian.com>
18000         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
18002         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
18004 2006-01-23  Martin Baulig  <martin@ximian.com>
18006         * mono-debug.h: Moved the prototypes of some functions which are
18007         used by the JIT here from mono-debug-debugger.h.
18009 2006-01-21  Martin Baulig  <martin@ximian.com>
18011         * Makefile.am: Don't install mono-debug-debugger.h.
18013 2006-01-21  Martin Baulig  <martin@ximian.com>
18015         * mono-debug-debugger.h: Enforce the private status of this header
18016         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
18017         Moved some stuff from mono-debugger-jit-wrapper.h here.
18019 2006-01-20  Raja R Harinath  <rharinath@novell.com>
18021         * class.c (mono_class_from_typeref): Add a sanity test to help
18022         catch lack of assembly load/search hooks.
18024 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
18026         * marshal.c (emit_struct_conv): Relax the fields with same offset
18027         check even more. Fixes #77230.
18029 2006-01-18  Martin Baulig  <martin@ximian.com>
18031         * loader.c (find_method_in_class): Added `gboolean is_inflated'
18032         argument; if false, we compare the uninstantiated signatures.
18033         (method_from_memberref): Compare the uninstantiated signatures;
18034         fixes #76417.
18036 2006-01-18  Robert Jordan  <robertj@gmx.net>
18038         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
18039         Clear the weak link. Fixes bug #77170.
18041         * gc.c (mono_gchandle_free):
18042         Reflect *-gc.c changes (tiny optimization).
18044 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
18046         * metadata.c (mono_metadata_signature_dup): Applied patch from
18047         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
18048         Fixes #77288.
18050 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
18052         * marshal.c (emit_struct_conv): Allow fields with the same offset when
18053         marshalling from native to managed code. Fixes #77230.
18055 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18057         * threadpool.c: fix problem (Mac only) when more than one asynchronous
18058         connect. Fixes bug #77020.
18060 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
18062         * class.c: fixed id assignement for nested interfaces (bug #77275).
18063         Added also better info for --print-vtable debugging.
18065 2006-01-12  Martin Baulig  <martin@ximian.com>
18067         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
18068         interfaces on-the-fly; fixes #76625.
18070         * class-internals.h
18071         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
18072         don't need that anymore.
18074 2006-01-12  Miguel de Icaza  <miguel@novell.com>
18076         * socket-io.c
18077         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
18078         To avoid initing the nested_classes when not needed I turned the
18079         PeerCredData as a toplevel internal class, as it has to be shared
18080         anyways. 
18082         Fixes the CASA issue.
18084 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
18086         * domain.c: Accessors for MonoJitInfo
18088         * profiler-private.h: Add jitinfo to the end jit hook
18090         * profiler.[ch]: Define new hooks, called after jitting which give
18091         the MonoJitInfo that was compiled
18093 2006-01-10  Martin Baulig  <martin@ximian.com>
18095         * class.c (mono_class_setup_events): Add support for generic
18096         classes; fixes #76440.
18098 2006-01-06  Raja R Harinath  <rharinath@novell.com>
18100         Fix #77160.
18101         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
18102         on passed-in method.
18104 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
18106         * object.c (mono_runtime_invoke_array): Add Nullable support.
18108         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
18110 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
18112         * file-io.c: Don't consider sockets as directory and avoid an endless
18113         loop. Fix bug #76966.
18115 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
18117         * object.c (mono_nullable_init): New helper function.
18118         (mono_nullable_box): Ditto.
18120         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
18122         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
18124         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
18125         
18126 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
18128         * class.c (mono_class_is_assignable_from): Make T assignable to 
18129         Nullable<T>.
18131 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
18133         * appdomain.c: Bump corlib version to 46.
18134         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
18135         serialization purpose) and changed ves_icall_System_Reflection_
18136         Assembly_get_code_base signature to accept a boolean (to escape, or 
18137         not, the assembly code base).
18139 2005-12-23  Dick Porter  <dick@ximian.com>
18141         * icall.c: 
18142         * threads-types.h: 
18143         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
18144         CreateEvent icall now returns "created" boolean parameter.
18146 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
18148         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
18149         #76967.
18151         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
18152         when attr_klass is an interface. Fixes #77045.
18154 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
18156         * marshal.c (emit_struct_conv): Fix previous patch.
18157         
18158         * marshal.c (emit_struct_conv): Add a check for fields with the same
18159         offset.
18161 2005-12-20  Raja R Harinath  <rharinath@novell.com>
18163         Fix regression in Mono.C5.
18164         * class.c (mono_class_create_generic): If 'klass' is an interface
18165         set up the interface offsets.
18166         (mono_class_is_assignable_from): Don't throw away generic arguments.
18168 2005-12-19  Raja R Harinath  <rharinath@novell.com>
18170         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
18171         type parameters.
18173 2005-12-15  Raja R Harinath  <rharinath@novell.com>
18175         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
18176         dead store.
18177         (do_mono_metadata_parse_generic_class): Don't pass the current
18178         generic context when parsing the type being instantiated: it
18179         cannot use it, anyway.
18181         * loader.c (method_from_memberref): Don't inflate a signature if
18182         it doesn't contain any type parameters.
18184 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
18186         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
18188 2005-12-14  Martin Baulig  <martin@ximian.com>
18190         * class.c
18191         (mono_type_get_name_recurse): Don't return null for type
18192         parameters and open generic classes.
18193         (mono_class_setup_methods): Don't exclude generic instances.
18194         (mono_get_unique_iid): Use different IDs for different
18195         instantiations of the same generic type.
18196         (mono_class_setup_vtable): Only use setup_generic_vtable() for
18197         open generic instances; create a normal vtable for closed generic
18198         instances.
18199         (mono_class_setup_vtable_general): We're now also called for
18200         closed generic instances.
18202         * reflection.c
18203         (mono_reflection_bind_generic_parameters): Correctly use
18204         mono_metadata_lookup_generic_inst() everywhere.
18206 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
18208         * object.c (mono_class_create_runtime_vtable): Call 
18209         mono_class_setup_vtable ().
18211         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
18212         function.
18213         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
18214         #76959.
18216         * loader.c (mono_loader_set_error_type_load): Print the type load
18217         warnings to the console so they are more visible to the user.
18218         (mono_loader_set_error_method_load): Ditto.
18220         * reflection.c (ensure_runtime_vtable): Revert the last change as it
18221         is still broken.
18222         
18223         * reflection.c (ensure_runtime_vtable): Fix build.
18225         * reflection.c (ensure_runtime_vtable): Disable an optimization which
18226         doesn't work in all cases.
18228 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
18230         * object.c (mono_array_new_full): Treat a single dimensional array
18231         with 0 lower bounds as an szarray. Fixes #76973.
18233         * reflection.c (custom_attr_visible): Really fix this.
18235 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
18237         * reflection.c (custom_attr_visible): Allow nested public attributes
18238         as well.
18240         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
18241         interface check.
18243 2005-12-12  Raja R Harinath  <harinath@gmail.com>
18245         * class.c (set_generic_param_owner): Delete.
18246         (mono_class_create_from_typedef): Don't set ->owner field of
18247         generic parameters to "param containers" of enclosing classes.
18248         * reflection.c (mono_reflection_initialize_generic_parameter):
18249         Likewise.
18251 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
18253         * reflection.c (custom_attr_visible): Fix build.
18255 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
18257         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
18258         private attributes.
18259         
18260         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
18261         handling of null parameter defaults.
18263 2005-12-09  Raja R Harinath  <rharinath@novell.com>
18265         * class.c (mono_class_from_generic_parameter): Don't set
18266         klass->generic_container.
18267         (my_mono_class_from_generic_parameter): Likewise.
18269 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
18271         * reflection.c (load_public_key): Fix a warning.
18272         (method_encode_code): Fix unaligned accesses.
18274 2005-12-07  Martin Baulig  <martin@ximian.com>
18276         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
18278         * reflection.c
18279         (write_generic_param_entry): Encode our custom attrs.
18281         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
18283 2005-12-07  Martin Baulig  <martin@ximian.com>
18285         * reflection.c (encode_new_constraint): Removed; we don't use the
18286         `NewConstraintAttribute' anymore.
18288 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
18290         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
18291         not fire a TypeResolve event when Assembly.GetType () is called.
18293 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
18295         Beginning of support for nullable types in the runtime. Parts of
18296         this patch are from Martin.
18298         * appdomain.c (MONO_CORLIB_VERSION): Bump
18300         * domain.c (mono_init_internal): get the nullable type
18302         * class.c (mono_class_is_nullable): New method
18303         (mono_class_get_nullable_param): New mehod
18304         (mono_class_create_generic): In types T? set cast_class to T
18306         * class-internals.h (MonoDefaults): new nullable default class
18307         (mono_class_get_nullable_param, mono_class_get_nullable_param):
18308         new methods.
18310 2005-12-05  Raja R Harinath  <rharinath@novell.com>
18312         * metadata.c (select_container): New.  Refactor code to select the
18313         appropriate GenericContainer given the type of generic parameter
18314         we are looking for.
18315         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
18316         not a MonoGenericContext.  Use select_container.  Update parameters.
18317         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
18318         and MONO_TYPE_MVAR.
18319         (unwrap_arrays): Remove duplicate tests.
18320         (find_generic_param): Rename from 'has_same_context'.  Now walks a
18321         generic instantiated class to find any arguments that are generic
18322         parameters.
18323         (mono_type_create_from_typespec_full): Use find_generic_param to
18324         avoid evicting some generic instantiations from the typespec
18325         cache.
18327 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
18329         * reflection.c: fixed writing of doubles on ARM FPA.
18331 2005-12-02  Robert Jordan  <robertj@gmx.net>
18333         * icall.c: Fixed EventInfo.ReflectedType (#76829).
18335 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18337         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
18338         least on SUSE 10 they are not the same (on debian, they are just the
18339         same thing).
18341 2005-12-01  Raja R Harinath  <rharinath@novell.com>
18343         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
18344         DeclaringType for VARs and MVARs.
18345         * class.c (set_generic_param_owner): Fix initialization of owner
18346         fields.
18348 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
18350         * icall.c: fixed Enum.ToObject() to correctly convert the values.
18352 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18354         * threadpool.c: workaround for a bug that shows up on the Mac:
18355         select()+connect() on a blocking socket is not like it should
18356         be, so we proceed to connect() in that case, wasting the I/O
18357         threadpool thread until connect succeedes. Fixes bug #75436.
18359 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18361         * threadpool.c: fix typo when setting file descriptor states.
18363 2005-11-28  Raja R Harinath  <rharinath@novell.com>
18365         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
18366         * metadata.c (mono_metadata_parse_method_signature_full): Don't
18367         create a temporary signature container.
18368         (mono_metadata_parse_generic_param): Update to changes.
18369         (mono_type_create_from_typespec_full): Update to changes.
18370         * loader.c (method_from_memberref): Don't use a
18371         MonoGenericContainer while parsing a memberref signature.
18372         (method_from_methodspec): Remove dead-store of the 'container'
18373         variable.  It's overwritten before use.
18375         * metadata.c (mono_type_create_from_typespec_full): Make debugging
18376         checks tighter.
18377         (mono_metadata_parse_generic_param): Likewise.
18378         * loader.c (find_method_in_class): Does not need a
18379         MonoGenericContainer.  Use 'mono_method_signature' rather than
18380         'mono_method_signature_full'.
18381         (find_method, mono_get_method_constrained, method_from_memberref):
18382         Update to changes.
18384         * metadata.c (mono_type_create_from_typespec_full): Ensure that
18385         owner-less generic-parameters are never evicted from the typespec
18386         cache.
18388         * loader.c (method_from_memberref): Don't use the current context
18389         when parsing signatures.
18390         (method_from_methodspec, mono_get_method_from_token): Update to changes.
18392         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
18393         side-effects in g_assert.
18394         * loader.c (mono_get_method_from_token): Resolve klass earlier so
18395         that we don't potentially lose information.
18397 2005-11-26  Dick Porter  <dick@ximian.com>
18399         * icall.c:
18400         * threads.c: icalls to implement basic (ie, not named)
18401         System.Threading.Semaphore.
18403 2005-11-24  Dick Porter  <dick@ximian.com>
18405         * process.c
18406         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
18407         Use GetProcessId() if it's available.
18409 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
18411         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
18413 2005-11-23  Raja R Harinath  <rharinath@novell.com>
18414             Ankit Jain  <jankit@novell.com>
18416         * loader.c (mono_get_method_from_token): Initialize 'method' field
18417         of all generic parameters before parsing the signature.  Remove
18418         code that "fixed"-up MVAR references.
18420 2005-11-23  Ankit Jain  <jankit@novell.com>
18422         * metadata.c (mono_metadata_has_generic_params):
18423         (mono_metadata_load_generic_param_constraints):
18424         (mono_metadata_load_generic_params): Move duplicate code ...
18425         (mono_metadata_get_generic_param_row): ... here. Returns the
18426         first row-id in GenericParam table for a given owner (token).
18427         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
18428         prototype.
18430 2005-11-23  Raja R Harinath  <rharinath@novell.com>
18431             Ankit Jain  <jankit@novell.com>
18433         * metadata.c (mono_metadata_class_equal): Pass signature_only when
18434         comparing VARs too.
18435         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
18436         type->data.generic_param only if the type is an MVAR.
18437         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
18438         leak owner-less VARs and MVARs into managed space.
18440 2005-11-21  Martin Baulig  <martin@ximian.com>
18442         * class-internals.h
18443         (MonoMethod): Moved the `generic_container' here from
18444         `MonoMethodNormal' since we now also need it for
18445         `MonoMethodPInvoke';
18446         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
18447         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
18448         an union containing both `MonoMethodNormal' and
18449         `MonoMethodPInvoke'.
18451         * loader.c
18452         (mono_get_method_from_token): Allow implementing generic methods
18453         as interncalls.
18455         * threads.c
18456         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
18457         icall.
18459 2005-11-17  Dick Porter  <dick@ximian.com>
18461         * icall.c: 
18462         * process.h: 
18463         * process.c: Split the Process Start_internal icall into
18464         ShellExecuteEx_internal and CreateProcess_internal, which are
18465         called depending on whether UseShellExecute is true.  Fixes bug
18466         76670.
18468         * appdomain.c (MONO_CORLIB_VERSION): Incremented
18470 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
18472         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
18473         'msize' parameters, use the information in 'mspec' instead.
18474         (emit_object_to_ptr_conv): Ditto.
18476         * marshal.c (emit_struct_conv): Handle explicit layout structs with
18477         fields out of order. Fixes #76733.
18479 2005-11-17  Ankit Jain  <jankit@novell.com>
18481         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
18483 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
18485         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
18486           bug #76575.
18488 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
18490         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
18491         for types with non-auto layout. Fixes #76717.
18493 2005-11-16  Ankit Jain  <jankit@novell.com>
18495         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
18496         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
18497         if generic_context is null.
18498           (mono_metadata_generic_param_equal): param->owner can be null.
18499           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
18500         null.
18502 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
18504         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
18505         the correct value.
18507 2005-11-15  Martin Baulig  <martin@ximian.com>
18509         * object.c (set_value): Use mono_class_from_mono_type() instead of
18510         the hack for generic instances; fixes #76136.
18512 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
18514         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
18515         fields.
18517         * image.c (load_metadata_ptrs): Initialize the new fields.
18519         * reflection.c (create_dynamic_mono_image): Ditto.
18521         * reflection.c (build_compressed_metadata): Use the new fields.
18523         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
18524         icall.
18526         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
18527         icall.
18528         
18529 2005-11-15  Ankit Jain  <jankit@novell.com>
18530             Raja R Harinath  <harinath@gmail.com>
18532         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
18533         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
18534         new per-generic_container cache if the cached MonoType's context matches
18535         the current context.
18536           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
18537         to the expected context.
18538           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
18540 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18542         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
18543         we changed the signature of an icall.
18544         * icall.c: Modify to mono_double_ParseImpl return true/false 
18545         depending on the success, instead of throwing the exception. This will
18546         help us in Double.TryParse methods.
18547         
18548 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
18550         * marshal.c (emit_marshal_object): Throw an exception when
18551         marshalling 'object' instead of crashing. Fixes #76696.
18553 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
18555         * class-internals.h: Add prototype for mono_type_get_full_name ().
18557 2005-11-11  Dick Porter  <dick@ximian.com>
18559         * threads.c (mono_thread_manage): Make sure the main thread has
18560         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
18562 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
18564         * loader.c (mono_loader_set_error_type_load): Log a warning to the
18565         console about the missing type.
18566         (mono_loader_set_error_method_load): Ditto.
18568 2005-11-09  Miguel de Icaza  <miguel@novell.com>
18570         * mono-config.c (mono_get_config_dir): Set the system defaults if
18571         none is specified.
18573         * assembly.c (mono_set_dirs): New API entry point to set the
18574         assembly and the config directory in one call
18576 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
18578         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
18579         the ftnptr was created from a delegate in a domain other than the
18580         current domain. Fixes #75377.
18582         * exception.h exception.c: Add mono_get_exception_not_supported ().
18584 2005-11-08  Martin Baulig  <martin@ximian.com>
18586         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
18588 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
18590         * security-manager.h: Added definitions to deal with strongname key 
18591         pairs bigger (and smaller) than 1024 bits.
18592         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
18593         adjust wrt the public key length being used.
18595 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
18597         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
18598           Windows build (r51396-51397).
18600 2005-11-03  Martin Baulig  <martin@ximian.com>
18602         * class.c (mono_class_setup_vtable_general): Also add generic
18603         methods to the vtable; fixes #76581.
18605 2005-11-01  Miguel de Icaza  <miguel@novell.com>
18607         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
18608         sure that we lookup GetString method from the System.Text.Encoding
18609         class, not the derived class or we get an empty method.
18611         Fixed class #76612.
18613 2005-10-25  Miguel de Icaza  <miguel@novell.com>
18615         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
18616         if it has been previously set (embedders). 
18618         Make mono_set_rootdir available also on Unix.
18620 005-10-24  Robert Jordan  <robertj@gmx.net>
18622         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
18624 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
18626         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
18627         only calls which are made to native code use this flag.
18629         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
18631 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
18633         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
18634         Add support for FieldBuilders.
18636 2005-10-29  Martin Baulig  <martin@ximian.com>
18638         * mono-debug.c
18639         (mono_debug_using_mono_debugger): New public method; returns
18640         whether we're running inside the debugger.
18642 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
18644         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
18645         for Method/Constructor/FieldBuilders.
18647 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
18649         * reflection.c (module_add_cattrs): Save custom attributes for global methods
18650         and fields as well.
18652 2005-10-26  Martin Baulig  <martin@ximian.com>
18654         * mono-debug-debugger.c
18655         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
18657 2005-10-24  Raja R Harinath  <harinath@gmail.com>
18659         * icall.c (base64_to_byte_array): Don't pass an out-of-range
18660         integer to isspace.
18662 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
18664         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
18665         when passing valuetypes byref. Fixes #76502.
18667 2005-10-19  Jackson Harper  <jackson@ximian.com>
18669         * profiler.c: Don't put a . in front of types that are not in a
18670         namespace.
18672 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
18674         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
18676 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
18678         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
18679         #76436.
18680         (mono_marshal_get_ldflda_wrapper): Fix a warning.
18682 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18684         * assembly.c metadata-internals.h icall.c: Define an additional
18685         parameter for mono_assembly_name_parse_full, so we can avoid creating
18686         S.R.AssemblyName.Version when no version info wasn't passed.
18687         
18688 2005-10-09  Miguel de Icaza  <miguel@novell.com>
18690         * class.c (mono_type_get_full_name): Reimplement method that was
18691         removed. 
18693         * image.c: Some docs
18695 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
18697         * profiler.c (output_newobj_profile): Fix printing of Total memory
18698         on x86.
18700 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
18702         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
18704 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
18706         * threads.c: remove debug output.
18708 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
18710         * threads.c (mono_thread_manage): Fix crashes if more than 64
18711         threads need to be aborted. Hopefully fixes #75899.
18713         * assembly.c (mono_stringify_assembly_name): New helper function.
18715         * class.c: Use mono_stringify_assembly_name instead of the similar
18716         static function.
18718         * assembly.h assembly.c: Add support for calling a postload search 
18719         hook if an assembly cannot be loaded.
18721         * appdomain.c: Register new search hooks which call the AssemblyResolve
18722         events in AppDomain. Fixes #75231
18724 2005-10-07  Martin Baulig  <martin@ximian.com>
18726         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
18727         methods without debug info.
18729 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
18731         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
18732         wrappers.
18734 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18736         * file-io.c: now that we return symlinks, use lstat and, when the file
18737         is a symbolic link, stat, to get the file attributes. Also avoid the
18738         conversion to/from utf16/external.
18740 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
18742         * class.c (mono_class_layout_fields): Compute klass->has_references
18743         correctly if an embedded valuetype is not yet initialized. Fixes
18744         #76331.
18746 2005-10-04  Martin Baulig  <martin@ximian.com>
18748         * metadata.c
18749         (mono_metadata_load_generic_param_constraints): New public
18750         function; splitted the constraints loading out from
18751         mono_metadata_load_generic_params().
18753         * class.c (mono_class_create_from_typedef): Call
18754         mono_metadata_load_generic_param_constraints() after setting up
18755         the type and creating our parent; fixes #75329.
18757 2005-10-04  Martin Baulig  <martin@ximian.com>
18759         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
18760         non-dynamic parent classes.
18762 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
18764         * file-io.c : win32 build fix (ETXTBSY seems not found).
18766 2005-10-04  Martin Baulig  <martin@ximian.com>
18768         * reflection.c
18769         (mono_image_get_methodspec_token): Make the cache actually work;
18770         fixes #75974.
18772 2005-10-04  Martin Baulig  <martin@ximian.com>
18774         * class.c (mono_class_name_from_token): Removed the unneccessary
18775         `MonoGenericContext *' argument.
18777 2005-10-04  Martin Baulig  <martin@ximian.com>
18779         * loader.c
18780         (method_from_methodspec): Make the caching work again; fixes the
18781         performance regression from #76262.
18783 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18785         * file-io.c:
18786         * file-io.h:
18787         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
18788         GetFileSystemEntries that performs the same work but without going
18789         into io-layer, locking, etc.
18791 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
18793         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
18794         ThreadState_Stopped as well. Fixes #76047.
18796 2005-09-29  Martin Baulig  <martin@ximian.com>
18798         * class.c
18799         (inflate_generic_context): If the new context has a `gmethod', set
18800         its `container' that that gmethod's `container'.
18802         * metadata.c
18803         (mono_metadata_parse_generic_param): Simplify things;
18804         `generic_container = generic_context->container;' is just fine.
18806         * loader.c (method_from_methodspec): Code cleanups.
18808 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
18810         * decimal.c: fix warning (and let gcc generate correct
18811         code on ARM with optimizations).
18813 2005-09-28  Martin Baulig  <martin@ximian.com>
18815         * loader.c
18816         (method_from_memberref): Added `MonoGenericContext *class_context'
18817         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
18818         (method_from_methodspec): If we're a memberref, use the enclosing
18819         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
18821 2005-09-28  Martin Baulig  <martin@ximian.com>
18823         * object.c (mono_runtime_invoke_array): Added support for
18824         MONO_TYPE_GENERICINST; fixes #75917.
18826 2005-09-27  Martin Baulig  <martin@ximian.com>
18828         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
18829         `k->byval_arg.type' to determine the actual type.
18831         * loader.c (method_from_methodspec): Removed some hacks.
18833 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
18835         * class-internals.h (mono_field_is_deleted): Do the test for
18836         rtspecialname before we check the actual name of the field. This
18837         prevents us from dereferencing a pointer into the string table,
18838         saving us from accessing a few pages
18840         * *.c: Replace the use of {Enter,Leave}CriticalSection with
18841         macros. This will allow a deadlock debugger to easily be plugged
18842         in.
18844 2005-09-27  Martin Baulig  <martin@ximian.com>
18846         * loader.c (method_from_methodspec): Create a "signature"
18847         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
18849 2005-09-27  Martin Baulig  <martin@ximian.com>
18851         * class.c
18852         (inflate_generic_class): Correctly set the new context's
18853         container.
18855         * loader.c
18856         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
18857         instead of a `MonoGenericContext *'.
18858         (mono_method_signature_full): Take a `MonoGenericContainer *'
18859         instead of a `MonoGenericContext *'.
18861         * metadata.c
18862         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
18863         instead of a `MonoGenericContext *'.
18864         (mono_metadata_parse_method_signature_full): Likewise.
18866 2005-09-26  Martin Baulig  <martin@ximian.com>
18868         * class.c
18869         (mono_class_from_generic_parameter): Set `klass->generic_container'
18870         (mono_class_from_generic_parameter): Likewise.
18871         (mono_bounded_array_class_get): We inherit the generic container
18872         from the element class.
18874         * loader.c
18875         (find_method, find_method_in_class): Take a `MonoGenericContext *'
18876         argument rather than computing it here.
18877         (method_from_memberref): Correctly set the generic context before
18878         parsing the signature.  Fixes #75681.
18880 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
18882         * object.c (mono_class_has_special_static_fields): Fix warnings.
18884 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18886         * assembly.c: Add parse_public_key function, to
18887         par the public keys. Also added mono_assembly_name_parse_full,
18888         to define it the parsed key should be freed or not.
18889         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
18890         to parse a long format assembly name.
18891         * metadata-internals.h: Keep mono_assembly_name_parse_full as
18892         private, since calling it to preserve the key requires
18893         freeing it manually.
18894         
18895 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
18897         * locales.c : removed HAVE_ICU part.
18899 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
18901         * object.c (mono_class_create_runtime_vtable): Avoid calling 
18902         field_is_special_static if the klass has no special static fields.
18904         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
18905         (MonoCachedClassInfo): Likewise.
18907         * object.c (mono_class_has_special_static_fields): New helper function.
18909 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18911         * class.c (mono_class_create_from_typedef): Don't call 
18912         interfaces_from_typedef_full for enums.
18913         (mono_class_create_from_typedef): Compute the base types of enums directly
18914         without calling mono_class_setup_fields ().
18915         (mono_class_find_enum_basetype): New helper function.
18917         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
18918         one place inside the string heap.
18919         
18920 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
18922         * class.c: locking fixes, code cleanups, some docs added.
18923         Allocate some data structures in the image mempool.
18925 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18927         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
18928         the example code.
18929         
18930 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
18932         * class-internals.h, class.c, reflection.c: reduce memory taken by
18933         MonoClass.
18935 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
18937         * metadata.c, metadata.h, loader.h: documentation updates, code and
18938         API cleanups.
18940 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18942         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
18943         the example code.
18945         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
18946         page faults caused by the runtime while reading metadata.
18948 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18950         * socket-io.c: the field names were changed 3 months ago and no one
18951         realized until bug #76077 got filed!
18953 2005-09-20  Martin Baulig  <martin@ximian.com>
18955         * icall.c (assembly_icalls): Removed some unused debugger icalls.
18957 2005-09-20  Martin Baulig  <martin@ximian.com>
18959         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
18960         write the rank into the class entry.
18962 2005-09-20  Martin Baulig  <martin@ximian.com>
18964         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
18966 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
18968         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18970         * icall.c (custom_attrs_defined_internal): New icall.
18972         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
18973         function.
18974         (mono_custom_attrs_construct_by_type): New helper function.
18976 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
18978         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
18979         terminate the resulting string. Fixes #76123.
18981 2005-09-16  Martin Baulig  <martin@ximian.com>
18983         * mono-debug.c
18984         (mono_debug_add_method): Ignore inflated methods for the moment.
18986 2005-09-14  Martin Baulig  <martin@ximian.com>
18988         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
18990 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
18992         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
18993         return a success/failure indication.
18994         (mono_metadata_interfaces_from_typedef_full): Ditto.
18995         (get_constraints): Ditto.
18997 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
18999         * marshal.c (emit_marshal_array): Fix handling of null arrays.
19000         
19001         * marshal.c (emit_marshal_array): Add support for returning string
19002         arrays from delegates. Fixes #76063.
19004         * marshal.c: Use the emit_ldloc/stloc macros where possible.
19006 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
19008         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
19009         icall.
19011 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
19013         * reflection.c icall.c: Fix after mono_get_exception_type_load
19014         signature change.
19016         * assembly.c (mono_assembly_get_assemblyref): New helper function.
19017         (mono_assembly_load_reference): Use the new helper.
19019         * class-internals.h (MonoLoaderError): New structure containing 
19020         information about type loading errors.
19022         * class-internals.h loader.c: Add APIs to store per-thread loader
19023         error information.
19025         * loader.c class.c: Set the loader error if needed.
19027         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
19029 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
19031         * decimal.c: fixed to handle the broken ARM fp format.
19033 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
19035         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
19036         broken.
19038 2005-09-06  Martin Baulig  <martin@ximian.com>
19040         * domain.c (supported_runtimes): Added v2.0.50727.
19042 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
19044         * culture-info.h: reduce the size of some structures.
19046 2005-09-05  Martin Baulig  <martin@ximian.com>
19048         Reflect latest API changes in the August CTP.
19050         * icall.c
19051         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
19052         ("MonoType.HasGenericArguments"): Removed.
19053         ("MonoMethod.BindGenericParameters"): Renamed to
19054         "MakeGenericMethod".
19055         ("MethodBuilder.BindGenericParameters"): Renamed to
19056         "MakeGenericMethod".    
19058 2005-09-05  Martin Baulig  <martin@ximian.com>
19060         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
19062 2005-09-05  Martin Baulig  <martin@ximian.com>
19064         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19066         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
19067         generic_container is non-NULL.
19069 2005-09-05  Martin Baulig  <martin@ximian.com>
19071         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19073         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
19075 2005-08-29  Michal Moskal  <malekith@nemerle.org>
19077         * reflection.c (encode_locals,
19078         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
19079         for large generic types.
19081 2005-09-05  Martin Baulig  <martin@ximian.com>
19083         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19085         * class.c (mono_dup_array_type): New public method.
19086         (mono_metadata_signature_deep_dup): New public method.
19087         (dup_type): Correctly duplicate array and function types.
19089 2005-09-05  Martin Baulig  <martin@ximian.com>
19091         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19093         * reflection.c (get_default_param_value_blobs): Handle generic types
19094         and generic methods.
19096 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
19098         * class.c: Fixed error reporting (method/class were inversed) for 
19099         inheritance demands.
19100         * security-manager.c|h: Added the AppDomain when calling the managed
19101         System.Security.SecurityManager.InheritanceDemand method.
19103 2005-09-01  Raja R Harinath  <rharinath@novell.com>
19105         * reflection.c (encode_marshal_blob): 'marshaltype' and
19106         'marshaltyperef' are alternate sources for the custom marshaler
19107         name.
19109 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
19111         * class.c: fix creation of array classes with rank == 1
19112         (patch by Ankit Jain <jankit@novell.com>).
19114 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
19116         * object.c: fix check for creating the bound data for arrays vs
19117         szarrays.
19119 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19121         * object.c: configuration file name is now based on the executable name,
19122         not the image name. Fixes bug #75931.
19124 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
19126         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
19127         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
19129 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
19131         * rand.c: Use wincrypt.h instead of WinCrypt.h.
19133 2005-08-24  Ankit Jain  <jankit@novell.com>
19134             Raja R Harinath  <rharinath@novell.com>
19136         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
19137           called by it recursively.
19138           (mono_class_init): Remove special case in pending_init handling, since it's
19139           superseded by the fix to mono_class_from_typeref.
19141 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
19143         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
19144         BROKEN_THREAD_START stuff.
19146 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
19148         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
19149         trampoline.
19151         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
19152         
19153         * object.c (mono_delegate_ctor): Replace the original function address with
19154         a delegate trampoline.
19156 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
19158         * icall.c: add boolean argument to base64_to_byte_array and 
19159         InternalFromBase64String to control whether a whitespace-only string
19160         is allowed (or should casue a FormatException to be thrown). We need
19161         this as the behavior has changed between MS.NET 1.x and 2.0, and we
19162         to match the MS behaviour in both profiles.
19163         * appdomain.c: Bump corlib version.
19165 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19167         This patch implements a big portion of publisher policy
19168         support, used to bind assembly versions and redirect
19169         one assembly from version A to version B.
19171         * assembly.c:
19172         New GSList loaded_assembly_bindings, for storing the cached
19173         assembly bindings.
19174         (assembly_binding_maps_name): New static function for checking if a 
19175         assembly binding information maps an assembly name.
19176         (mono_assembly_binding_info_free): New function for freeing
19177         assembly binding information resources.
19178         (get_publisher_policy_info): New static function for retrieving 
19179         assembly binding information from a MonoImage.
19180         (compare_versions): New static function for comparing an assembly
19181         binding information data and the version of an assembly name.
19182         (check_policy_versions): New static function for checking if an
19183         assembly binding info mapping an assembly name is valid for it.
19184         (mono_assembly_load_publisher_policy): New static function for
19185         loading the 'policy.major.minor.MyAssembly' image for an assembly
19186         with an assembly name 'aname'.
19187         (mono_assembly_bind_version): New static function for updating
19188         assembly redirection.
19189         (mono_assembly_apply_binding): New static function for applying
19190         assembly binding.
19191         (search_binding_loaded): New static function for searching 
19192         loaded assembly binding infos in the cache domain.
19193         (mono_assembly_load_full): Don't apply assembly binding for
19194         reflection only assemblies.
19196         * metadata-internals.h: Add MonoAssemblyBindingInfo,
19197         which contains information about assembly binding. Also
19198         declare signature for mono_config_parse_publisher_policy ()
19199         function, used to retrieve pub policy info.
19200         
19201         * mono-config.c:
19202         (publisher_policy_start): New static function used to parse publisher 
19203         policy config files.
19204         (publisher_policy_parser): New static MonoParseHandler containing 
19205         the functions used when parsing config files.
19206         (mono_config_parse_publisher_policy): New function for parsing
19207         publisher policy files.
19208         
19209 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
19211         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
19213         * marshal.c (mono_delegate_free_ftnptr): Ditto.
19215         * object.c (mono_get_addr_from_ftnptr): New helper function.
19217         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
19219         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
19221 2005-08-19  Dick Porter  <dick@ximian.com>
19223         * threads.c, threads.h, appdomain.c, appdomain.h,
19224         profiler-private.h, monitor.c, object.c, object-internals.h,
19225         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
19226         store the thread ID, so it can hold a 64 bit value if needed.
19228 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
19230         * reflection.c (mono_reflection_create_dynamic_method): Store the
19231         handle class into the method references as well so ldtoken works in
19232         dynamic methods.
19234         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
19235         types.
19237 2005-08-19  Ankit Jain <jankit@novell.com>
19239         Fix #75847.
19240         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
19241           here rather than using the method signature of a arbitrary function
19242           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
19243           two arguments.
19244           Hack done with Harinath.
19246 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19248         * threadpool.c: disable printing stack traces when we get a exception
19249         in a threadpool thread. I need to do more testing to figure out which
19250         cases actually print this. Fixes bug #75828.
19252 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19254         * icall.c: there might be ignored whitespace after the last '='. This
19255         fixes length computation and bug #75840.
19257 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
19259         * assembly.c (mono_assembly_load_full): Consider .exe extension as
19260         well. Fixes #75809.
19262         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
19263         #75784.
19264         
19265         * reflection.c (create_custom_attr_data): Ditto.
19267 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
19269         * locales.c, culture-info.h : removed RegionLCIDMap.
19270         * culture-info-tables.h : regenerated.
19272 2005-08-16  Martin Baulig  <martin@ximian.com>
19274         * class.c (mono_type_get_name_recurse): Small fix.
19276 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
19278         * locales.c : indentation fixie.
19280 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
19282         * object-internals.h,
19283           locales.h,
19284           locales.c,
19285           culture-info.h,
19286           icall.c : added RegionInfo table support.
19287         * culture-info-table.h : regenerated for region support.
19289 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
19291         * reflection.c (resolve_object): handle all kinds of MonoMethod
19292         including generic ones
19294 2005-08-12  Ankit Jain <jankit@novell.com>
19296         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
19297           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
19299 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
19301         * process.c: Don't close a thread handle when it's NULL. This is a
19302         workaround for bug #75733.
19304 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
19306         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
19308 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
19310         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
19312 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19314         * threadpool.c: if a work item in the thread pool has a callback that
19315         catches a exception, don't propagate it after invoking the callback.
19316         Fixes bug #75336.
19318 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
19320         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
19322         * class-internals.h (MonoCachedClassInfo): Add some new fields.
19324         * class.c (mono_class_init): Load field info lazily in the AOT case.    
19326         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
19328 2005-08-03  Ankit Jain  <jankit@novell.com>
19330         Fix #75683.
19331         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
19332           PInvoke calling convention is 0.
19334 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
19336         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
19337         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
19339 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
19341         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
19342         to handle threads not started by the GC (patch by Michael Meeks
19343         <michael.meeks@novell.com>).
19345 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
19347         * reflection.c: Make buffer used in emitting types larger for some
19348         big generic types (patch by Michal Moskal).
19350 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
19352         * mono-debug.c: Fix some (not all) alignment problems.
19354 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19356         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
19357         Invoke mono_image_load_from_data_full passing the refonly
19358         parameter.
19360         * assembly.c
19361         (mono_assembly_open_from_bundle): Add the refonly argument, 
19362         in order to pass it to other methods it calls to.
19363         (do_mono_assembly_open): Add the refonly argument, in order 
19364         to pass it to other methods it calls to.
19365         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
19366         the refonly parameter to it.
19368         * image.c: Add loaded_images_refonly_hash and
19369         loaded_images_refonly_guid_hash to cache the reflection
19370         only loaded images.
19371         (mono_images_init): Initialize the hash tables used for
19372         caching the reflection only images.
19373         (load_modules): Invoke mono_image_open_full passing the refonly
19374         parameter to load the modules the correct way.
19375         (build_guid_table): Add the refonly argument, to re-build the 
19376         correct hash table.
19377         (do_mono_image_open): Added the refonly argument, in order to
19378         define it for the loaded image.
19379         (mono_image_loaded_full): New function, which receives an
19380         additional parameter to look for the image in the refonly or
19381         non-refonly section.
19382         (mono_image_loaded): Updated, using mono_image_loaded_full.
19383         (mono_image_loaded_by_guid_full): The same case that happens
19384         with mono_image_loaded_full.
19385         (mono_image_loaded_by_guid): Likewise.
19386         (register_image): Use the ref_only variable inside MonoImage
19387         to decide in which hash table store the current image.
19388         (mono_image_open_from_data_full): Rename
19389         mono_image_open_from_data to mono_image_open_from_data_full,
19390         adding the refonly argument, to define the ref_only variable 
19391         inside MonoImage.
19392         (mono_image_open_from_data): Return 
19393         mono_image_open_from_data_full.
19394         (mono_image_open_full): Rename mono_image_open to
19395         mono_image_open_full, receiving the new refonly argument,
19396         to pass it to inner methods.
19397         (mono_pe_file_open): Update this function, to open
19398         a MonoImage as a non-refonly image.
19399         (mono_image_close): Use the refonly variable inside
19400         MonoImage to remove the image from the correct caches.
19402         * image.h: Add the signatures of mono_image_open_full,
19403         mono_image_open_from_data_full, mono_image_loaded_full,
19404         mono_image_loaded_by_guid_full.
19406         * metadata-internals.h: Add the ref_only field to 
19407         MonoImage.
19408         
19409 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19411         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
19412         Fix the last behavior, which used to load the assemblies and
19413         extract MonoReflectionAssemblyName information, instead of
19414         extract it from the metadata tables. Needed for Reflection
19415         Only assemblies.
19416         
19417 2005-07-29  Martin Baulig  <martin@ximian.com>
19419         * mono-debug-debugger.c
19420         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
19421         not initialized.
19423         * mono-debug.c
19424         (mono_debug_address_from_il_offset): Check whether we have
19425         debugging support before attempting to take the lock.
19426         (mono_debug_source_location_from_address): Likewise.
19427         (mono_debug_source_location_from_il_offset): Likewise.
19428         (mono_debug_il_offset_from_address): Likewise.
19429         (mono_debug_address_from_il_offset): Likewise.
19431 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
19433         * class.c (mono_class_from_name_case): Add support for dynamic images.
19434         Fixes #75650.
19436         * object.c (mono_class_compute_gc_descriptor): Add a workaround
19437         for #75479.
19439 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
19440         
19441         * reflection.c (mono_method_get_object): Fix warning.
19443 2005-07-28  Martin Baulig  <martin@ximian.com>
19445         * mono-debug.c
19446         (mono_debug_add_wrapper): Also write the wrapper type.
19448 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
19450         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
19451         
19452         * class.c (mono_class_init): Avoid reading nested classes if the AOT
19453         data indicates the class has none.
19455 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
19457         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
19458         loader lock with the debugger lock. Prevents deadlocks for beagle.
19460         Beagle can now run on an smp box for a weekend without any
19461         issues. Woohoo!
19463 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
19465         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
19466         in a module. Fixes #75629.
19468 2005-07-26  Martin Baulig  <martin@ximian.com>
19470         * mono-debug.c (mono_debug_add_wrapper): New static method.
19471         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
19472         interncall or a wrapper.
19474         * mono-debug.h (MonoDebugWrapperData): New public typedef.
19475         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
19476         (MONO_DEBUGGER_VERSION): Bump to 51.
19478         * mono-debug-debugger.c
19479         (mono_debugger_add_type): Removed this empty function.
19480         (mono_debugger_add_method): Likewise.
19482 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
19484         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
19485         before accessing method->slot.
19487 2005-07-21  Jb Evain  <jbevain@gmail.com>
19489         * reflection.c (method_encode_clauses/class): Handle filters clauses.
19490         Fixes #75010.
19492 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
19494         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
19495         #75587.
19497 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
19499         * image.h image.c: Add mono_image_get_guid () API function.
19501 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
19503         There were issues when multiple threads tried to load
19504         assemblies. A deadlock was created between assemblies_mutex and
19505         mono_domain_assemblies_lock. This fixes the issue by making the
19506         assembly ref counting be lock free. See bug 75586.
19507         
19508         * image.c (mono_image_close): The add ref function here was using
19509         Interlocked operations while the unref was using a mutex and a
19510         --. I don't think this was ever a bug that would be exposed in a
19511         non-pendantic way (ie, by an embedder doing a ref on one thread
19512         and an unref on another), but for the sake of correctness, this is
19513         now Interlocked.
19515         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
19516         (mono_assembly_load_reference): Call mono_assembly_addref rather
19517         than touching the refcount ourselves.
19518         (mono_assembly_close): Use InterlockedDecrement to unref the
19519         assembly. Don't acquire the lock unless it is actually needed.
19521 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
19523         * class.c (mono_class_layout_fields): Fix calculation of has_references
19524         for generic types.
19526 2005-07-12  Martin Baulig  <martin@ximian.com>
19528         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19530         * metadata.c
19531         (mono_type_hash): Provide better hashing for generic instances.
19532         (mono_generic_inst_hash): Improve hashing.
19533         (mono_generic_class_hash): Likewise.
19535         * reflection.c (mymono_metadata_type_hash): Improve hashing for
19536         generic instances.
19538 2005-07-12  Martin Baulig  <martin@ximian.com>
19540         * reflection.c (mono_reflection_create_runtime_class): Remove the
19541         hack for generic type definitions and non-`Run' assemblies.
19542         (mono_reflection_bind_generic_parameters): Also use
19543         `klass->wastypebuilder' to check for TypeBuilders.
19545 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
19547         * class.c (mono_class_layout_fields): Fix calculation of has_references
19548         for generic types.
19550         * class.c (inflate_generic_class): Fix a leak.
19551         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
19552         for generic types.
19554 2005-07-11  Martin Baulig  <martin@ximian.com>
19556         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
19557         on error.
19559 2005-07-11  Martin Baulig  <martin@ximian.com>
19561         * loader.c (find_method): Also lookup in
19562         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
19564 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19566         * appdomain.c (mono_domain_unload): Don't free the error message
19567         before passing it to mono_get_exception_...
19569         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
19570         
19571 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
19573         * threads.c: try to better guess an available RT signal (bug #75387).
19575 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19577         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
19578         and CACHE_OBJECT.
19580 2005-07-07  Martin Baulig  <martin@ximian.com>
19582         * class.c (mono_type_get_name_full): Return NULL for
19583         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
19584         fixes #75408.
19586 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19588         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
19589         exit the appdomain as well being aborted.
19591         * threadpool.c: Create all threadpool threads inside the root appdomain, and
19592         change back to the root domain after calling managed code. This enables
19593         appdomains using threadpools to be unloaded.
19595 2005-07-07  Martin Baulig  <martin@ximian.com>
19597         * class-internals.h
19598         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
19599         into `MonoDynamicGenericClass' since we only need it for dynamic
19600         types.
19602         * reflection.c (mono_class_bind_generic_parameters): We don't need
19603         to compute the `parent' here.
19605 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
19607         * culture-info-table.h : regenerated.
19609 2005-07-06  Martin Baulig  <martin@ximian.com>
19611         * icall.c
19612         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
19614         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
19616 2005-07-06  Martin Baulig  <martin@ximian.com>
19618         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
19619         we're doing a signature-only comparision; fixes #74945.
19621 2005-07-06  Martin Baulig  <martin@ximian.com>
19623         * class-internals.h (MonoGenericClass): Moved some things out into
19624         a new `MonoInflatedGenericClass' type.  
19625         (MonoInflatedGenericClass): New type; the `klass' of a
19626         `MonoGenericClass' is now computed lazyly in
19627         mono_get_inflated_generic_class().      
19629         * class.c (mono_get_inflated_generic_class): New public function.
19630         (mono_class_inflate_generic_method): Removed the unused
19631         `MonoClass *' argument.
19632         (setup_generic_vtable): Don't call mono_get_inflated_method() on
19633         all the methods.
19634         (mono_class_create_generic): Make this static and merge it with
19635         mono_class_create_generic_2(); we're now called automatically from
19636         mono_get_inflated_generic_class().
19638         * loader.c (mono_method_signature): Call
19639         mono_get_inflated_method() here.
19641 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
19643         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
19644         type of fields with RVA.
19646         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
19647         for this pseudo class.
19648         (my_mono_class_from_generic_parameter): Likewise.
19649         (mono_class_init): Allow interfaces to have cctors.
19651 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
19653         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
19654         lazily for AOT methods.
19656 2005-07-05  Martin Baulig  <martin@ximian.com>
19658         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
19659         returns FALSE for a successful match, not TRUE.
19661 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
19663         * loader.c (mono_method_get_index): Optimize this a bit.
19665 2005-07-04  Martin Baulig  <martin@ximian.com>
19667         * class.c
19668         (class_compute_field_layout): Move the check for generic type
19669         definitions into mono_class_layout_fields().  Fixes #74684.
19670         (mono_class_from_generic_parameter): Correctly compute
19671         `klass->parent'; fixes #75457.
19673         * reflection.c (register_assembly, register_module): Make sure
19674         `domain->rejobject_hash' is already created.
19676 2005-07-02  Martin Baulig  <martin@ximian.com>
19678         * class-internals.h
19679         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
19680         `MonoDynamicGenericClass'.      
19682 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
19684         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
19685         returned by a field getter is null, since null is a valid value.
19687 2005-07-01  Martin Baulig  <martin@ximian.com>
19689         * reflection.c (mono_reflection_generic_class_initialize): Update
19690         the `dgclass->fields [i].parent' to the correct class.
19691         (mono_image_get_fieldref_token): Use the declaring type, not the
19692         reflected type.
19694 2005-07-01  Martin Baulig  <martin@ximian.com>
19696         * loader.c (find_method): Also look in the interfaces; fixes #75429.
19698 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
19700         * threads.c (thread_cleanup): assert that thread != NULL
19701         (wait_for_tids_or_state_change): We were using the wrong variable
19702         when accessing wait->threads. `i' was always out of the bounds of
19703         the array.
19705 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19707         * loader.c: map user32 and kernel32 to libMonoSupportW
19709 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
19711         * appdomain.c (unload_thread_main): Mark this as WINAPI.
19713 2005-06-28  Martin Baulig  <martin@ximian.com>
19715         * loader.c (method_from_methodspec): Fix #75334.
19717 2005-06-28  Martin Baulig  <martin@ximian.com>
19719         Fix #74953 - Arrays now implement the generic IList<T> interface
19720         on the 2.0 platform.
19722         * class-internals.h (MonoDefaults): Added `generic_array_class'.
19724         * reflection.c (mono_class_bind_generic_parameters): New public
19725         function; similar to mono_reflection_bind_generic_parameters(),
19726         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
19728         * domain.c (mono_init_internal): Try to initialize.
19729         `mono_defaults.generic_array_class' here; this'll only succeed if
19730         we're using the 2.0 corlib.
19732         * icall.c
19733         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
19734         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
19735         (mono_lookup_internal_call): Added support for nested classes.
19737         * loader.c
19738         (mono_get_method_from_token): Set `result->signature->pinvoke' if
19739         we're an interncall and have generic arguments.
19741         * class.c
19742         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
19743         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
19744         instance of System.Array.InternalArray<T> for arrays, so they
19745         implement the generic IList<T> interface.
19747 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
19749         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
19750         (chastamar@yahoo.com). Fixes #75374.    
19752 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
19754         * culture-info-table.h: regenerated.
19756 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19758         * icall.c: handle spaces correctly for base64 strings.
19760 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
19762         * *.c: Kill some warnings.
19764 2005-06-23  Duncan Mak  <duncan@novell.com>
19766         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
19767         that this builds on Solaris 10 (x86).
19769 2005-06-23  Martin Baulig  <martin@ximian.com>
19771         * class.c
19772         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
19773         generic type definitions.
19775 2005-06-23  Martin Baulig  <martin@ximian.com>
19777         Fix #75331.
19779         * metadata.c (mono_class_get_overrides): Renamed to
19780         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
19781         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
19782         pass it to mono_get_method_full().
19784 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
19786         * reflection.c (mono_reflection_create_runtime_class): take the
19787         mono_domain_lock in this method. Prevents deadlocks
19789 2005-06-22  Martin Baulig  <martin@ximian.com>
19791         * loader.c (method_from_methodspec): Fix #75330.
19793 2005-06-22  Martin Baulig  <martin@ximian.com>
19795         * reflection.c (type_get_qualified_name): Use
19796         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
19797         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
19798         argument; use it if we don't have an assembly name.
19800 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
19802         * object.c: In mono_message_init, set "copy out" flag for in
19803         parameters with the [Out] flag.
19805 2005-06-21  Martin Baulig  <martin@ximian.com>
19807         * class.c
19808         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
19809         and MONO_TYPE_PTR.
19811 2005-06-21  Martin Baulig  <martin@ximian.com>
19813         * class.c (mono_class_init): Don't initialize `class->fields' for
19814         generic instances since they're initialized again in
19815         compute_field_layout(). 
19816         (compute_field_layout): Set the field's `generic_info' here; fix
19817         #75320. 
19819 2005-06-21  Martin Baulig  <martin@ximian.com>
19821         * class-internals.h
19822         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
19824         * metadata.c (mono_metadata_generic_method_equal): Also
19825         distinguish the `generic_class'; fixes #75334.
19827 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19829         * domain.c:
19830         * appdomain.c:
19831         * domain-internals.h:
19832         * reflection.c: 'domain_assemblies' field is now protected by its own
19833         lock. Don't call into managed code to run the AssemblyLoad event if we
19834         now there are no registered delegates for it.
19836 2005-06-20  Martin Baulig  <martin@ximian.com>
19838         * class.c (mono_class_is_assignable_from): Use a custom version of
19839         mono_class_has_parent() to make things work for generic instances;
19840         fix #75300.
19842 2005-06-20  Martin Baulig  <martin@ximian.com>
19844         * loader.c (method_from_methodspec): Apply a patch from
19845         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
19847 2005-06-20  Martin Baulig  <martin@ximian.com>
19849         * class.c (mono_class_init): Reverted Zoltan's last change; it
19850         breaks generics.
19852 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
19854         * threads.c (wait_for_tids_or_state_change): Add missing locking.
19856 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19858         * socket-io.c: fix the index in the socket array for writable/error
19859         sockets. Fixes bug #75306.
19861 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
19863         * class.c (mono_class_init): Allow interfaces to have static ctors.
19865 2005-06-17  Martin Baulig  <martin@ximian.com>
19867         * loader.c (method_from_methodspec): Use `context->container' when
19868         parsing the `gmethod->inst'.
19870 2005-06-17  Martin Baulig  <martin@ximian.com>
19872         * class.c (mono_type_get_name_recurse): Don't add the assembly
19873         name for type arguments.
19875 2005-06-15  Martin Baulig  <martin@ximian.com>
19877         * reflection.c (mono_image_get_inflated_method_token): Encode
19878         correct klass; fixes #75260.
19880 2005-06-13 Michal Moskal <malekith@nemerle.org>
19882         * icall.c: Make GetCorrespondingMethod/Constructor take
19883         MonoReflectionMethod method not MonoMethod. Removed
19884         MonoType.GetCorrespondingField, and make
19885         MonoGenericType.GetCorrespondingField take name not
19886         MonoClassField.
19888 2005-06-13  Michal Moskal <malekith@nemerle.org>
19890         * reflection.c (field_encode_signature, encode_locals):
19891          Make sizes of buffers for types larger (for big generic types).
19892          (create_generic_typespec,
19893          mono_reflection_sighelper_get_signature_local,
19894          mono_reflection_sighelper_get_signature_field):
19895          Add asserts for too small buffers.
19897 2005-06-15  Martin Baulig  <martin@ximian.com>
19899         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
19900         if our parent is not a dynamic type.
19902 2005-06-15  Martin Baulig  <martin@ximian.com>
19904         * class-internals.h (MonoTypeNameFormat): New enum.
19906         * class.c
19907         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
19908         (mono_type_get_full_name): Removed.
19909         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
19910         argument instead of the boolean's.
19912         * icall.c (ves_icall_System_MonoType_getFullName):
19913         Added `gboolean assembly_qualified'.    
19915         * reflection.h
19916         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
19918         * reflection.c (mono_reflection_parse_type): Parse the new type
19919         name format.
19921 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19923         * icall.c: no need to convert from utf16 to utf8 and then back again
19924         after the call to GetLogicalDrives.
19926 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19928         * icall.c: frombase64. Fix problems exposed by new tests.
19930 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19932         * icall.c: added internal calls for converting char [] and strings in
19933         base64 into byte [].
19935 2005-06-10  Martin Baulig  <martin@ximian.com>
19937         * class.c (mono_class_create_generic_2): Read the nested classes
19938         from the metadata rather than from `gklass->nested_classes' since
19939         `gklass' might not be initialized yet.
19941 2005-06-09  Duncan Mak  <duncan@novell.com>
19943         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
19944         all public headers. Fixes #74919.
19946 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
19948         * domain.c: The key for proxy_vtable_hash is now a pointer
19949         array. Added new GHashFunc and GCompareFunc functions for this.
19951         * class.h: The list of interfaces in MonoRemoteClass is known in
19952         advance and can't grow (we create a new MonoRemoteClass if needed),
19953         so now the interface array can be allocated together with
19954         MonoRemoteClass.
19955         
19956         * object.c: Added a new method create_remote_class_key.
19957         Fixed mono_remote_class so it does not depend on
19958         mono_upgrade_remote_class.
19959         Removed extend_interface_array.
19960         Added new method clone_remote_class(), which makes a copy of a remote
19961         class and adds a new interface or class to it.
19962         mono_upgrade_remote_class() now creates a new remote class (or gets
19963         it from the cache) if an vtable upgrade is needed. In this way
19964         we make sure that other objects sharing the same remote class
19965         don't get the new vtable with unwanted interfaces.
19966         
19967         * object-internals.h:
19968         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
19969         
19970         * marshal.c: Track changes in mono_upgrade_remote_class().
19972 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
19973         * icall.c: Add runtime methods for obtaining members of inflated
19974         class, which were created from supplied non-inflated members. It
19975         is used in internal Get{Method,Constructor,Field} methods in
19976         System.Type
19978 2005-06-09  Martin Baulig  <martin@ximian.com>
19980         * reflection.c
19981         (mono_reflection_bind_generic_method_parameters): Fix #75169.
19983 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19984         * reflection.c (mono_image_basic_init): Define
19985         Version in MonoDynamicAssembly. 
19986         
19987 2005-06-08  Martin Baulig  <martin@ximian.com>
19989         Fix #75136.
19991         * loader.c
19992         (mono_method_signature_full): New public method; takes a
19993         `MonoGenericContext *'.
19994         (find_method): Use mono_method_signature_full() and pass the
19995         klass'es context to it.
19997         * class.c (mono_class_is_inflated_method): Use
19998         mono_method_signature_full() and pass the context to it.
20000 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
20002         * object.c: add proper locking in mono_remote_class_vtable(),
20003         fixes possible memory corruption.
20005 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
20007         * marshal.c (mono_remoting_marshal_init): set
20008         initialized after initialization.
20010 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
20012         * locales.c : hush.
20014 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
20016         * object.c (extend_interface_array): fix really silly
20017         memory corrupting / comparison bug.
20019 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20021         * reflection.c: Functions added to support the creation
20022         of CustomAttributeData, which includes Attribute data
20023         used by ReflectionOnly methods.
20025         * reflection.h:  mono_reflection_get_custom_attrs_data and
20026          mono_custom_attrs_data_construct added (functions exposed).
20028          * icall.c: Added mono_reflection_get_custom_attrs_data
20029          as icall.
20030         
20031 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
20033         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
20034         lupus's request.
20036 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
20038         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
20040         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
20041         dynamic DllImportAttribute.
20043         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
20044         dynamic DllImportAttribute.
20046         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
20047         Fixes #75162.
20049 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20051         * threads.c: avoid segfault when an unstarted thread is aborted.
20053 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
20055         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
20056         Returns the name and version of the runtime for reporting.
20058 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20060         * appdomain.c: bump corlib version.
20061         * object-internals.h: new field in MonoReflectionAssembly.
20063 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20065         * object-internals.h: Carlos forgot to add this field.
20067 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20069         * icall.c: Added create_version to create instances
20070         of Version of MonoReflectionAssemblyName. This change helps
20071         the AssemblyName tests to keep running fine.
20072         
20073 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
20074   
20075         * object.c (mono_method_return_message_restore): A somehow less
20076         intrusive fix for #75138.
20078 2005-06-03  Raja R Harinath  <rharinath@novell.com>
20080         * object.c (mono_method_return_message_restore): Fix computation
20081         of expected number of out args.
20083 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
20085         * reflection.c (mono_image_get_method_info): Fix the case when the
20086         charset is empty.
20088 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
20090         * object.c: Added missing null check in
20091           mono_method_return_message_restore.
20093 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
20095         * reflection.c (mono_image_get_method_info): Handle the case when
20096         dllentry is empty.
20098 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
20100         * object.c: When creating the vtable for a proxy, take into account
20101         all inherited interfaces, not only the ones registered in
20102         iclass->interfaces. This fixs bug #74996.
20103         Also, in mono_method_return_message_restore, verify that the array
20104         of out args has the expected lengh.
20106 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20108         * socket-io.c: update the timeout in Poll when the call is interrupte.
20110 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20112         * socket-io.c: support abort/suspend in Select_internal after last
20113         change.
20115 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20117         * threadpool.c: remove warning.
20119 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20121         * icall.c:
20122         * socket-io.[ch]: Select_internal uses poll() now when available, thus
20123         removing the 1024 limit from select(). Runtime part of the fix for
20124         bug #71203.
20126 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20128         * socket-io.c: when resolving the addresses for the same
20129         host returned by gethostname(), get the local IPs from the interface
20130         list. Loopback addresses are discarded if the are interfaces up with
20131         non-loopback ones. Fixes bug #63265.
20133 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
20135         * appdomain.c, verify.c, object-internals.h, reflection.c:
20136         bumped corlib number to 36, and added new extra_flags field
20137         to ReflectionMethodBuilder and friends.  Fixes #75060.
20139 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
20141         * gc.c: register a new weak link only if the object is non-null
20142         (fixes bug#75047).
20144 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
20146         * culture-info.h : short time pattern too.
20148 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
20150         * culture-info.h : expand long time pattern string length.
20152 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
20154         * culture-info-table.h : update (more French date format; #72788).
20156 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
20158         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
20159         the method is static. Fixes #75029.
20161 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
20163         * reflection.c: Update the table_idx field of method builders after
20164         saving the module, since it can change. This is a workaround for
20165         bug #74914. 
20167 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
20169         * culture-info-table.h : update (additional French date format).
20171 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
20173         * icall.c (ves_icall_type_Equals): Revert last change.
20174         
20175         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
20177         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
20179 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
20181         * class-internals.h: Added executioncontext_class field to 
20182         MonoDefaults structure.
20183         * domain.c: Cache System.Threading.ExecutionContext class in 
20184         mono_defaults.
20185         * object.c: Capture the ExecutionContext for asynchroneous calls in
20186          mono_async_result_new.
20187         * object-internals.h: Added execution_context and original_context 
20188         fields to MonoAsyncResult. Added execution_context to MonoThread.
20189         * security-manager.c|.h: Added mono_get_context_capture_method to 
20190         return the capture method (if required by the security manager or by
20191         the framework version used).
20192         * threadpool.c: Apply capture (if present) ExecutionContext in 
20193         mono_async_invoke and revert to original context after it completes.
20195 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
20197         * culture-info-table.h : updated (real hacky solution for zh-CHT).
20199 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
20201         * culture-info-table.h : zh-CHT related workaround.
20203 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
20205         * marshal.c (emit_marshal_custom): Add some error checking and call the
20206         methods in the ICustomMarshaler interface. Fixes #74875.
20207         
20208         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
20209         native->managed wrappers.
20211 2005-05-12  Martin Baulig  <martin@ximian.com>
20213         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
20214         here and use the loader lock.
20216         * mono-debug.c: Properly lock when the debugger is not attached.
20217         (mono_debug_init): Release the initial lock if we're not running
20218         in the debugger.
20220 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
20222         * marshal.c (emit_marshal_custom): Pass through NULL values without
20223         calling the custom marshalling routines.
20225         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
20226         conversion in structures. Fixes #74882.
20228 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
20230         * culture-info-table.h : zh-* cultures were missing.
20232 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
20234         * threads.c: Added a new event background_change_event which is signaled
20235         when a thread changes its background mode.
20236         Moved here several checks previously done in managed code. The checks
20237         require the thread lock, and using the thread lock in managed code
20238         can result in deadlocks.
20239         Merged Start_internal and Thread_internal into a single method. Now 
20240         Thread_internal does all work of creating and starting a thread.
20241         Added icalls for setting and getting the state of the object. Moved from
20242         managed code to avoid locking there.
20243         Added wait_for_tids_or_state_change() which is called instad of
20244         wait_for_tids when waiting for non-backround threads to end. This method
20245         will return if one of the threads ends or the background_change_event
20246         is signaled.
20247         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
20248         the background mode. This method signals the background_change_event
20249         event.
20250         * icall.c:
20251         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
20252         removed Start_internal.
20253         
20254 2005-05-11  Martin Baulig  <martin@ximian.com>
20256         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
20257         to order of some fields to get proper alignment on 64-bit machines.
20259 2005-05-11  Martin Baulig  <martin@ximian.com>
20261         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
20262         changes as they're broken and completely fuck up the debugger.
20264         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
20266 2005-05-10  Martin Baulig  <martin@ximian.com>
20268         * reflection.c (mono_reflection_generic_class_initialize): Don't
20269         call mono_class_setup_parent() here.
20271 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20273         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
20274         send/receive timeout use an integer in milliseconds. We were using a
20275         struct timeval.
20277 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20279         * locales.c:
20280         (internal_get_cultures): reserve the first slot of the array for the
20281         InvariantCulture, which will be filled in managed code.
20283 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
20285         * reflection.c (mono_image_fill_module_table): Initialize the
20286         GENERATION field as well.
20288 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20290         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
20291         Monitor.Enter on the object.
20293 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
20295         * threads.c: Enable the wait for running threads when exiting.
20296         * icall.c: Suspend all threads before exiting.
20298 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
20300         * assembly.c (mono_assembly_load_reference): Fix warning.
20302 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20304         * threadpool.c: changed the default number of threads per cpu. From now
20305         on, the default will be 20 + (5 * number of cpus) instead of 50.
20307 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
20309         * loader.c (mono_method_get_signature_full): Add locking here.
20311 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
20313         * appdomain.c: Moved methods for parsing and freeing assembly
20314         names to assembly.c.
20315         * assembly.c, domain-internals.h: Created public methods for parsing
20316         assembly names. Fixed mono_assembly_load_with_partial_name:
20317         it now finds the best match, taking into account the version,
20318         token and culture specified in the partial name. Also return
20319         the latest version if no version information is specified.
20321 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
20323         * threadpool.c: replace check for SocketAsyncCall class.
20325 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20327         * threadpool-internals.h:
20328         * Makefile.am: added threadpool-internals.h
20330         * threadpool.c: call mono_unhandled_exception on exceptions not handled
20331         that happen in threadpool threads (tested on MS).
20332         (mono_thread_pool_remove_socket): new function that dispatch any pending
20333         AIO call on a socket that is closing. By now only epoll really needs it,
20334         as select/poll wake up when the socket closes.
20337         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
20339 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
20341         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
20343 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
20345         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
20347 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
20349         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
20350         has an abort request, convert it into a suspend request.
20352 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
20354         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
20355         warning for the usage of `UnmanagedFunctionPointerAttribute' which
20356         is not supported yet.
20358 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20360         * image.c: register assemblies loaded from data (bundles) in the loaded
20361         assemblies hash. Fixes bug #74772.
20363 2005-04-29  Martin Baulig  <martin@ximian.com>
20365         * class.c (mono_type_get_name_recurse): Update to the new naming
20366         schema from the latest .NET 2.x beta2.
20367         (mono_class_setup_vtable_general): If we're a generic instance,
20368         copy the vtable from our generic type definition and inflate all
20369         the methods in it.
20371         * loader.c (find_method): Update to the new naming schema from the
20372         latest .NET 2.x beta2.
20374 2005-04-29  Raja R Harinath  <harinath@gmail.com>
20376         * class.c (mono_class_init): Add a mono_loader_unlock to the
20377         #74734 fix.
20379 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
20381         * icall.c (ves_icall_System_Environment_Exit): Remove the 
20382         suspend_all_other_threads () call for the time being, since it can hang.
20384         * threads.c (mono_thread_manage): Similarly, disable the waiting for
20385         the background threads to exit, since it can also hang.
20387         * class.c (mono_class_init): Applied patch from Ankit Jain 
20388         (radical@gmail.com). Avoid pending init errors when a field refers
20389         to a nested class using a typeref. Fixes #74734.
20391         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
20392         this for dynamic modules.
20394 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20396         * threads.c: don't wait for threads that are in the process of aborting
20397         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
20398         and waiting for background threads to finish. This makes xsp and
20399         mod-mono-server exit without random length delays and/or hangs.
20401 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20403         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
20405 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
20407         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
20408         dynamic types to prevent infinite loops. Fixes #74727.
20410         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
20411         ..._is_assignable_to.
20413 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
20415         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
20417 2005-04-25  Martin Baulig  <martin@ximian.com>
20419         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
20421         * domain.c
20422         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
20424         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
20426         * reflection.c (build_compressed_metadata): Set metadata header
20427         version to 2.0.
20429 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
20431         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
20432         number into an integral and a decimal part. Fixes #70473.
20434         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
20436 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
20438         * culture-info-table.h : reflected the latest locale-builder output.
20440 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20442         * threadpool.c: check for SuspendRequested too when deciding if
20443         mono_thread_interruption_checkpoint should be called.
20445 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20447         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
20448         * threads.c: remove interruption_mutex and use Interlocked instead. When
20449         suspending all the threads, wait for all the suspended events at once.
20450         If we're shutting down and get an APC that is going to be queued,
20451         call mono_thread_execute_interruption immediately, as the thread might
20452         be sleeping on a pthread condition or mutex.
20454         * icall.c: call mono_runtime_set_shutting_down before suspending the
20455         threads.
20457         Fixes bug #74693. And now xsp is happier when exiting.
20459 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
20461         * loader.c (mono_stack_walk): Fix #74690.
20463 2005-04-22  Martin Baulig  <martin@ximian.com>
20465         * mono-debug.h (MonoDebugMethodJitInfo): Added
20466         `MonoDebugMethodJitInfo *jit'.
20468         * mono-debug.c (mono_debug_read_method): Cache the
20469         MonoDebugMethodJitInfo in `address->jit'.
20470         (mono_debug_free_method_jit_info): New public method.
20472 2005-04-22  Martin Baulig  <martin@ximian.com>
20474         * class.c (mono_class_is_assignable_from): Disallow
20475         type parameter -> interface.
20477 2005-04-21  Dick Porter  <dick@ximian.com>
20479         * threads.c (mono_thread_create): Turn an assertion into an error.
20481 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
20483         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
20484         
20485         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
20486         Fix some gcc 4.0 warnings.
20488 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
20490         * file-io.c: fix alt dir separator char on unix systems
20491         and cleanup (fixes bug #71214).
20493 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
20495         * marshal.c: Use CALLVIRT instead of CALL when dispatching
20496         a call to a remote domain, since the method may be an
20497         interface method in the client domain. This fixes bug #74192.
20499 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20501         * threadpool.c: recv/send are now performed before going back to managed
20502         code to save one transition.
20504 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20506         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
20508         * metadata/threadpool.c: removed hack to workaround the bug above.
20510         Fixes bug #74618.
20512 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
20514         * reflection.c reflection.h: Fix handling of parameter defaults in
20515         dynamic methods. Also fixes handling of parameter attributes.
20516         Fixes #74609.
20518         * mono-debug.c (mono_debug_close_image): Fix warning.
20520 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20522         * socket-io.h: replaced old unused field with new 'blocking'.
20523         * threadpool.c: restore socket blocking state on windows(tm).
20525 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
20527         * icall.c: don't return the codebase in the AssemblyName[] returned by
20528         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
20529         * object-internals.h: Removed FIXME (fields were presents) and fixed
20530         versioncompat declaration.
20532 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20534         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
20535         not closed, so don't cleanup when it happens.
20537 2005-04-13  Chris Toshok  <toshok@ximian.com>
20539         * mono-debug-debugger.h: change prototype for
20540         mono_debugger_lookup_type.
20542         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
20543         this function, although it should probably be named
20544         mono_debugger_init_type.
20546 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20548         * threadpool.c: fix non-AIO case.
20550 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
20552         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
20553         the built-in profiler to measure just JIT compilation times.
20555 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20557         * threadpool.c: the epollfd might be closed by another thread at
20558         any time, so ignore EBADF at treat it as a "we're closing" sign.
20560 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20562         * threadpool.c: release the semaphores with a count equals to the number
20563         of working threads in both IO and regular pools. Fixed typo that messed
20564         up the count of IO pool threads. Don't initialize the pipe handles if
20565         we're using epoll.
20567 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20569         * threadpool.c: some systems don't like a NULL when deleting the socket
20570         from epoll.
20572 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20574         * threadpool.c: fix semaphore allocation.
20576 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20578         * threadpool.c: added epoll() based implementation for asynchronous IO
20579         that is used instead of the default poll() when available.
20580         It can be disabled by setting MONO_DISABLE_AIO.
20582 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20584         * threadpool.c: windows needs 'closesocket' and instead of returning
20585         0 when the stream is closed while in select, it returns -1. Fixes bug
20586         #74573.
20588 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
20590         * class.c (class_compute_field_layout): Fix the regression caused by
20591         the previous try.
20593 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20595         * threadpool.c: separate pool for socket async. IO.
20596         * threadpool.h: mono_max_worker_threads is not a global any more.
20598 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
20600         * class.c (class_compute_field_layout): Fix #74549.
20602 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20604         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
20605         use 2 connected sockets instead.
20607 2005-04-08  Miguel de Icaza  <miguel@novell.com>
20609         * mono-config.c: Add new entry point for mkbundle
20610         mono_config_parse_memory. 
20612 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20614         * threadpool.c: removed another unused function.
20616 2005-04-08  Ankit Jain  <radical@corewars.org>
20618         * reflection.c (get_default_param_value_blobs): Add 'types'
20619         parameter to get the types encoded in the constant table.
20620         (mono_param_get_objects): Use the type from the constant table,
20621         not the type of the parameter, when creating default values.
20622         Handle null default values correctly.
20624 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20626         * file-io.c:
20627         * file-io.h:
20628         * threadpool.c:
20629         * threadpool.h:
20630         * icall.c:
20631         * socket-io.c: removed dead code for async IO.
20633 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20635         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
20637         * threadpool.c: intercept socket async. calls and pass them to a thread
20638         that is polling and dispatching the job items to the threadpool as
20639         socket become ready. Fixes bugs #71217, #71933.
20641         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
20642         between char and short/ushort arrays.
20644         * socket-io.c: remove dead code.
20646 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
20648         * locales.c,
20649           icall.c : removed InternalToUpper_Comp() and
20650           InternalToLower_Comp().
20652 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
20654         * char-conversions.h : The tables were incorrectly generated. Should
20655           be generated against invariant culture.
20657 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
20659         * object.c (mono_runtime_invoke_array): Fix return value when 
20660         passing pre-created valuetype objects to ctors.
20662         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
20663         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
20664         Fixes #74338.
20666 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
20668         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
20669         only used with --security and hides the wrong corlib version error.
20671 2005-03-30  Joshua Tauberer  <tauberer@for.net>
20673         * class.c: Changed mono_class_name_from_token so that types
20674         outside of a namespace don't have an initial period.  Improved
20675         the g_warning message used in _mono_class_get when loading
20676         fails.
20677         * assembly.c: In mono_assembly_load_reference, when an assembly
20678         can't be found, "No such file or directory" is misleading and
20679         unhelpful because a few paths were checked for the presence of
20680         the assembly.  When that happens (ENOENT), display a nicer
20681         message indicating the directories that were searched.  In all
20682         cases, the warning is made easier to read for non-hackers.
20684 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
20686         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
20687         project/solution.
20688         * appdomain.h|domain.c: Removed inline from functions.
20689         * appdomain.c: Reduced warnings when compiling on windows.
20690         * icall.c: Fixed output_debug declaration to gunichar2*.
20691         * mono-config.c: Reduced warnings when compiling on windows.
20692         * rand.c: Added missing "windows.h". Added missing return value.
20693         * rawbuffer.c: Added missing winsock2.h for windows.
20694         * sysmath.h: Added mono-compiler.h header to allow/ease 
20695         compilation with non-GCC compilers.
20696         * threads.c: Fixed declarations to compile with VS.NET C compiler.
20697         Removed cast warnings.
20699         Adapted from the work of J Lothian (for VC6).
20701 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
20703         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
20704         from default_path.
20706 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
20708         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
20709         the 2.0 profile.
20711 2005-03-27  Raja R Harinath  <harinath@gmail.com>
20713         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
20714         has to be in $(exec_prefix).  $(prefix) is for arch-independent
20715         stuff, and it would probably use $(prefix)/share rather than
20716         $(prefix)/lib.
20718 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20720         * console-io.c: added 2 includes that might be missing.
20722 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
20724         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
20725         profile.
20727         * reflection.c (create_custom_attr): Allocate the params array using
20728         alloca so it gets GC tracking.
20730 2005-03-23  Chris Toshok  <toshok@ximian.com>
20732         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
20733         out some spew.
20735 2005-03-24  Raja R Harinath  <rharinath@novell.com>
20737         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
20738         changes to pick up any changes in prefix, etc.
20740 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
20742         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
20743         
20744         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
20745         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
20747 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
20749         * class-internals.h object-internals.h class.c reflection.c: Extend the
20750         mono_lookup_dynamic_token () function to return the class of the
20751         token as well. 
20753         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
20754         well. Fixes #73848.
20756 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
20758         * security-manager.c: Skip inheritance checks for intra-corlib
20759         class inheritance and method overrides. This skips a lot of checks
20760         and (anyway) permissions cannot work until corlib is loaded.
20762 2005-03-23  Martin Baulig  <martin@ximian.com>
20764         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
20765         MONO_TYPE_GENERICINST.  
20767 2005-03-23  Martin Baulig  <martin@ximian.com>
20769         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
20771 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
20773         * class.c: added locking comments to some functions.
20774         Cache the interface offsets arrays (saves about 20 KB
20775         of runtime memory in a typical app).
20776         Reduce the time overhead in mono_class_setup_supertypes ().
20778 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
20780         * icall.c: speedup and fix leaks in GetMethodsByName and
20781         GetPropertiesByName.
20783 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20785         * reflection.c: some locking fixes.
20787 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
20789         * metadata.c: added missing break in case statement.
20791 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
20793         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
20794         typedbyref return values. Fixes #73941.
20796 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
20798         * security-manager.c|h: Added demandunmanaged method and 
20799         suppressunmanagedcodesecurity class to MonoSecurityManager.
20800         Renamed aptc class to allowpartiallytrustedcallers.
20802 2005-03-17  Martin Baulig  <martin@ximian.com>
20804         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
20806 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20808         * file-io.c: disabled file async. IO using aio_*. It uses the
20809         threadpool now. Workaround for bug #73718.
20811 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20813         * assembly.h, mono-config.c: added code to deal with bundled configs
20814         for bundled assemblies.
20816 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
20818         * *.c, private.h: cleanup, removing old private.h header file.
20820 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
20822         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
20823         and throw_on_unmappable_char attributes.
20825 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
20827         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
20828         _ProcessName_internal.
20830 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
20832         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
20833         #73631.
20835         * icall.c threads.c threads-types.h: Remove slothash icalls as they
20836         are no longer used.
20838 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
20840         * object.c (compute_class_bitmap): Add support for generics. Fixes
20841         #73527.
20843 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
20845         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
20847 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20849         * filewatcher.c: commented out the code for windows watcher, as we don't
20850         use it (we use the managed implementation instead).
20852 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
20854         * object-internals.h (MonoThread): Remove 'unused1' field.
20856         * appdomain.c: Bump corlib version.
20858         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
20860         * reflection.c (mono_reflection_create_runtime_class): Remove the
20861         AssemblyBuilder.Save optimization since it causes too many problems.
20863 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
20865         * exception.c|h: Added mono_get_exception_reflection_type_load to
20866         create a ReflectionTypeLoadException object.
20867         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
20868         to return NULL is a InheritanceDemand fails during reflection. Updated
20869         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
20870         ReflectionTypeLoadException if an InheritanceDemand fails during 
20871         reflection. Added icall mapping for GetLinkDemandSecurity.
20872         * security-manager.c|h: Added ves_icall_System_Security_
20873         SecurityManager_GetLinkDemandSecurity internal call to return the
20874         class and methods permissions set for a LinkDemand. Removed unused
20875         fields in MonoSecurityManager.
20877 2005-03-10  Martin Baulig  <martin@ximian.com>
20879         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
20880         it's a generic instance.
20882 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
20884         * reflection.c (mono_get_object_from_blob): Applied patch from
20885         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
20887         * class.c (mono_class_is_assignable_from): Another try at fixing 
20888         #73469 without breaking anything.
20890 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
20892         * class.c: (mono_class_is_assignable_from): Revert the last changes
20893         since they don't work with generics.
20894         
20895         * class.c (mono_class_is_assignable_from): Fix build bustage.
20897         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
20898         the managed IsAssignableFrom method. Fixes #73469.
20900         * reflection.c (mono_reflection_call_is_assignable_from): New helper
20901         function.
20903 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
20905         * object.c (mono_load_remote_field_new): Fix returning uninitialized
20906         memory when the remoting callback does not sets the out arguments.
20907         Fixes #73007.
20909         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
20910         by mistake.
20912         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
20914         * object-internals.h (MonoStackFrame): Sync with managed object layout.
20916         * appdomain.c: Bump corlib version.
20918 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
20920         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
20921         function.
20923         * threads.c (mono_thread_attach): Detect threads which are not started
20924         by the GC pthread wrappers.
20926 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
20928         * icall.c: Added new icall for RNG.
20929         * rand.c|h: Added new icall to open the RNG. This allows to share a 
20930         single handle on Linux to access /dev/urandom and fix #73183.
20932 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
20934         * object.c: setting the new vtable in a transparent proxy object must
20935         not change the GC descriptor.
20937 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20939         * object.c: fixed compilation without GCJ support.
20940         * reflection.c: for runtime-created types ensure klass->has_references
20941         is correct (bug #73215).
20943 2005-03-02  Martin Baulig  <martin@ximian.com>
20945         * class.c (mono_class_is_assignable_from): Make this work if
20946         `oklass' is a generic instance; fixes #72831.
20948 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
20950         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
20951         with hasthis set.
20952         
20953         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
20955         * marshal.c: Reorganize native->managed marshalling code to also use
20956         the emit_marshal_... functions.
20958 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
20960         * object.c: typed allocs have issues with bitmap sizes > 30,
20961         so check for max_set >= 30.
20963 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
20965         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
20966         managed code. Fixes #73012.
20968         * metadata.h (MonoMarshalSpec): Add elem_mult field.
20970         * metadata.c reflection.c: Load/Emit elem_mult as well.
20971         
20972         * metadata.h (MonoMarshalSpec): Add comment.
20974         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
20976         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
20977         num_elem to -1 if not given.
20979         * object-internals.h (MonoReflectionMarshal): Add has_size field.
20981         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
20982         given values.
20984 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
20986         * null-gc.c (mono_gc_free_fixed): Was not compilable.
20988 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
20990         * reflection.c (encode_marshal_blob): Encode param_num field as well.
20992         * object-internals.h (MonoReflectionMarshal): Add param_num field.
20994 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
20996         * object.c: generalized the reference bitmap creation
20997         and added hooks for the new GC.
20998         * class-internals.c: removed the gc_bitmap field from MonoClass.
21000 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21002         * domain.c: help the compiler to produce better code
21003         in mono_jit_info_table_find ().
21005 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
21007         * object.c: make all allocations look typed.
21009 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21011         * socket-io.c: load Mono.Posix if it's not loaded already
21012         (fixes bug#73033).
21014 2005-02-24  Martin Baulig  <martin@ximian.com>
21016         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
21017         * reflection.c (dup_type): Likewise.
21019 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
21021         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
21022         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
21024 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21026         * domain.c, threads.c, object-internals.h: make the critical thread
21027         local vars use the fast access mode (even when we're compiled in
21028         a lib). Provide accessors to be used by the jit during codegen.
21030 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21032         * appdomain.c: Changed hook functios behavior to include
21033         support for the reflection only assemblies. Some icalls were changed
21034         to support the mentioned assemblies too. Signatures of static methods
21035         try_assembly_resolve and real_load now have an additional parameter:
21036         refonly.
21038         * assembly.c: General changes to mono_assembly_ methods to support
21039         reflection only api. Functions mono_assembly_open, mono_assembly_load,
21040         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
21041         suffix, to support an additional gbool parameter to specify whether
21042         the assembli is reflection only or not. Created some new hook functions 
21043         to add support for reflection only assemblies. Signatures of static 
21044         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
21045         have now an additional parameter: refonly.
21047         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
21048         indicating whether the assembly is reflection only or not.
21050         * exception.c: Add mono_get_exception_invalid_operation.
21052         * icall.c: Throw an InvalidOperationException when trying to invoke
21053         a property/method/event, or trying to set/get the value of a field.
21054         Also add an icall to retrieve the ref_only flag to the
21055         MonoReflectionAssembly.
21057 2005-02-23  Chris Toshok  <toshok@ximian.com>
21059         Part of fix for #72827.
21060         * mono-debug.c (mono_debug_add_method): add lexical block data to
21061         the info we write.  Kind of a hack at the moment - we copy the
21062         lexical block info from the MonoDebugMethodInfo to the
21063         MonoDebugMethodJitInfo here, before writing it.
21064         (mono_debug_read_method): read the lexical block info.
21066         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
21068         * debug-mono-symfile.h: add lexical block support.
21070         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
21071         support.
21073 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
21075         * loader.c (mono_lookup_pinvoke_call): Fix warning.
21077         * object.c (mono_runtime_free_method): Call mono_free_method () and
21078         put the TODOs there.
21080         * loader.c (mono_free_method): Free up most memory allocated for 
21081         dynamic methods.
21083 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
21085         * reflection.c: properly flag a Type argument to a
21086         named custom attr value (bug #72248).
21088 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21090         * reflection.c: reduce code duplication in named custom
21091         attribute encoding.
21093 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
21095         * reflection.c: properly encode custom attrs of type object
21096         (bug #72649).
21098 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
21100         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
21102 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
21104         * socket-io.c: load System.dll if it's not loaded already
21105         (bug #72850 and #70477).
21107 2005-02-21  Martin Baulig  <martin@ximian.com>
21109         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
21110         generic instances.
21112 2005-02-21  Martin Baulig  <martin@ximian.com>
21114         * reflection.c (mono_image_build_metadata): We also need to
21115         "fixup" the MethodImpl table after we computed the final method
21116         indices.  Call fixup_methodimpl() to do that.
21117         (fixup_methodimpl): New private method.
21119 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
21121         * assembly.c: special case mscorlib.dll (bug#72536),
21122         patch from Carlos Alberto Cortez.
21124 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
21126         * threads-types.h threads.c: Fix build bustage.
21128         * threads.c: Use a union for long<->double conversions.
21130         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
21131         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
21133         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
21134         containing the checkpoint call with NOT_TAKEN.
21135         
21136         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
21137         checkpoint before pushing the arguments, so they won't have to be
21138         spilled to stack.
21140 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21142         * domain.c, assembly.c, domain-internals.h: make some data
21143         const and relocation-free.
21145 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
21147         * object.c, appdomain.c, class-internals.h: introduce the
21148         MonoClassRuntimeInfo structure to hold the info needed to
21149         use a class at runtime. Made mono_class_vtable() lock-free
21150         for all the appdomains.
21152 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
21154         * metadata-internals.h, image.c: introduce a per-image mempool to
21155         be used for memory that has the same lifetime as the image.
21157 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
21159         * domain.c: In mono_init_internal(), instead of selecting the first
21160         runtime version supported by an executable, get a list of all
21161         supported versions and select the one for which an mscorlib exists
21162         (since even if the runtime supports a given version, it doesn't mean
21163         that the framework for that version is installed).
21164         Modified get_runtimes_from_exe to support this behavior.
21165         In supported_runtimes, added information about additional system
21166         assembly versions.
21167         
21168         * assembly.c: Added support for more than one system assembly version
21169         per runtime version. Updated the assembly list.
21170         In mono_assembly_remap_version, removed the initial version check,
21171         since we don't know to which version we need to compare until we
21172         get the version set on which the assembly is based.
21173         Moved the code for loading corlib into the new method
21174         mono_assembly_load_corlib(), so it can be used by the initialization
21175         code.
21176         
21177         * domain-internals.h: Updated data structures and added declaration
21178         for mono_assembly_load_corlib.
21180 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
21182         * reflection.c (resolve_object): Fix the creation of the signature in 
21183         the SignatureHelper case.
21185         * assembly.c (mono_assembly_remap_version): Fix binary search.
21186         
21187 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
21189         * class.c: Added inheritance check when a method is overloaded (from a
21190         virtual method or when implementing an interface) and when a class is
21191         inherited. Added functions to set a failure for a class and to 
21192         retreive the exception from a failure.
21193         * class-internals.h: Added fields to MonoClass to keep the exception
21194         information status for inheritance (or other exceptions) to be thrown
21195         later (i.e. not at load time).
21196         * object.c: Throw the inheritance SecurityException when a type is to 
21197         be created with either class or method inheritance violations.
21198         * reflection.c|h: Fix when getting declsec from a class. Removed 
21199         unrequired code for class. Improved sanity in parameter naming.
21200         * security-manager.c|h: Added functions to check for class and method
21201         inheritance.
21203 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
21205         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
21206         and has_finalize in dynamic types as well.
21208 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
21210         * culture-info-table.h : fixed currency format for en-GB (and so on).
21212 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
21214         * gc.c: ensure the GC handles never have 0 as a value.
21216 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
21218         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
21219         a pointer to a struct to unmanaged code. Fixes #72625.
21221 2005-02-16  Martin Baulig  <martin@ximian.com>
21223         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
21225 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
21227         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
21229 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
21231         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
21233         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
21234         UnmanagedFunctionPointerAttribute, use it for determining calling convention
21235         etc. Fixes #71471.
21237         * reflection.c (mono_custom_attrs_get_attr): New helper function.
21239         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
21241 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
21243         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
21244         changes to make the current context a field in MonoThread.
21246 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
21248         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
21249         the last change.
21250         
21251         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
21252         extracted from mono_marshal_get_native_wrapper.
21254         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
21255         to create wrappers around native functions.
21257         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
21258         delegates for arbitrary function pointers. Fixes #71472.
21260 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
21262         * threads.c: cleaned up the code a little.
21264 2005-02-15  Martin Baulig  <martin@ximian.com>
21266         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
21267         the data table.
21269         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
21270         allocate larger chunks if needed.
21272 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
21274         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
21275         in by mistake.
21277 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
21279         * domain.c: keep the domains in an array and ensure the domain ids
21280         are kept small, so they can be used as indexes to domain-specific data
21281         with a small memory overhead.
21283 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
21285         * icall.c: Handle byref types in Type icalls. Fixes #72544.
21287 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
21289         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
21291 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
21293         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
21295         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
21296         values.
21298         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
21299         
21300 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
21302         * domain-internals.h: add the hashtable here.
21304         * class-internals.h: Remove `info' from MonoMethod
21306         * domain.c: Add a new hashtable, jit_trampoline_hash
21308 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
21310         * object.c: don't set the value of static fields
21311         (fixes bug#72494).
21313 2005-02-11  Martin Baulig  <martin@ximian.com>
21315         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
21316         (mono_debug_add_method): Silently ignore the method if it's too big.
21317         (mono_debug_add_type): Likewise.
21319 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
21321         * threads.c, appdomain.c: remove #ifdefs from the code.
21323 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
21325         * metadata-internals.h: Added flags to MonoAssembly to cache the most
21326         common security informations. This allows us to stay in unmanaged code
21327         when doing LinkDemand and it's special cases (except for the first 
21328         time for initialization). The flags a very much used with --security.
21329         * reflection.c|h: Added code to get declarative security attributes 
21330         for LinkDemand and InheritanceDemand. This required to refactor the
21331         existing code for Demand.
21332         * security-manager.c|h: Added new method fields for the special cases
21333         of LinkDemand.
21335 2005-02-10  Martin Baulig  <martin@ximian.com>
21337         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
21338         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
21340 2005-02-10  Martin Baulig  <martin@ximian.com>
21342         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
21343         debugging code; this is almost a complete rewrite.
21345         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
21347 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
21349         * domain.c, object.h: expose mono_string_equal () and 
21350         mono_string_hash ().
21351         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
21352         it's implemented in managed code.
21354 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21356         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
21357         lo leak objects between appdomains.
21359 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21361         * assembly.c: old compilers compilation fix from 
21362         robertj@gmx.net (Robert Jordan).
21364 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
21366         * class-internals.h: Little reminder for the future.
21368         * debug-helpers.c: Fix up wrapper_type_names
21370 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21372         * image.c, metadata-internals.h: when loading an image from a file,
21373         mmap all of it and use the same codepaths as when using a
21374         in-memory image: the code is simpler and we use less memory
21375         (both writable and readonly).
21377 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
21379         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
21380         API to alloc runtime data structures that need to be tracked by the
21381         GC and contain pointers.
21382         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
21383         make the code more readable and eventually use a different GC.
21385 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
21387         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
21388         for out arguments.
21389         
21390 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
21392         * object.c: In release_type_locks(), don't release the cctor lock
21393         if it has already been released. This fixes a crash in the
21394         thread5 test.
21396 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21398         * gc.c, marshal.c, icall.c: register a delegate for finalization
21399         only when the native function pointer has been allocated for it.
21401 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
21403         * object.c: cleaned up some code, allocate objects that are
21404         pointer free with the atomic malloc variant. Allocate memory
21405         for static data from the mempool if it's pointer-free.
21406         Allocate the bounds array at the end of the array data, when needed.
21407         * object-internals.h, object.h: move a private function in a private
21408         header.
21409         * class.c: handle missing case in tracking references in fields.
21411 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
21413         * class.c, class-internals.h: keep track if a type has
21414         reference fields in either the instance or static fields.
21416 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
21418         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
21419         and renamed to MonoRuntimeInfo. Added fields to store the expected
21420         framework assembly version. Changed mono_get_framework_version and
21421         mono_get_runtime_version for a single mono_get_runtime_info method.
21422         
21423         * assembly.c: Added method to remap system assembly versions to the
21424         current executing runtime version. Removed old mapping code.
21425         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
21426         
21427         * icall.c, reflection.c: Track api changes.
21429 2005-02-06  Miguel de Icaza  <miguel@novell.com>
21431         * loader.c (method_from_memberref): Improve error reporting,
21432         produce the class name instead of the typeref/typedef index. 
21434 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
21436         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
21438 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21440         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
21441         stdcall and charset name mangling.  Reorganize the code and add
21442         some tracing stuff.
21444 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
21446         * monodiet.c: More iters!
21448         * marshal.c: Iter usage.
21450         * icall.c: Iter usage.
21452         * object.c: Use iters.
21454         * debug-helpers.c: More iters
21456 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21458         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
21459         under win32.
21461 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
21463         * mono-debug-debugger.c: use iters
21465         * class.c, class-internals.h: mono_class_setup_events is static
21466         now
21468         * All callers: use iters
21470 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21472         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
21473         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
21475 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
21477         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
21479         * marshal.h: Add prototypes for ldfld/stfld_remote.
21481         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
21482         this is called during startup.
21483         
21484 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
21486         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
21487         MonoThreadsSync struct private in monitor.c. Changed the way
21488         MonoThreadsSync is allocated so it's faster and there is no
21489         need to keep track of it with a finalizer and it uses less memory.
21490         This also finally allows us to allocate mono objects as ptrfree when
21491         there are no reference fields.
21493 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
21495         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
21496         disappearing link to the GC interface and use them to simplify
21497         the gchandles code.
21499 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
21501         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
21502         stfld_remote which call mono_load/store_field_new. This allows methods
21503         calling ldfld/stfld wrappers to be AOTed.
21505         * console-io.c: Include sys/filio.h under solaris.
21506         
21507         * console-io.c: Include curses.h if needed correctly.
21509 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
21510         
21511         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
21512         method->klass as well.
21514         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
21516         * class.c (mono_class_init): Switch on lazy initialization of 
21517         methods.
21519         * class.c (mono_class_get_finalizer): Handle the case when the 
21520         finalizer is inherited.
21522 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21524         * console-io.c: <curses.h> is needed by term.h on solaris.
21526 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
21528         * icall.c, class-internals.h, monodiet.c, class.c: Remove
21529         mono_class_setup_properties where possible. Remove this ftn from
21530         the header file, and make it static.
21532 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
21534         * loader.c: Add missing setup_... call.
21536         * class.c: Add missing setup_... calls.
21538         * class.c (mono_class_init): Switch on lazy initialization of 
21539         the generic vtable.
21540         
21541         * class.c (mono_class_init): Fix generics broken by the recent changes.
21543         * monodiet.c (handle_type): Add missing setup_... calls.
21545         * class.c: Back out garbage in previous patch.
21546         
21547         * class.c: Add missing setup_... calls.
21549         * class.c (mono_class_get_method_from_name_flags): Avoid calling
21550         mono_class_setup_methods () if possible.
21552         * class-internals.h (MonoClass): Add 'has_cctor' flag.
21554         * class-internals.h (MonoCachedClassInfo): New structure.
21556         * class.c: Initialize properties and events fields of MonoClass lazily.
21558         * class.c: Add infrastructure for lazily initializing the methods and
21559         vtable fields of MonoClass. Not yet used.
21561         * class.c (mono_class_get_finalizer): New helper function.
21563         * class.c: Add infrastructure for loading some class related data from
21564         an AOT file.
21566         * object.c: Add infrastructure for initializing the vtable from data
21567         in the AOT file.
21569         * gc.c (run_finalize): Use mono_class_get_finalizer ().
21571         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
21572         appropriate initialization function before accessing parts of the
21573         MonoClass structure.
21575         * marshal.c: Fix warnings.
21576         
21577         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
21579         * mono-debug-debugger.c (get_exception_message): Use 
21580         mono_class_get_method_from_name_flags ().
21582 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
21584         * reflection.c, appdomain.c: Replace a few manual searches that
21585         Zoltan missed. (Paolo approved this part of my initial patch).
21587 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
21589         * profiler.c: disable recording statistical events at report time.
21591 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21593         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
21594         to byteswap arrays of enum values, too (bug #72080).
21596 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
21598         * appdomain.c (set_domain_search_path): Allow this to be called if
21599         domain->setup is not yet set.
21601         * loader.c (mono_method_get_index): New helper function.
21603         * loader.c reflection.c: Use mono_method_get_index ().
21605         * class.c (mono_class_get_method_from_name_flags): New helper method.
21607         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
21608         this.
21610         * class.c (mono_class_get_cctor): New helper method.
21612         * string-icalls.c object.c class.c marshal.c reflection.c: Use
21613         mono_class_get_method () to look up methods.
21615 2005-02-01  Miguel de Icaza  <miguel@novell.com>
21617         * console-io.c: Fix the build, this should work on Windows.
21619 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
21621         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
21622         be set to null to keep things valid
21624 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21626         * icall.c: added Console 2.0 icalls.
21627         * Makefile.am: added console-io.[ch]
21628         * console-io.[ch]: internal calls for Console 2.0 API.
21630 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21632         * class.c: make sure we consider all the interfaces
21633         when calculating max_interface_id (bug found by
21634         Jeroen Frijters running ikvm).
21636 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
21638         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
21639         valuetype fields to null.
21641         * object.c (set_value): Ditto. Fixes #71669.    
21643 2005-01-31  Martin Baulig  <martin@ximian.com>
21645         * metadata.c (mono_metadata_has_generic_params): New public
21646         function; checks whether something is a generic method.
21648 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
21650         * appdomain.c: fix infinite recursion when adding assemblies.
21652 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
21654         * object.c: Fix small typo to return all items for Environment.
21655         GetCommandLineArgs.
21657 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
21659         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
21660         reflection.c: more domain and assembly-unload related fixes
21661         and memory leaks plugs.
21663 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
21665         * 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.
21667 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
21669         * loader.c (mono_method_signature): Make this method lazy
21670         (mono_get_method_from_token): Don't computate the signature here.
21672         Doing this saves quite a bit of memory. I got 90 kb on starting up
21673         monodoc. It should also save some disk reads on startup.
21675         * *: MonoMethod->signature might be NULL now. You *MUST* use
21676         mono_method_signature.
21678 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
21680         * object.c (mono_runtime_get_main_args): Return an array from the
21681         current domain here. Fixes #71938.
21683 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
21685         * monitor.c: formatting changes to comply with the
21686         mono coding style and remove #ifdefs from the code.
21688 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
21690         * metadata.c, private.h: remove some unneeded data
21691         and use a more compact representation for table schemas.
21693 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
21695         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
21696         to get a better distribution in hash tables.
21697         * *.c: use mono_aligned_addr_hash() where appropriate.
21698         * assembly.c: make var static.
21700 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
21702         * domain-internals.h: Put MonoJitInfo on a diet.
21704         * domain.c: Fix a warning.
21706 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21708         * gc.c: rework the gc handles code to reuse handles
21709         when freed.
21711 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
21713         * domain.c: fixed long standing bug in mono_string_equal() which
21714         was brought to light with the ldstr changes.
21716 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
21718         * reflection.c: Remove warning by adding missing include for marshal.h
21720 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21722         * domain.c, object.c: change the ldstr_table to hold
21723         MonoString* as keys: makes the runtime isinterned lookup
21724         faster and simplifies memory management.
21726 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
21728         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
21729         possible to add imperative security checks before calling the icall.
21730         * reflection.c: Return security attributes on the original MonoMethod
21731         (and not the wrapped one). This fix permissions on icalls.
21733 2005-01-25  Dick Porter  <dick@ximian.com>
21735         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
21736         the check for mktime() support actually test the mktime() return
21737         value.  "Fixes" bug 71682, though the output is still different to
21738         MS.
21740 2005-01-25  Martin Baulig  <martin@ximian.com>
21742         * class.c (mono_class_is_assignable_from): Make this work for
21743         generic instances.
21745 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
21747         * marshal.c (mono_string_utf8_to_builder)
21748         (mono_string_builder_to_utf16): We might not have ownership of the
21749         string. In thise case, we need to create a new buffer.
21751         * object-internals.h (mono_stringbuilder_capacity): sb->str might
21752         be null, in which case, use the default capacity.
21754 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21756         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
21757         GC events to the profiler.
21759 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
21761         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
21762         if you don't want the GC to run.
21764 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
21766         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
21767         start providing a GC API and keeping different implementations in
21768         their own file.
21769         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
21771 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
21773         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
21774         mmap rather than allocating a huge buffer.
21775         (mono_debug_close_mono_symbol_file): Free the buffer allocated
21776         above.
21778 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
21780         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
21781         and CheckExecutionRights.
21782         * reflection.c|h: Keep the index of the declarative security to be 
21783         used, instead of the pointer, when AOT compiler is used. Also add 
21784         class initialization when requesting demands.
21785         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
21786         CheckExecutionRights. Both properties are now FALSE by default, and
21787         unmodifiable, unless the --security option is used.
21789 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
21791         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
21792         reflection.c: properly refcount images and assemblies, many leaks fixed.
21794 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21796         * threadpool.c: increase the timeout for threads in the thread pool to
21797         10s.  Fixes bug #67159.
21799 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
21801         * class-internals.h: Sun's compiler insists on explicit
21802         signed on bit fields to handle then correctly.
21804 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
21806         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
21807         Make the size of the array fit only the number of invalid path
21808         chars that we have.
21810         * class.c (_mono_class_get): Improve the error reporting when a
21811         class referenced is not found, to assist debugging. 
21813 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
21815         * threads.c: fix off-by-one error.
21816         * domain.c: free data allocated in the domain.
21818 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
21820         * reflection.c (mono_method_body_get_object): Fill out exception info
21821         as well.
21823         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
21824         structure.
21825         
21826 2005-01-19  Martin Baulig  <martin@ximian.com>
21828         * loader.c (mono_get_method_constrained): Make this work again.
21830 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
21832         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
21833         guint16 to match the managed side.
21835         * reflection.c (mono_reflection_body_get_object): Fill out local
21836         variables array.
21838         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
21839         as well.
21841         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
21842         'local_var_sig_token'.
21844 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
21846         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
21847         System.Drawing.
21849         * reflection.c (mono_method_body_get_object): Handle abstract and
21850         runtime methods.
21852 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
21854         * marshal.c, loader.c, class-internals.h, reflection.c:
21855         store the emthod data for a wrapper in an array instead of a list.
21857 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
21859         * marshal.c: change the code to allocate memory more
21860         conservatively for method wrappers.
21862 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
21864         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
21865         fields from MonoClass to the marshal info structure where they belong.
21867 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21869         * class.c, object.c, class-internals.h, marshal.c: rearrange
21870         some fields and tweak some types to lower memory usage.
21872 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
21874         * threads.c (signal_thread_state_change): Handle the case when the
21875         target thread is the current thread.
21877         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
21879         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
21880         emit_ptr_to_object_conv. 
21882         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
21883         marshalling. Fixes #71352.
21885 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
21887         * metadata.h, blob.h: move table enum to blob.h so it can be included
21888         in any header.
21889         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
21890         cut the size of MonoImage/MonoDynamicImage.
21892 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
21894         * profiler.c (mono_profiler_install_simple): Fix default arguments.
21896 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
21898         * reflection.c, reflection.h, icall.c: add a function to check
21899         if an attribute type is defined for a metadata object.
21901 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
21903         * object-internals.h: Added some needed fields from StringBuilder class.
21904         * marshal.c: Set the maxCapacity when creating a StringBuilder.
21906 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
21908         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
21909         threads before shutting down the runtime.
21911         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
21913 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21915         * object-internal.h, threads.c: implement stacksize and 
21916         parameterized thread start functionality (requires
21917         matching corlib). Marked broken code for later removal.
21919 2005-01-12  Martin Baulig  <martin@ximian.com>
21921         * class-internals.h (MonoGenericClass): Moved the `initialized'
21922         flag to MonoDynamicGenericClass, removed `init_pending'.
21923         (MonoGenericInst): Added `is_reference' flag.
21925 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
21927         * reflection.c (mono_image_create_pefile): Only set the pe_offset
21928         inside the MSDOS header. Fixes #71201.
21930         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
21931         gc thread.
21932         (mono_domain_finalize): Ditto.
21934 2005-01-12  Martin Baulig  <martin@ximian.com>
21936         * class.c (mono_get_shared_generic_class): Use the cache for
21937         non-dynamic generic classes.
21939         * class-internals.h (mono_class_create_generic_2): Removed
21940         function prototype, this function is now static inside class.c.
21942         * class.c (mono_class_create_generic_2): Made this static, only
21943         call it from mono_class_init() and mono_class_setup_parent().
21944         (collect_implemented_interfaces_aux): Call mono_class_init() on
21945         the interfaces we collect.
21946         (mono_class_setup_vtable): Call mono_class_init (class->parent).
21948 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
21950         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
21951         it a real thread handle.
21953         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
21954         MonoJitExceptionInfo, since each catch clause needs its own variable.
21955         
21956 2005-01-11  Dick Porter  <dick@ximian.com>
21958         * image.c (mono_pe_file_open): New variant on mono_image_open()
21959         that does not set up the CLI metadata; used for FileVersionInfo so
21960         it can get the data for windows binaries too.
21961         
21962         * process.c (process_read_string_block): Don't read off the end of
21963         the StringTable block.
21965         These both fix bug 70766.
21967 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
21969         * gc.c: set some fields to NULL at GC cleanup time.
21970         * threads.c: if we quit the main thread, call exit ().
21972 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
21974         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
21976 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
21978         * threads.h, threads.c, object.c: added accessor and settor for
21979         main_thread. Handle it specially when exiting from it: wait
21980         for other foreground threads to exit.
21982 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
21984         * process.c, verify.c: remove some bloat.
21986 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
21988         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
21989         the calling convention to cdecl under win32.
21991 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
21993         * object.c (mono_object_get_size): New function to get the size of
21994         an object instance.
21996         * profiler.c (simple_allocation): Use above.
21998 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
22000         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
22001         ves_icall_System_AppDomain_getRootDomain (as it's not required to
22002         get an appdomain by it's id and we can't assume the root's id is 0).
22003         * domain-internals.h: Change the function prototype to match.
22004         * icall.c: Change the icall table for AppDomain.
22006 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
22008         * locales.c (string_invariant_compare_char): Only compute
22009         GUnicodeTypes in the case where we need them.  Test for ordinality
22010         first and return if so.
22012         From the commit:
22014                 /*
22015                  * FIXME: here we must use the information from c1type and c2type
22016                  * to find out the proper collation, even on the InvariantCulture, the
22017                  * sorting is not done by computing the unicode values, but their
22018                  * actual sort order.
22019                  */
22021 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
22023         * loader.c: for P/Invoke methods, allow the "Internal" shared
22024         library name to refer to the calling process symbol namespace.
22026 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
22028         * Makefile.am: Add the security manager to the build.
22029         * security-manager.c|h: New. Initialization of the security manager.
22031 2005-01-07  Dick Porter  <dick@ximian.com>
22033         * threads.c: 
22034         * monitor.c: Update thread state during Monitor and WaitHandle
22035         waits.  Fixes bug 71031.
22037 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
22039         * reflection.c (property_encode_signature): Correctly handle when the
22040         property has no methods.
22042 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
22044         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
22045         
22046         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
22047         fields from mb, not rmb. Fixes #71017.
22049         * marshal.c (emit_ptr_to_str_conv): Add support for 
22050         ByValTStr -> string conversion. Fixes #71015.
22052         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
22054         * mempool.c (mono_mempool_contains_addr): New helper function.
22056 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
22058         * metadata.c (mono_metadata_compute_size): Fix size calculation of
22059         HasSematics encoded fields.
22060         
22061         * metadata.c (mono_type_to_unmanaged): Improve error message for 
22062         invalid string marshalling.
22064         * metadata.c: Fix warnings.
22065         
22066 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22068         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
22069         profiler support.
22071 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
22073         * domain.c object.c domain-internals.h: Revert part of r38077 since the
22074         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
22075         tests.
22077 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
22079         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
22080         so methods containing these can be AOTed.
22082 2005-01-03  Martin Baulig  <martin@ximian.com>
22084         * loader.c (find_method): Removed the hack for generic instances.
22085         (method_from_memberref): If our parent is a generic instance, pass
22086         its generic type definition to find_method() and then inflate the
22087         method.
22088         (mono_get_method_constrained): Pass the generic type definition to
22089         find_method() and inflate the method later.
22091         * class-internals.h (MonoStats): Added `generic_class_count'.
22093         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
22094         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
22096         * reflection.c (mono_custom_attrs_from_params): Don't ignore
22097         generic type definitions.
22099 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
22101         * loader.c icall.c: Fix warnings.
22103 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
22105         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
22106         blittable types. Fixes #70864.
22108 2004-12-29  Martin Baulig  <martin@ximian.com>
22110         * icall.c
22111         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
22113         * reflection.c (mono_method_get_object): Create a
22114         "System.Reflection.MonoGenericMethod" for inflated methods; don't
22115         call mono_get_inflated_method().
22117         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
22119 2004-12-27  Martin Baulig  <martin@ximian.com>
22121         * class-internals.h (MonoMethod): Added `is_inflated' flag.
22122         (MonoMethodInflated): Added `inflated' field.
22124         * class.c (mono_class_inflate_generic_method): Don't really
22125         inflate the method here; just set the `is_inflated' flag in the
22126         MonoMethod.
22127         (mono_class_get_inflated_method): Actually inflate the method here
22128         if it's not already inflated; we use the MonoMethodInflated's new
22129         `inflated' field as a cache.
22131 2004-12-26  Martin Baulig  <martin@ximian.com>
22133         * class.c
22134         (inflate_generic_class): Moved some code out of inflate_generic_type().
22135         (mono_class_inflate_generic_method): If we're already inflated,
22136         inflate the context and use the declaring method; ie. make sure
22137         the declaring method of an inflated method is always the generic
22138         method definition.
22139         (mono_class_create_from_typedef): Create
22140         `class->generic_container->context->gclass'.
22142 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
22144         * metadata-internals.h, marshal.c, reflection.c: More
22145         MonoGHashTable->GHashTable.
22147         * domain-internals.h, class.c: Change MonoGHashTable's into
22148         GHashTables for some cases where no gc stuff is used
22150         All users: update apis
22152 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
22154         * metadata.c (builtin_types): Make this `const'. Makes this get
22155         put into the shareable section.
22156         (mono_metadata_init): Casts to make gcc happy.
22158 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
22160         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
22162 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
22164         * icall.c: Added an internal call to retrieve the position and length
22165         of assembly-level declarative security attributes (RequestMinimum, 
22166         RequestOptional and RequestRefuse). This is used by the Assembly class
22167         to re-create the corresponding permission sets.
22169 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
22171         * marshal.c: fix the stelemref wrapper to be type correct
22172         (and faster).
22174 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
22176         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
22177         to do key & 0x7fffffff. Hashtable already does this. It just
22178         results in longer code.
22180 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
22182         * appdomain.c: Bump corlib version.
22183         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
22184         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
22185         * reflection.c|h: Add functions to get declarative security infos
22186         (blob position and length) for assemblies, classes and methods.
22188 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
22190         * reflection.c: sort the constant table (bug #70693).
22192 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
22194         * object-internals.h, threads.c, domain.c: add accessors for
22195         the MonoThread and MonoDomain tls keys.
22197 2004-12-18  Martin Baulig  <martin@ximian.com>
22199         * class.c (inflate_generic_type): If we're inflating a generic
22200         instance, set `ngclass->context->container = context->container';
22201         ie. the container we inflated into.
22203         * metadata.c (mono_metadata_parse_generic_param): Reflect above
22204         inflate_generic_type() changes.
22206 2004-12-17  Martin Baulig  <martin@ximian.com>
22208         * class-internals.h
22209         (MonoGenericClass): Replaced `MonoType *generic_type' with
22210         `MonoClass *generic_class'.  Removed `dynamic_info'; if
22211         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
22212         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
22214 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
22216         * exception.c (mono_exception_from_token): New helper function.
22218 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
22220         * assembly.c (mono_assembly_load_with_partial_name): Call 
22221         mono_assembly_loaded before invoking the preload hooks. Fixes
22222         #70564.
22224         * object-internals.h (MonoThread): Change culture_info and 
22225         ui_culture_info into an array.
22227         * threads.c: Cache culture info objects from more than one appdomain.
22229         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
22230         current UI culture.
22232 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
22234         * threads.h threads.c appdomain.c: Clear the culture_info field of
22235         all threads during unloading if they point to an object in the dying
22236         appdomain.
22238 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
22240         * culture-info.h (TextInfoEntry): New struct
22241         * object-internals.h: sync with managed
22242         * locales.c: fill the `text_info_data' field
22243         * culture-info-tables.h: update
22245 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
22247         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
22248         collector.
22250 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
22252         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
22253         (ves_icall_ModuleBuilder_getMethodToken): Ditto
22255 2004-12-12  Martin Baulig  <martin@ximian.com>
22257         * mono-debug-debugger.c (write_type): If we're an enum and the
22258         builtin types have already been initialized, call mono_class_init().
22260 2004-12-11  Martin Baulig  <martin@ximian.com>
22262         * metadata.c (mono_metadata_load_generic_params): Added
22263         `MonoGenericContainer *parent_container' argument; automatically
22264         compute `container->is_method'; pass the correct owner to
22265         get_constraints().      
22267         * reflection.c (compare_genericparam): Sort the GenericParam table
22268         according to increasing owners. 
22270 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
22272         * profiler.c: allow disabling the default profiler.
22274 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
22276         * decimal.c, icall.c: allow disabling System.Decimal support.
22278 2004-12-09  Marek Safar <marek.safar@seznam.cz>
22280         * reflection.c: Add support for null attribute arguments.
22282 2004-12-09  Martin Baulig  <martin@ximian.com>
22284         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
22285         names to get rid of compiler warnings.
22287 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
22289         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
22290         mono_marshal_load_type_info (). Fixes #69625.
22291         (mono_marshal_get_ptr_to_struct): Likewise.
22293 2004-12-08  Martin Baulig  <martin@ximian.com>
22295         * mono-debug.h: Bumped version number to 47.
22297         * mono-debug-debugger.c
22298         (mono_debugger_event_handler, mono_debugger_event): Take two
22299         guint64 arguments insteed of a gpointer and a guint32.  
22301 2004-12-08  Martin Baulig  <martin@ximian.com>
22303         * debug-mono-symfile.h
22304         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
22305         `address' to `native_offset'.
22307 2004-12-08  Martin Baulig  <martin@ximian.com>
22309         * class.c (mono_class_create_from_typespec): Only inflate if we
22310         either have `context->gclass' or `context->gmethod'.
22312 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
22314         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
22316         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
22318         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
22320         * reflection.c (mono_assembly_get_object): Remove the workaround put
22321         in for the release.
22322         
22323         * appdomain.c: Use the corlib_internal field from MonoAssembly.
22325         * appdomain.c: Bump corlib version.
22327         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
22328         be visible in other appdomains.
22330 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
22332         * threads.c: Interlocked inc and dec for longs were messed up,
22333         use a KISS based impl for this. Fixes 70234
22335 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
22337         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
22339 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
22341         * icall.c: fix to follow policy not to allow struct
22342         arguments in icalls.
22344 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22346         * process.c: make the patch that handles spaces in file paths work
22347         on mono/windows too.
22349 2004-12-06  Martin Baulig  <martin@ximian.com>
22351         * class.c (mono_class_create_generic): Call
22352         mono_class_setup_supertypes() if we're dynamic.
22353         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
22355 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
22357         * object-internals.h: Add new fields to MonoThread.
22359         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
22361         * icall.c threads-types.h threads.c: Add new icalls.
22363         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
22365         * object-internals.h (MonoReflectionAssembly): Sync object layout with
22366         managed side.
22368         * appdomain.c: Bump corlib version.
22370         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
22371         internal assemblies. Fixes #69181.
22373 2004-12-05  Martin Baulig  <martin@ximian.com>
22375         * class.c (mono_class_inflate_generic_signature): Make this a
22376         no-op if `context' is NULL or we don't have any type parameters;
22377         also copy `sentinelpos'.        
22379 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
22381         * image.c: Add unbox_wrapper_cache.
22383         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
22385         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
22386         function generator.
22387         
22388         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
22389         Fixes #70173.
22391         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
22392         
22393 2004-12-04  Martin Baulig  <martin@ximian.com>
22395         * loader.c (mono_method_get_signature_full): New public function;
22396         like mono_method_get_signature(), but with an additional
22397         `MonoGenericContext *' argument.
22399         * class.c (mono_class_inflate_generic_signature): Formerly known
22400         as inflate_generic_signature(); make this public.
22402 2004-12-04  Martin Baulig  <martin@ximian.com>
22404         * metadata.c
22405         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
22406         instead of a `MonoGenericContainer *'.  
22407         (mono_metadata_parse_array_full): Likewise.
22408         (mono_metadata_parse_signature_full): Likewise.
22409         (mono_metadata_parse_method_signature_full): Likewise.
22410         (mono_metadata_parse_generic_inst): Likewise.
22411         (mono_metadata_parse_generic_param): Likewise.
22412         (mono_metadata_parse_mh_full): Likewise.
22413         (mono_type_create_from_typespec_full): Likewise.
22415 2004-12-03  Martin Baulig  <martin@ximian.com>
22417         * class-internals.h (MonoGenericContainer): Replaced the
22418         `MonoGenericContext * pointer with a `MonoGenericContext'
22419         structure and made it the first element.
22421 2004-12-03  Martin Baulig  <martin@ximian.com>
22423         * class.c
22424         (inflate_generic_type): Set the `context->container' when creating
22425         a new MonoGenericContext.
22426         (mono_class_inflate_generic_method): Likewise.
22427         (mono_class_create_from_typespec): Just use `context->container'
22428         to get the container.
22430         * loader.c (method_from_methodspec): Set `context->parent' from
22431         `context->container' - and if that's a method container, use its
22432         parent.  Also set the `context->container' when creating a new
22433         MonoGenericContext.
22434         (mono_get_method_from_token): Use just `context->container' to get
22435         the container.
22437         * metadata.c (do_mono_metadata_parse_generic_class): Also set
22438         `gclass->context->container'.
22440         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
22441         the `context->container' when creating a new MonoGenericContext.
22443 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
22445         * reflection.c (compare_genericparam): Sort params with identical
22446         owner by their number. Fixes gen-111 on sparc.
22448 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
22450         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
22451         around the domain changes.
22453         * appdomain.c (mono_domain_unload): Handle the case when the thread
22454         calling Unload is itself being aborted during unloading. Fixes #70022.
22456         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
22458         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
22459         checkpoint_func as an icall so it gets a wrapper.
22460         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
22461         in the cross-appdomain wrappers too.
22463         * threads.c (mono_thread_has_appdomain_ref): Make this public.
22465         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
22467         * reflection.c: Fix some memory leaks.
22468         
22469 2004-12-02  Martin Baulig  <martin@ximian.com>
22471         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
22473         * metadata.c (generic_class_cache): New static hashtable.
22474         (mono_metadata_lookup_generic_class): New public method.
22476 2004-12-02  Martin Baulig  <martin@ximian.com>
22478         * class.c (mono_class_create_from_typedef): Call
22479         mono_class_setup_parent() and mono_class_create_mono_type() before
22480         parsing the interfaces.
22482 2004-12-02  Martin Baulig  <martin@ximian.com>
22484         * metadata.c (generic_inst_cache): New static hashtable.
22485         (mono_metadata_lookup_generic_inst): New public function.
22486         (mono_metadata_inflate_generic_inst): New public function.
22487         (mono_metadata_parse_generic_inst): New public function.
22488         (do_mono_metadata_parse_generic_class): Use the new
22489         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
22490         since this'll also use the cache.
22492         * reflection.c (mono_reflection_bind_generic_method_parameters):
22493         Use mono_metadata_lookup_generic_inst() to use the new cache.
22495         * class.c (inflate_mono_type): Use
22496         mono_metadata_inflate_generic_inst() to inflate a generic
22497         instance; this'll also use the new cache.
22499         * loader.c (method_from_methodspec): Use
22500         mono_metadata_parse_generic_inst() and
22501         mono_metadata_inflate_generic_inst() rather than parsing it
22502         manually, so we can use the new cache.
22504 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
22506         * threads.c (wait_for_tids): Do not incorrectly free threads when 
22507         the wait times out.
22509 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
22511         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
22512         iter->args based on whether parameters are passed in registers (i.e.
22513         MONO_ARCH_REGPARMS is defined)
22515 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
22517         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
22518         the exception message. Fixes #70070.
22519         (method_from_methodspec): Fix warnings.
22521 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22523         * process.c: (complete_path) return the path quoted
22525 2004-12-01  Martin Baulig  <martin@ximian.com>
22527         * class-internals.h (MonoGenericInst): New structure.
22528         (MonoGenericClass): Replaced `type_argc', `type_argv' and
22529         `is_open' with `MonoGenericInst *inst'.
22530         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
22531         `is_open' with `MonoGenericInst *inst'.
22533 2004-11-30  Martin Baulig  <martin@ximian.com>
22535         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
22537         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
22538         to `generic_class_cache'.
22540         * metadata.c
22541         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
22542         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
22543         (mono_generic_inst_is_valuetype): Renamed to
22544         mono_generic_class_is_valuetype().
22546         * class-internals.h
22547         (MonoGenericInst): Renamed to MonoGenericClass.
22548         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
22549         (MonoClass): Renamed `generic_inst' to `generic_class'.
22550         (MonoGenericContext): Renamed `ginst' to `gclass'.
22552         * object-internals.h
22553         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
22555         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
22556         mono_reflection_generic_class_initialize().
22558         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
22559         now known as "System.Reflection.MonoGenericClass".
22560         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
22562 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
22564         * class-internals.h: Added a flag field to MonoClass to cache the
22565         declarative security attributes actions associated with the class.
22566         * domain-internals.h: Added booleans to MonoJitInfo to cache the
22567         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
22568         applicable to the JITted method.
22569         * reflection.c|h: Added functions to extract (as flags) which security
22570         actions are available (declaratively) for a method, class or assembly.
22571         * metadata.c|h: Added functions to search the declarative security
22572         table in the metadata.
22573         
22574 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
22576         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
22577         EXPORTEDTYPES are already in the class name cache, so there is no
22578         need to add extra code here to look at them. Just removes a bit of
22579         cruft.
22581         (ves_icall_System_Environment_get_TickCount): No need for #if
22582         WINDOWS. We already have the code in io-layer.
22584 2004-11-28  Martin Baulig  <martin@ximian.com>
22586         * loader.c
22587         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
22588         Fixes gen-112.cs.
22590 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
22592         * assembly.c (do_mono_assembly_open): Instead of having a
22593         conditional WITH_BUNDLE, incorporate support for bundles here, by
22594         having a global `bundles' variable holding a pointer to the actual
22595         bundles. 
22597         (mono_register_bundled_assemblies): New API call used by the
22598         bundle code. 
22600         See mkbundle.1 for details.
22601         
22602 2004-11-27  Martin Baulig  <martin@ximian.com>
22604         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
22605         the vtable for generic methods.
22607 2004-11-26  Martin Baulig  <martin@ximian.com>
22609         * metadata.c
22610         (mono_metadata_generic_method_hash): New public function.
22611         (mono_metadata_generic_method_equal): Likewise.
22613         * class-internals.h
22614         (MonoGenericContainer): Added `GHashTable *method_hash'.
22616         * reflection.c (ReflectionMethodBuilder): Added
22617         `MonoGenericContainer *generic_container'.
22618         (reflection_methodbuilder_to_mono_method): Don't create a new
22619         MonoGenericContainer each time we're called.
22620         (mono_reflection_bind_generic_method_parameters): Use
22621         `container->method_hash' to cache the results so we don't create a
22622         different method if we're called several times with the same
22623         arguments.
22625         * loader.c (method_from_methodspec): Use the new
22626         `container->method_hash' here, too.
22628 2004-11-26  Martin Baulig  <martin@ximian.com>
22630         * class.c (inflate_generic_signature): Correctly compute
22631         `res->has_type_parameters'.
22632         (mono_class_vtable): Use the `has_type_parameters' flag to
22633         determine whether we're a generic method.
22635         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
22637 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
22639         * object.c (mono_runtime_run_main): Fix a small memory leak.
22641 2004-11-25  Martin Baulig  <martin@ximian.com>
22643         * class.c (set_generic_param_owner): Fixed the loop.
22645 2004-11-25  Martin Baulig  <martin@ximian.com>
22647         * object.c (mono_class_vtable): Don't create any JIT wrappers for
22648         generic methods.
22650 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
22652         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
22653         names. Fixes #69787.
22655 2004-11-24  Martin Baulig  <martin@ximian.com>
22657         * class.c (mono_class_create_generic_2): If we don't have a
22658         `ginst->parent', inflate `gklass->parent' to get our parent.
22660 2004-11-24  Martin Baulig  <martin@ximian.com>
22662         * reflection.c (compare_genericparam): Correctly sort the
22663         GenericParam table; fixes #69779.
22665 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
22667         * reflection.c: When writing a PE file, don't create a huge
22668         buffer in memory. Just write the arrays we have to the file.
22669         This reduces memory usage.
22671         * metadata-internals.h: MonoDynamicStream pefile is no longer used
22672         globally.
22674 2004-11-17  Martin Baulig  <martin@ximian.com>
22676         * class.c (mono_class_init): Don't setup `class->parent' for
22677         dynamic instances; moved this to mono_class_generic_2().
22678         (mono_class_create_generic): Also set `klass->inited' for dynamic
22679         generic instances.
22680         (mono_class_create_generic_2): Don't do anything for dynamic
22681         generic instances.  Set `klass->parent' here and also call
22682         mono_class_setup_parent() here. 
22684         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
22685         `MonoType *parent' argument; set `ginst->parent' before calling
22686         mono_class_create_generic_2(), so we set the correct parent.
22688 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
22690         * reflection.c: allow getting attributes from ModuleBuilder
22691         (used by ikvm).
22693 2004-11-17  Martin Baulig  <martin@ximian.com>
22695         * class.c (mono_class_create_from_typedef): If a type parameter is
22696         inherited from an outer class, set its owner to that class.
22698 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
22700         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
22701           for (int*) written size. This fixes bug #69592.
22703 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
22705         * icall.c: Added IsAuthenticodePresnet internal call.
22706         * image.c|h: New function that check a MonoImage for an Authenticode
22707         signature in the certificate PE data directory.
22708         * security.c|h: New internal call to ask the runtime if an 
22709         Authenticode signature seems referenced in the PE header.
22711 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
22713         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
22715         * reflection.c (mono_image_create_pefile): Free the assembly streams
22716         after writing out the assembly file.
22718         * object.c (mono_runtime_run_main): Fix small memory leak.
22720         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
22721         property access modifiers. Fixes #69389.
22723 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
22725         * domain.c, object.c, object-internals.h, domain-internals.h,
22726         object.h, marshal.c: keep dynamic code info per domain.
22728 2004-11-15  Martin Baulig  <martin@ximian.com>
22730         * class.c (mono_type_get_name_recurse): Put type arguments in
22731         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
22732         see bug #68387.
22734 2004-11-15  Martin Baulig  <martin@ximian.com>
22736         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
22737         (mono_class_setup_vtable): When computing `the_cname' for a
22738         generic instance, don't include the namespace since we'd otherwise
22739         add it twice.
22741 2004-11-15  Martin Baulig  <martin@ximian.com>
22743         * class.c (mono_class_create_generic): Changed return type to void.
22744         (mono_class_create_generic_2): New public function; setup
22745         `class->method', `class->field' and `class->interfaces' here
22746         instead of in mono_class_init().
22748         * class.h (mono_class_create_generic): Moved to class-internals.h.
22750 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
22752         * reflection.c (mono_image_create_pefile): take a file HANDLE.
22753         rather than writing to memory, write to this file. Right now,
22754         we are just writting into a buffer, and copying that. However
22755         we can avoid the buffer later.
22757         (mono_dynamic_stream_reset): new function
22759         * icall.c, object-internals.h: update for the above.
22761 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
22763         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
22764         have been using gc'd memory. First it is slower, unlikely
22765         the comment in the source code said, secondly, it increases
22766         our footprint to do it in the gc.
22768         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
22769         the method so that it does not have to copy to managed code.
22771 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
22773         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
22775 2004-11-12  Martin Baulig  <martin@localhost>
22777         * reflection.c (mono_image_create_token): Allow generic method
22778         definitions here, since they may appear in an `.override'; see
22779         gen-98/gen-99 for an example.
22781 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
22783         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
22784         #69365.
22786         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
22787         descriptive.
22789 2004-11-11  Martin Baulig  <martin@ximian.com>
22791         * class.c (mono_class_setup_vtable): In an explicit interface
22792         implementation, the method name now includes the arity.
22794 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
22796         * object.c (mono_array_full_copy): Fix warning.
22798 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
22800         * appdomain.c: Removed look_for_method_by_name(). Use the new method
22801         mono_class_get_method_from_name() instead.
22802         
22803         * class-internals.h: Added two new types of wrappers. 
22804         Added MonoRemotingTarget enum. Added new trampoline function type, which
22805         takes an additional MonoRemotingTarget value as parameter, so it is
22806         possible to request a trampoline for a specific target.
22807         
22808         * class.c: Added new mono_class_get_method_from_name() method.
22809         
22810         * class.h: In MonoRemoteClass, we can have now to vtables, one for
22811         general remoting sinks and one specific for cross domain calls.
22812         
22813         * debug-helpers.c: Added new wrapper names.
22814         
22815         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
22816         of a remote class.
22817         
22818         * image.c: Porperly delete value objects form the remoting invoke hashtable.
22819         
22820         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
22821         with several other methods (mono_marshal_get_xappdomain_dispatch,
22822         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
22823         and others) can generate a fast remoting wrapper for cross domain calls.
22824         More information can be found in docs/remoting.
22825         Other changes: Removed mono_find_method_by_name, and used
22826         mono_class_get_method_from_name instead.
22827         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
22828         is stored in the remoting invoke hashtable.
22829         
22830         * marshal.h: published the new method for getting the xdomain wrapper,
22831         and also added a method for getting the adequate wrapper for a given
22832         method and target.
22833         
22834         * object-internals.h, object.c: Added a couple of methods for capying and
22835         cloning arrays.
22836         Modified mono_install_remoting_trampoline, which takes the new remoting
22837         trampoline that has a remoting target as parameter.
22838         mono_class_proxy_vtable now also takes a remoting target as parameter, and
22839         will return the most suitable vtable for the target.
22840         Added mono_remote_class_vtable, which returns the vtable of a remote class
22841         (which can be the normal remoting vtable or the xdomain vtable).
22842         
22843         * threads.c: the xdomain invoke and dispatch wrappers must also be
22844         protected against interruptions.
22846 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22848         * icall.c: use memmove in BlockCopyInternal when the source and
22849         destination arrays are the same.
22851 2004-11-09  Martin Baulig  <martin@ximian.com>
22853         * class-internals.h (MonoGenericContainer): Removed `method' and
22854         `signature', replaced them with `is_method' and `is_signature'
22855         flags.  Added `context'.
22857         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
22858         instead of a `MonoGenericContainer *'.
22860         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
22861         for dynamic type parameters.
22862         (mono_metadata_load_generic_params): Setup `container->context'.
22864         * reflection.c (mono_reflection_setup_generic_class): Setup
22865         `tb->generic_container->context'.
22866         (do_mono_reflection_bind_generic_parameters): Use
22867         mono_class_inflate_generic_type() to correctly inflate types,
22868         rather than using our own hack just for MONO_TYPE_VAR.
22870 2004-11-09  Martin Baulig  <martin@ximian.com>
22872         * class.c (mono_class_inflate_generic_method): Small fix; don't
22873         crash here.
22875         * icall.c
22876         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
22877         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
22878         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
22879         (ves_icall_Type_BindGenericParameters): Likewise.
22880         (ves_icall_Type_get_IsGenericInstance): Likewise.
22881         (ves_icall_Type_GetGenericParameterPosition): Likewise.
22882         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
22883         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
22884         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
22886 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
22888         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
22889         assembly versions and public key tokens. Fixes #69113.
22891 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
22893         * metadata.c: fix bug introduced with the type cache changes
22894         on 2004-11-06.
22896 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
22898         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
22899         the MonoClass pointer instead of the token in exception clauses.
22900         * reflection.c: updates for the above and make the code not depend
22901         on the structure of MonoExceptionClause.
22903 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
22905         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
22906         Add support for dynamic assemblies. Fixes #69114.
22908         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
22910 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
22912         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
22913         since most only those methods use it. the code member of
22914         MonoMethodPInvoke was dead, so that can be removed too. Also,
22915         remove inline_count (again, not used), and move slot so that it
22916         can share bits with some other flags. This saves 8 bytes in the
22917         structure and gives us about 50 kb back for mcs helloworld.cs
22919         * *.[ch]: Do naming changes for the above.
22921         * loader.c (mono_method_get_header): Lazily init the header
22922         on first access.
22923         (mono_get_method_from_token): don't init the header here
22924         (mono_free_method): the header may never be allocated
22926         Overall, this saves 150 kb of unmanaged allocations
22927         for mcs helloworld.cs. That accounts for 10% of the unmanaged
22928         memory at runtime.
22929         
22930         * loader.c, loader.h (mono_method_get_header): new accessor.
22932         * *.[ch]: use the above method. Prepares us to lazily load
22933         the header.
22935         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
22936         three warnings, which are actual bugs (see 69206).
22938         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
22939         unused. Saves a cool 4 bytes / method.
22941 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
22943         * metadata.c (builtin_types): Add types for System.Object here.
22944         (mono_metadata_parse_type_full): Cache MonoType*'s that are
22945         for a class or valuetype from klass->this_arg or klass->byval_arg.
22947         On mcs for a hello world, this gets us down from 21836 MonoType's
22948         to 14560.
22950         (mono_metadata_free_type): Account for the above change.
22952 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
22954         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
22955         exception instead of asserting if name is null.
22956         (ves_icall_System_AppDomain_GetData): Ditto.
22958 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
22960         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
22961         EnumBuilder.
22963         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
22964         Return NULL when the domain does not have entry_assembly set.
22966         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
22967         Add a 'resource_modules' argument.
22968         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
22970         * reflection.c (mono_reflection_create_runtime_class): Move setting
22971         of wastypebuilder here, so mono_get_type_object () returns a MonoType
22972         for enums too.
22974         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
22975         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
22976         Throw an ArgumentNullException if 'ptr' is null.
22978         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
22979         assemblies here. Fixes #69020.
22981 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
22983         * reflection.c (build_compressed_metadata): Fix the previous patch for
22984         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
22985         the stack.
22987 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
22989         * assembly.c (mono_assembly_names_equal): Allow a match if one of
22990         the cultures is false. Fixes #69090.
22992         * reflection.c (build_compressed_metadata): Fix invalid memory read 
22993         detected by valgrind.
22994         
22995         * reflection.c (mono_reflection_get_type): Avoid triggering a 
22996         TypeResolve multiple times for the same type. Fixes #65577.
22998 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
23000         * marshal.c: Avoid using ldftn to call managed functions. It is
23001         much slower than just a call.
23003         * reflection.c (mono_module_get_object): free the basename we
23004         allocate here from glib.
23005         
23006         * reflection.c (ensure_runtime_vtable): make sure to free
23007         overrides.  Also, we were allocating an array of MonoMethod not an
23008         array of MonoMethod*.
23010         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
23012         * image.c (mono_image_close): free image->guid here.
23014 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
23016         * reflection.c: Fix some spec conformance issues with the PE file
23017         structures so mcs compiled apps run on the Net 2.0 beta.
23019 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
23021         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
23022         Implement this. Fixes #67264.
23024         * debug-helpers.h debug-helpers.c marshal.c: Move 
23025         mono_find_method_by_name to debug-helpers.c.
23027 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
23029         * object.c (mono_release_type_locks): type_initialization_hash is
23030         a GHashTable.
23032         * reflection.c object.c object-internals.h: Fix warnings.
23034         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
23035         without accessors. Fixes #61561.
23037         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
23038         application base from the root domain if not set. Fixes #65641.
23039         (mono_runtime_init): Fix warning.
23041 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23043         * appdomain.c: call mono_thread_pool_init.
23044         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
23045         of worker threads based on the number of CPUs and the environment
23046         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
23047         for non-windows (windows) systems.
23049 2004-10-27  Chris Toshok  <toshok@ximian.com>
23051         * mono-debug-debugger.c (write_class): don't call mono_class_init
23052         here, as even with the check for (!klass->init_pending), we get
23053         into a situation where we're hitting cycles in class
23054         initialization.  Fixes #68816.
23056 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
23058         * image.c: Avoid overwriting values in the loaded_images_hash when an
23059         assembly is loaded multiple times. Fixes #61152.
23061         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
23062         so multiple satellite assemblies for the same name can be loaded.
23063         Fixes #68259.
23065         * mono_domain_assembly_preload: Actually return the loaded assembly, 
23066         not NULL.
23068         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
23069         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
23071         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
23072         pending finalizers are not invoked after the appdomain has been 
23073         unloaded. Fixes #67862.
23075 2004-10-22  Martin Baulig  <martin@ximian.com>
23077         * mono-debug-debugger.c
23078         (mono_debugger_runtime_invoke): Don't box valuetypes.
23080 2004-10-22  Chris Toshok  <toshok@ximian.com>
23082         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
23083         don't hide private methods.
23085 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
23087         * icall.c: Allows the runtime to "share" (when known) the public key
23088         token of an assembly. This avoid the need to recalculate the token 
23089         (from the public key) in managed code.
23091 2004-10-21  Chris Toshok  <toshok@ximian.com>
23093         * debug-helpers.c (append_class_name): argh, revert last patch.
23094         
23095 2004-10-21  Chris Toshok  <toshok@ximian.com>
23097         * debug-helpers.c (append_class_name): use '+' as the delimiter,
23098         not '/', so that it matches what the debugger uses to look up
23099         methods.
23101 2004-10-21  Martin Baulig  <martin@ximian.com>
23103         * mono-debug-debugger.c (mono_debugger_throw_exception): New
23104         public method; this is called each time an exception is thrown and
23105         allows the debugger to use exception catch points.
23107 2004-10-21  Martin Baulig  <martin@ximian.com>
23109         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
23110         the stack pointer and the exception object in some struct and pass
23111         that to the debugger.
23113 2004-10-21  Chris Toshok  <toshok@ximian.com>
23115         * mono-debug-debugger.c (do_write_class): add instance/static
23116         event support.  We don't expose "raise" or "other" yet.
23117         (event_is_static): new method.
23119 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
23121         * mono-debug-debugger.c
23122         (mono_debugger_handle_exception): Remove
23123         bogus return value for fussy compilers.
23125 2004-10-20  Martin Baulig  <martin@ximian.com>
23127         * mono-debug-debugger.c
23128         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
23129         (mono_debugger_handled_exception): Likewise.
23131 2004-10-20  Martin Baulig  <martin@ximian.com>
23133         * mono-debug-debugger.h (MonoDebuggerEvent): Added
23134         MONO_DEBUGGER_EVENT_EXCEPTION.
23136         * mono-debug-debugger.c (mono_debugger_handle_exception): New
23137         public function to send the debugger a notification for an
23138         exception and inform it about a catch/finally clause.
23140 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
23142         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
23143         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
23144         fix 2.95 build. 
23146         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
23148 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
23150         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
23151         marshalled as [In,Out]. Fixes #58325.
23153 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
23155         * reflection.c (mono_method_body_get_object): Implement some fields.
23157 2004-10-12  Martin Baulig  <martin@ximian.com>
23159         * reflection.c (mono_reflection_bind_generic_parameters): Small
23160         fix, correctly retrieve our parent from a generic instance.
23162 2004-10-12  Martin Baulig  <martin@ximian.com>
23164         * metadata.c (mono_metadata_generic_param_equal): We always have
23165         an owner.
23167         * class.c
23168         (mono_class_from_generic_parameter): We need to have an owner.
23169         (my_mono_class_from_generic_parameter): Likewise.
23171         * reflection.c (mono_reflection_setup_generic_class): Renamed to
23172         mono_reflection_create_generic_class() and added a new
23173         mono_reflection_setup_generic_class().  
23174         (mono_reflection_initialize_generic_param): If we're a nested
23175         generic type and inherited from the containing class, set our
23176         owner to the outer class.
23178 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
23180         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
23182         * reflection.c (mono_method_body_get_object): New function to create
23183         a MethodBody object.
23185         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
23187 2004-10-11  Martin Baulig  <martin@ximian.com>
23189         * metadata.c (_mono_metadata_type_equal): Renamed to
23190         do_mono_metadata_type_equal() and made static.
23192 2004-10-11  Martin Baulig  <martin@ximian.com>
23194         * appdomain.c: Bump corlib version number to 28.
23196 2004-10-10  Martin Baulig  <martin@ximian.com>
23198         * class-internals.h
23199         (MonoGenericInst): Added `MonoGenericContainer *container'.
23200         (MonoGenericMethod): Likewise.
23201         (MonoGenericContext): Likewise.
23202         (MonoGenericParam): Added `MonoGenericContainer *owner'.
23204         * metadata.c
23205         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
23206         (do_mono_metadata_parse_generic_inst): Likewise.
23207         (mono_metadata_parse_type_full): New public method.  This is the actual
23208         mono_metadata_parse_type() implementation - with an additional
23209         `MonoGenericContainer *' argument.
23210         (mono_metadata_parse_array_full): Likewise.
23211         (mono_metadata_parse_signature_full): Likewise.
23212         (mono_metadata_parse_method_signature_full): Likewise.
23213         (mono_metadata_parse_mh_full): Likewise.
23214         (mono_type_create_from_typespec): Likewise.
23215         (mono_metadata_interfaces_from_typedef_full): New public method;
23216         this is similar to the other _full() methods, but we take a
23217         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
23218         (mono_metadata_parse_generic_param): Take an additional
23219         `MonoGenericContainer *' argument and lookup the MonoGenericParam
23220         from that container.
23221         (mono_metadata_generic_param_equal): New static method to compare
23222         two type parameters.
23223         (_mono_metadata_type_equal): New static method; takes an
23224         additional `gboolean signature_only' argument - if true, we don't
23225         compare the owners of generic parameters.
23226         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
23227         with a TRUE argument - do a signature-only comparision.
23229         * loader.c: Use the new _full() methods and pass the
23230         MonoGenericContainer to them.
23232         * object-internals.h (MonoReflectionTypeBuilder): Added
23233         `MonoGenericContainer *generic_container' field.
23234         (MonoReflectionMethodBuilder): Likewise.
23236 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
23238         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
23239         case initial images of dynamic assemblies.
23241         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
23243         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
23245         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
23246         length of event->other array.
23247         (typebuilder_setup_events): Ditto.
23249         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
23250         'assembly_by_name' and add an 'assemblies' list.
23252         * assembly.h assembly.c: Add a new search hook for determining whenever
23253         an assembly is already loaded. Use this instead of searching in the
23254         loaded_assemblies list.
23256         * domain.c appdomain.c: Implement the new search hook so loaded 
23257         assemblies are now scoped by appdomain. Fixes #67727.
23259 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
23261         * threads.c (mono_thread_attach): Initialize synch_lock field so
23262         mono_thread_detach works again.
23264         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
23265         'lib' too. Fixes #63130.
23267 2004-10-06  Jackson Harper  <jackson@ximian.com>
23269         * culture-info-tables.h: regenerated.
23271 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
23273         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
23274         implemented by other interfaces in the result. Fixes #65764.
23275         
23276         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
23277         Handle unloadable modules without crashing.
23279         * image.c (load_modules): Revert the previous patch since modules must
23280         have a fixed index inside the array.
23281         
23282         * image.c (load_modules): Don't include native modules in the modules
23283         array.
23285 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
23287         * reflection.h: Add param_defaults field.
23289         * reflection.c: Add support for parameter defaults in dynamic methods.
23290         Fixes #64595.
23292         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
23293         an empty string when a type has no namespace. Fixes #64230.
23295 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
23297         * tabledefs.h: Added "internal" security actions to support non-CAS
23298         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
23299         Note: they do not seems to be used anymore in 2.0 (new metadata format)
23301 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
23303         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
23304         constructor of abstract class. Fixes #61689.
23306 2004-10-04  Martin Baulig  <martin@ximian.com>
23308         * class-internals.h (MonoGenericContainer): New type.
23309         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
23310         `MonoGenericContainer *generic_container'.
23311         (MonoClass): Replaced `gen_params' and `num_gen_params' with
23312         `MonoGenericContainer *generic_container'.
23314         * metadata.c (mono_metadata_load_generic_params): Return a
23315         `MonoGenericContainer *' instead of a `MonoGenericParam *';
23316         removed the `num' argument.
23318 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
23320         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
23321         for dynamic images.
23323         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
23324         machine fields.
23326         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
23328         * reflection.c: Save pe_kind and machine values into the generated
23329         image file.
23331         * appdomain.c: Bump corlib version number.
23333         * object-internals.h: Reorganize layout of LocalBuilder.
23335         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
23336         New helper function.
23338         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
23339         created MonoType for dynamic types. Fixes #66180.
23341 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
23343         * threadpool.c: the ares hashtable needs a critical section around it.
23344         this prevents some nasty segfaults
23346 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
23348         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
23349         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
23350         bug 67324).
23351         
23352 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
23354         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
23355         
23356 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
23358         * image.c: Always canonicalize image file names, to avoid loading
23359         the same assembly twice when referenced using a relative path.
23361 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
23363         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
23365         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
23367         * marshal.c: Fix warnings.
23369 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
23371         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
23372         attempting to marshal the delegate_trampoline as the method_addr.
23373         This patch has a static hashtable of marshalled delegates so that 
23374         we can map delegate_trampoline addresses back to delegates.  This
23375         allows a delegate passed to managed code to be passed back into native
23376         code.  Fixes #67039
23378 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
23380         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
23382         * reflection.c (method_encode_code): Align method headers properly.
23383         Fixes #66025.
23385 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
23387         * marshal.c: In the runtime invoke wrapper, reset the abort
23388         exception if it is cached. This avoids the automatic rethrowal of 
23389         the exception after the catch of the wrapper. Also check for pending
23390         interruptions before calling the managed method. This is done using
23391         the new method emit_thread_force_interrupt_checkpoint, since the
23392         normal checkpoint method is ignored when running the invoke wrapper.
23393         * object.c: If the abort exception is rethrown, set the abort_exc
23394         field of the thread, so it will be rethrown aftere every catch.
23395         * threadpool.c: Only run an interruption checkpoint if what has been
23396         requested is a stop of the thread (aborts will be ignored).
23397         * threads.c: By default, a thread will now never be interrumped while
23398         running the runtime invoke wrapper (this ensures that runtime_invoke
23399         will always return to the caller if an exception pointer is provided).
23400         There is a new special method mono_thread_force_interruption_checkpoint()
23401         to force an interruption checkpoint even if running a protected
23402         wrapper, which is used by the same runtime invoke wrapper to do a check
23403         at a safe point.
23405 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
23407         * object.c, object-internals.h: Implemented mono_release_type_locks,
23408         which releases the cctor locks held by a thread.
23409         * threads.c, threads.h: In thread_cleanup, release cctor locks held
23410         by a thread. Added mono_thread_exit() method to be used to safely stop
23411         a thread.
23413 2004-09-28  Raja R Harinath  <rharinath@novell.com>
23415         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
23416         Move null check before dereference.  Avoid indexing beyond the end
23417         of the 'modules' array.
23419 2004-09-28  Raja R Harinath  <rharinath@novell.com>
23421         * metadata-internals.h (MonoImage): Add module_count field.
23422         * image.c (load_modules): Set image->module_count.
23423         (mono_image_load_file_for_image): Use image->module_count.
23424         * reflection.c (mono_image_load_module): Append to image->modules array 
23425         of dynamic assembly.
23426         (mono_module_get_object): Fix loop to actually increment index.
23427         Use image->module_count.
23428         * assembly.c (mono_assembly_load_references): Use image->module_count.
23429         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
23430         Likewise.
23432 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
23434         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
23435         Avoid assert on generic types.
23437 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
23439         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
23441         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
23443         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
23444         function to convert a MarshalSpec structure to its managed counterpart.
23446         * reflection.c: Fix warnings.
23447         
23448         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
23449         field.
23451         * icall.c (mono_create_icall_signature): Fix build.
23453 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
23455         * icall.c: Add MakePointType icall.
23457         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
23458         warnings.
23460 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23462         * threadpool.c: reuse allocated slots in the queue.
23464 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
23466         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
23468         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
23470         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
23471         previous change.
23473         * tabledefs.h: Add constants for pinvoke attributes BestFit and
23474         ThrowOnUnmappableChar.
23476         * icall.c (ves_icall_Type_GetPacking): New icall.
23478 2004-09-24  Martin Baulig  <martin@ximian.com>
23480         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
23482 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23484         * appdomain.c:
23485         (mono_domain_set): allow setting a domain that is being unloaded.
23486         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
23487         being unloaded.
23489 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
23491         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
23492         the GetCustomAttributes icall.
23494 2004-09-23  Martin Baulig  <martin@ximian.com>
23496         * object-internals.h (MonoReflectionGenericParam): Replaced
23497         'has_ctor_constraint', `has_reference_type' and `has_value_type'
23498         with `guint32 attrs'.
23500 2004-09-23  Martin Baulig  <martin@ximian.com>
23502         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
23504 2004-09-23  Martin Baulig  <martin@ximian.com>
23506         * object-internals.h (GenericParameterAttributes): New enum.
23508 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
23510         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
23511         
23512         * class.c (init_events): Fill out event->other field.
23514         * class.c: Fix warnings.
23516         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
23518 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
23520         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
23521         walk which doesn't supply the IL offset.
23523 2004-09-22  Martin Baulig  <martin@ximian.com>
23525         * reflection.c (mono_reflection_setup_internal_class): If we're
23526         System.ValueType, System.Object or System.Enum, set
23527         `klass->instance_size' and create the vtable.
23528         (mono_reflection_create_internal_class): If we're an enum type,
23529         get the base class from our current corlib.
23531 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
23533         * reflection.h (MonoResolveTokenError): New type.
23535         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
23536         icall.
23538         * icall.c: Add an 'error' argument to the ResolveToken icalls.
23540 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
23542         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
23543         Support also calling constructors, but only for already allocated objects.
23545 2004-09-17  Geoff Norton <gnorton@customerdna.com>
23547         * reflection.c (type_get_qualified_name): If the klass is null
23548         return the typename to avoid a NullRefEx.
23549         (encode_cattr_value): Get the qualified name of the boxed type,
23550         not the underlying enumtype.  Fixes #62984.
23552 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
23554         * marshal.c: Fix problems with previous checkin.
23556 2004-09-21    <vargaz@freemail.hu>
23558         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
23559         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
23561         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
23563 2004-09-21  Geoff Norton <gnorton@customerdna.com>
23565         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
23566         should only return a type for pointers, arrays, and passbyref types.
23567         Fixes bug #63841.
23569 2004-09-21  Martin Baulig  <martin@ximian.com>
23571         * domain.c (mono_debugger_check_runtime_version): New public
23572         function.
23574         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
23576 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
23578         * reflection.c: Added missing sort to the declarative security 
23579         attributes table. MS implementation stops seeing the attributes if the
23580         token number regress in the table (as shown by ildasm and permview).
23582 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
23584         * object-internals.h (MonoReflectionModule): Add 'token' field.
23585         
23586         * reflection.c (mono_reflection_get_token): Add support for Module
23587         and Assembly.
23588         (mono_module_get_object): Set 'token' field.
23589         (mono_module_file_get_object): Set 'token' field.
23591         * icall.c: Add new Assembly and Module icalls.
23593         * appdomain.c: Bump corlib version.
23595 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
23597         * loader.h loader.c class.h class.c: Add helper functions for obtaining
23598         tokens of metadata objects.
23600         * reflection.h reflection.c (mono_reflection_get_token): New function
23601         to obtain the token of a metadata object.
23603         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
23605 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
23607         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
23608         
23609         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
23611 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
23613         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
23614         * object-internals.h: Added 3 MonoArray* members to MonoReflection
23615         AssemblyBuilder to access the permissions set in the class lib.
23616         * reflection.c: Added security attributes encoding step in 
23617         mono_image_build_metadata.
23618         * tabledefs.h: Added new security actions defined in 2.0:
23619         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
23621 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
23623         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
23624         macro parameter.
23626 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
23628         * locales.c: nullify the ICU_collator member of CompareInfo when it is
23629           finalized. There where random SIGSEVs at program termination, when
23630           an object being finalized was trying to do a string comparison and
23631           the current culture was already finalized.
23633 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23635         * threads.c: call thread_cleanup before finishing the thread if we get
23636         there.
23638 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
23640         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
23641         assemblies from the parent. Fixes #65665.
23643 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
23645         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
23646         modifiers.
23648 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
23650         * reflection.h: add prototype for mono_get_dbnull_object
23651         * reflection.c: add prototypes for get_default_param_value_blobs 
23652         and mono_get_object_from_blob for fussier compilers
23654 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
23656         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
23657         false deadlock checks in class initialization.
23659 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
23661         * image.c (mono_image_addref): Fix comment.
23663         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
23664         possible.
23666 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
23668         * reflection.c (mono_param_get_objects): Modified to return
23669         ParameterInfo.DefaultValue object.
23671         (get_default_param_value_blobs):
23672         (mono_get_object_from_blob):
23673         (mono_get_dbnull_object): New helper routines. 
23675         * object.c (mono_get_constant_value_from_blob): New helper routine
23676         carved out from get_default_field_value ()
23678         * object-internals.h (mono_get_constant_value_from_blob): Added
23679         function declaration.
23681 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
23683         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
23684         referenced assemblies. Fixes #62135.
23686         * exception.h exception.c (mono_get_exception_file_not_found2): New
23687         helper function.
23689 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
23691         * class.h class.c: Add mono_type_get_underlying_type ().
23693 2004-09-09  Geoff Norton <gnorton@customerndna.com>
23695         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
23696         Fix GetTypes() to support dynamically created assemblies.
23698 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
23700         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
23701         
23702         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
23703         previous patch.
23705         * reflection.h reflection.c loader.c: Allow dynamic construction of
23706         pinvoke methods. Fixes #65571.
23707         
23708         * reflection.c (mono_reflection_get_type): Revert previous change since
23709         it causes regressions.
23711 2004-09-08  Martin Baulig  <martin@ximian.com>
23713         * class.c (class_compute_field_layout): Don't call
23714         mono_class_layout_fields() for open generic instances.
23716 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
23717         * threads.c appdomain.c: fix typo in GC macro
23719 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23721         * threads.c: don't call mono_thread_detach() in start_wrapper(),
23722         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
23724 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
23726         * image.c (mono_image_close): Applied patch from 
23727         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
23728         assembly is loaded multiple times from data.
23729         
23730         * image.c (mono_image_open): Fix warning.
23732 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
23734         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
23735         once. Fixes #58334.
23736         
23737         * reflection.c (mono_reflection_create_runtime_class): Initialize
23738         klass->nested_classes. Fixes #61224.
23740 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
23742         * threads.c: sched_yield() on exit, to allow threads to quit.
23744 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
23746         * object.c (mono_unhandled_exception): Remove leftover debug code.
23748 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
23750         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
23752 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
23754         * marshal.c (emit_marshal_array): Really null terminate string arrays.
23755         
23756         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
23758 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
23760         * marshal.c (emit_marshal_array): Null terminate string arrays.
23761         
23762         * marshal.c (raise_auto_layout_exception): Fix warning.
23764         * reflection.c (mono_param_get_objects): Initialize the default value
23765         with DBNull.Value, not null. Fixes #62123.
23767 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
23769         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
23770         throw an exception with a cute explanation.
23772 2004-09-06  Dick Porter  <dick@ximian.com>
23774         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
23775         Close the new process's thread handle, as we don't use it.  The
23776         handle stays around forever otherwise.
23778 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
23780         * object.c (arith_overflow): Fix warning.
23782         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
23783         calling conventions in method refs. Fixes #65352.
23785         * reflection.c: Fix warnings.
23787 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
23789         * icall.c: Add a new icall for Array.Clear
23791 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
23793         * object.c: When allocating an array, we have to throw
23794         an overflow exception if any of the lengths are < 0.
23796 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
23798         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
23799         properly. Also move implementation of string array marshalling to 
23800         managed code. Fixes #42316.
23802 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23804         * assembly.c: provide more information when loading an assembly fails.
23806 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23808         * filewatcher.c: don't expect the development fam package to be
23809         installed.
23811 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
23813         * marshal.c: Make a copy of the signature cookie since it will be
23814         freed by the caller.
23815         
23816         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
23818         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
23820         * metadata.c (mono_metadata_free_marshal_spec): New function to free
23821         marshal specs.
23823         * marshal.c: More refactoring.
23824         
23825         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
23826         smaller functions.
23828 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
23830         * object.c: In mono_message_invoke, fill the output parameter array after
23831           calling the managed method (it was done before the call). This fixes
23832           bug #59299.
23834 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
23836         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
23837         as well.
23839 2004-09-02  Martin Baulig  <martin@ximian.com>
23841         * class.c (mono_class_instance_size): Don't allow generic type
23842         definitions or open generic instances.
23843         (mono_class_array_element_size): If we're a value type, call
23844         mono_class_instance_size() on the original class.
23846         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
23847         handle generic instances.
23849         * mono-debug-debugger.c (write_type): Handle generic instances
23850         like classes.
23852 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
23854         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
23855         the allocation request fails. Fixes #65089.
23857         * object.c (mono_runtime_free_method): Do not call mono_free_method.
23858         
23859         * object.c (mono_runtime_free_method): New function to free a dynamic
23860         method.
23862         * marshal.c (mono_delegate_free_ftnptr): New function to free the
23863         delegate trampoline.
23865         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
23866         with hasthis as dynamic,
23868         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
23870         * domain.c (mono_jit_info_table_remove): New function to remove an
23871         entry from the jit info table.
23873         * class-internals.h (MonoMethod): Add 'dynamic' field.
23875         * loader.c: Fix warnings.
23877 2004-09-01  Martin Baulig  <martin@ximian.com>
23879         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
23880         instead of mono_debugger_lock() because the latter one is a no-op
23881         unless running in the debugger.
23883 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
23885         * class.c (class_compute_field_layout): Classes with auto-layout or
23886         reference fields are not blittable.
23887         
23888 2004-09-01  Dick Porter  <dick@ximian.com>
23890         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
23891         mono_image_get_filename() to get the assembly location.
23893         * icall.c:
23894         * metadata.h: Fix compile warnings
23896 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
23898         * class.c (class_compute_field_layout): System.Object is blittable.
23900         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
23901         as in/out. Fixes #59909.
23903 2004-09-01  Martin Baulig  <martin@ximian.com>
23905         * metadata.h (MONO_TYPE_ISREFERENCE): Call
23906         mono_metadata_generic_inst_is_valuetype() if we're a generic
23907         instance to check whether our underlying type is a reference type.
23909 2004-09-01  Martin Baulig  <martin@ximian.com>
23911         * metadata.c (mono_type_size): If we're a generic instance, call
23912         mono_class_value_size() for value types.
23914 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
23916         * marshal.c: Implement more custom marshalling functionality. Fixes
23917         #64915.
23919 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
23921         * mono-debug.c, debug-mono-symfile.c: add some locking love.
23923 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
23925         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
23927         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
23929         * icall.c: Fix some warnings.
23931         * threads.c (abort_appdomain_thread): Fix unref errors.
23932         (mono_thread_current): Fix THREAD_DEBUG define.
23934 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
23936         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
23938         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
23940 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
23942         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
23943         string arrays.
23945 2004-08-28  Martin Baulig  <martin@ximian.com>
23947         * metadata.c
23948         (mono_metadata_generic_inst_is_valuetype): New public function.
23950         * metadata.h (MONO_TYPE_ISSTRUCT): Call
23951         mono_metadata_generic_inst_is_valuetype() if we're a generic
23952         instance to check whether our underlying type is a valuetype.
23954 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
23956         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
23957         #63768.
23959 2004-08-25  Martin Baulig  <martin@ximian.com>
23961         * loader.c (mono_get_method_from_token): Abstract methods can also
23962         be generic and thus have type parameters.
23964         * metadata-internals.h
23965         (MonoDynamicImage): Added `GPtrArray *gen_params'.
23967         * reflection.c (mono_image_get_generic_param_info): Don't create a
23968         metadata row, just add an entry to the `gen_params' array.
23969         (build_compressed_metadata): Sort the `gen_params' array and then
23970         actually create the metadata.
23972 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23974         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
23976 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
23978         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
23980 2004-08-24  Martin Baulig  <martin@ximian.com>
23982         * class.cs (mono_class_is_subclass_of): Like an interface, a
23983         generic instance also derives from System.Object.
23985 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
23987         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
23988         custom modifiers to be in any order. Fixes #61990.
23990 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
23992         * object.c: Register mono_object_new_fast icall.
23993         
23994         * object.c (mono_class_get_allocation_ftn): Return to calling
23995         mono_object_new_fast, since it seems faster to compute the object 
23996         size in unmanaged code than passing it as a parameter.
23998         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
24000         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
24001         this function with Boehm as the oom handler, so we don't have to check
24002         the result of GC_malloc.
24004         * object.c: Remove checks for oom.
24006         * object.h object.c (mono_class_get_allocation_ftn): New function to
24007         return the icall which can be used to allocate an instance of a given
24008         class. 
24010         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
24012         * class-internals.h: Add 'enabled' field.
24014 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
24016         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
24018 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
24019         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
24020         value 0x0010.
24022 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
24024         * appdomain.c: use the Tls function for appdomain too,
24025         at Zoltan's request. Actually return in mono_context_get
24027         * appdomain.c, profiler.c, threads.c: use __thread
24029 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
24031         * appdomain.c threads.c: Call GC_CreateThread on windows.
24033         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
24034         multiple libraries since this don't work on windows.
24036 2004-08-18  Martin Baulig  <martin@ximian.com>
24038         * class-internals.h
24039         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
24040         MonoMethodHeader.
24042         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
24043         MonoMethodNormal since we also need it for abstract and interface
24044         methods.
24046         * reflection.c
24047         (build_compressed_metadata): Sort the GenericParam table.
24048         (mono_image_create_token): Added `gboolean create_methodspec'
24049         argument; this is false when generating a MethodImpl token.
24050         (reflection_methodbuilder_to_mono_method): Abstract and interface
24051         methods may also have generic parameters.
24053 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
24055         * appdomain.c: thread local alloc
24057 2004-08-17  Martin Baulig  <martin@ximian.com>
24059         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
24061         * icall.c
24062         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
24063         argument.
24065         * class.c (mono_type_get_full_name): New public function.
24066         (mono_type_get_name): Don't include the type arguments.
24068 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
24070         * Makefile.am: Build static versions of libmetadata and libmonoruntime
24071         for inclusion into the mono executable.
24073 2004-08-16  Martin Baulig  <martin@ximian.com>
24075         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
24076         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
24078 2004-08-14  Martin Baulig  <martin@ximian.com>
24080         * class.c (dup_type): Also copy the `byref' field.
24082 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
24084         * reflection.c (create_dynamic_mono_image): Revert the last change 
24085         since it breaks bootstrap.
24087 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
24089         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
24091         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
24092         not free them with g_free.
24094 2004-08-11  Martin Baulig  <martin@ximian.com>
24096         * reflection.c (mono_reflection_setup_internal_class): Also call
24097         mono_class_setup_mono_type() if we already have a `tb->type.type'.
24099 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
24101         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
24102         called during default (first) AppDomain creation. Keep track of
24103         Evidence when loading assemblies.
24105 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
24107         * opcodes.c, opcodes.h: reduce runtime relocations.
24109 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
24111         * culture-info.h, locales.c: fixes and chages to sue the new
24112         optimized format of the locale data.
24113         * culture-info-tables.h: regenerated.
24115 2004-08-06  Geoff Norton <gnorton@customerdna.com>
24116         
24117         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
24119 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
24121         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
24122         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
24123         * domain-internals.h: icall declaration.
24124         * icall.c: icall registration.
24125         * object-internals.h: New fields in MonoAssembly for CAS.
24127 2004-08-05  Duncan Mak  <duncan@ximian.com>
24129         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
24130         CEE_LDELEM_ANY.
24132 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
24134         * reflection.c: fix to deal with object[] arrays in custom ctors
24135         (bug #62550).
24137 2004-08-05  Martin Baulig  <martin@ximian.com>
24139         * class.c (mono_class_array_element_size): Added support for
24140         generic instances and correctly handle "recursive" types.
24142 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
24144         * assembly.c: Fix warnings.
24146 2004-08-04  Martin Baulig  <martin@ximian.com>
24148         * class.c
24149         (mono_type_get_name_recurse): Added `gboolean include_arity'
24150         argument specifying whether or not we should include the generic
24151         arity in the type name.
24152         (_mono_type_get_name): New static function.
24153         (mono_class_setup_vtable): If we're a generic instance, don't
24154         include the generic arity in the names of explicit method
24155         implementations.        
24157 2004-08-03  Martin Baulig  <martin@ximian.com>
24159         * class.c (mono_type_get_name_recurse): Enclose the generic type
24160         arguments in `<', '>'.
24162 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24164         * gc.c: make GC warning messages use the trace API, they are just
24165         noise to most of the users.
24167 2004-08-03  Martin Baulig  <martin@ximian.com>
24169         * debug-mono-symfile.c (read_string): Correctly read the string.
24171 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
24173         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
24174         
24175         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
24176         icalls.
24177         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
24179 2004-07-30  Martin Baulig  <martin@ximian.com>
24181         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
24182         Reflect latest symbol writer changes.   
24184 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
24186         * object.c: always create an object if null is passed
24187         to Invoke() where a valuetype is expected.
24189 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
24191         * marshal.c (mono_marshal_init): make managed
24192         signatures match native ones better for 64bits.
24194 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24196         * appdomain.c: hack to build correctly the private bin path on windows.
24197         Fixes bug #61991.
24199 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
24201         * assembly.c: Load mscorlib from the correct framework directory
24202           (mono/<version>/mscorlib.dll).
24203         * appdomain.h: Added prototypes for new functions.
24204         * internals.h: Added some prototypes.
24205         * domain.c: When initializing the runtime, get from the executable and
24206           the configuration files the runtime version that the app supports.
24207           Added support methods for reading app.exe.config. Added list of versions
24208           supported by the JIT. Added two new methods: mono_init_from_assembly,
24209           which initializes the runtime and determines the required version from
24210           the provided exe file, and mono_init_version, which initializes
24211           the runtime using the provided version.
24212         * icall.c: Get machine.config from version-specific directory.
24213         * reflection.c: When generating an image, embed the version number
24214           of the current runtime.
24216 2004-07-28  Dick Porter  <dick@ximian.com>
24218         * socket-io.c
24219         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
24220         returned sockaddr size before creating the remote address object.
24221         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
24222         61608.
24224 2004-07-28  Dick Porter  <dick@ximian.com>
24226         * locales.c (string_invariant_compare_char): Fix invariant char
24227         compares between upper and lower cases.  Fixes bug 61458.
24229 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
24230         
24231         * marshal.c: actually cache stelem.ref wrappers.
24232         
24233 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
24235         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
24236         sections and remove the mono_cli_rva_map () function.
24238 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
24240         * debug-mono-symfile.c: fix one more endianess issue, from a patch
24241         by Geoff Norton (<gnorton@customerdna.com>).
24243 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24245         * class.c: fix class loads for pointer types (typeof(int) !=
24246         typeof(int*)).
24248 2004-07-27  Martin Baulig  <martin@ximian.com>
24250         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
24251         reading the debugging information from an external ".mdb" file.
24253 2004-07-24  Martin Baulig  <martin@ximian.com>
24255         * reflection.c (mono_image_get_type_info): Only write a class
24256         layout entry if we actually have a size or a packing size.
24258 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
24260         * reflection.c (type_get_fully_qualified_name): 
24261         insert cast to get type checking of ?: with non-gcc compilers
24263 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
24265         * rand.c: use g_getenv for both lookups of
24266         MONO_EGD_SOCKET
24268 2004-07-17  Martin Baulig  <martin@ximian.com>
24270         * reflection.c (mono_reflection_bind_generic_method_parameters):
24271         Set `gmethod->reflection_info'.
24273 2004-07-17  Martin Baulig  <martin@ximian.com>
24275         * class.c (mono_class_create_from_typedef): Insert the newly
24276         created class into the hash table before computing the interfaces
24277         since we could be called recursively.
24279 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
24281         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
24282         function to implement stelem.ref in managed code
24283         * class-internals.h, debug-helpers.c: a new wrapper type
24284         for the above.
24286 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
24288         * gc.c: allow GC handles to work even when no GC is compiled in.
24289         Fix part of bug #61134 (GetAddrOfPinnedObject).
24291 2004-07-13  Peter Williams  <peter@newton.cx>
24293         * process.c (complete_path): Make sure we don't attempt to execute
24294         directories.
24296 2004-07-12  Geoff Norton <gnorton@customerdna.com>
24298         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
24299           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
24300           and will add/subtract the hour if needed
24302 2004-07-12  Martin Baulig  <martin@ximian.com>
24304         * reflection.c (mono_field_get_object): If we have
24305         `field->generic_info', take the attributes from
24306         `field->generic_info->generic_type'.    
24308 2004-07-12  Martin Baulig  <martin@ximian.com>
24310         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
24311         This function must be called before initializing the runtime.
24312         (mono_debug_init_1): New function; call this after initializing
24313         the runtime, but before loading the assembly.  It tells the
24314         debugger to load corlib and the builtin types.
24316         * mono-debug-debugger.c: Did some larger changes in the debugging
24317         code; support recursive class declarations, make sure we actually
24318         add all classes.
24320 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24322         * debug-helpers.c: undo my previous patch and fixed the real issue in
24323         ../mini/exceptions-x86.c
24325 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24327         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
24328         when no HOME env. variable was set and a NullRef was thrown in a .cctor
24329         called from other .cctors.
24331 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
24333         * loader.c: Removed the mono_loader_wine_init hack now that we are
24334         doing a managed version of Windows.Forms.
24336 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
24338         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
24339         threadpool.c, threads.c: remove static data from rootset.
24341 2004-07-09  Dick Porter  <dick@ximian.com>
24343         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
24344         Don't do any more processing if the matched length was 0.  It was
24345         increasing the size of the string before.  Fixes bug 61167.
24347 2004-07-09  Dick Porter  <dick@ximian.com>
24349         * socket-io.h:
24350         * socket-io.c
24351         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
24352         Add support for SO_PEERCRED if its available.
24354 2004-07-09  Peter Bartok <pbartok@novell.com>
24355         * loader.c: winelib.exe.so error message is now only displayed if
24356         MONO_DEBUG is set. To help us avoid questions when people are trying
24357         out the new Managed.Windows.Forms.
24359 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
24361         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
24362         for isinst and castclass wrappers.
24364         * class-internals.h icall.c: Move registration and lookup of JIT icalls
24365         to libmetadata from the JIT, so they could be used by the marshalling
24366         code and the interpreter.
24368         * marshal.c: Register marshalling related JIT icalls here instead of
24369         in mini.c. Use CEE_MONO_ICALL instead of the family of 
24370         CEE_MONO_PROC<x> opcodes to call marshalling functions.
24372         * metadata.h: Remove unneeded marshalling conversions.
24374         * opcodes.c: Update for new opcodes.
24375         
24376 2004-07-08  Martin Baulig  <martin@ximian.com>
24378         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
24379         (mono_debug_get_domain_data): Make this function static.
24381 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
24383         * gc.c, object.h: add nice GC handle API for embedders.
24385 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
24387         * reflection.c: more changes for the new api
24389         * object.c: When we reflect on a field w/ a constant value, it
24390         will not have a memory location, so we must access metadata. Also,
24391         allow easier reading of strings so that we can read them from
24392         the constant data.
24394         * class.c (mono_class_layout_fields): no need for literal fields here.
24396         * class-internals.h: api changes for const fields
24398         * icall.c (ves_icall_get_enum_info): use new apis for const fields
24400 2004-07-06  Martin Baulig  <martin@ximian.com>
24402         * mono-debug.h: Increment version number to 44.
24404         * mono-debug.c (mono_debug_add_wrapper): The second argument is
24405         now a gpointer, rewrote this whole method.
24407         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
24408         function.  Add information about the wrapper in a new "misc table".
24410         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
24411         for the new misc table.
24413 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
24415         * metadata-internals.h image.c: Add a cache for helper signatures.
24417         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
24419 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
24421         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
24422         delegates from a delegate. Fixes #61033.
24423         
24424         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
24425         marshalling of stringbuilder arrays. Fixes #59900.
24427 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
24429         * icall.c: Add EnumBuilder:setup_enum_type icall.
24431 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
24433         * icall.c: Added a new icall for the property version of
24434         OffsetOfStringData.
24436 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
24438         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
24439         it has a constant size across platforms.
24441         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
24442         stack trace.
24444 2004-06-29  Martin Baulig  <martin@ximian.com>
24446         * mono-debug.c (mono_debug_add_method): Protect the whole function
24447         in mono_debugger_lock(), not just parts of it.
24449 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
24451         * reflection.c: make sure padding bytes in heaps are zeroed.
24453 2004-06-24  David Waite  <mass@akuma.org>
24455         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
24456         image.c, loader.c, locales.c, marshal.c, metadata.c,
24457         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
24458         string-icalls.c, threads.c: change to C90-style comments from C99 /
24459         C++ -style
24461 2004-06-24  Dick Porter  <dick@ximian.com>
24463         * threads.c
24464         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
24465         return createdNew.  Fixes bug 60412.
24467         * threads-types.h: 
24468         * icall.c: Add createdNew parameter to CreateMutex icall
24470 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
24472         * reflection.c, object-internals.h: save default value in params.
24474 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24476         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
24477         no need to build a new path combining that with the application base.
24478         Fixes bug #60442.
24480 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
24482         * reflection.c: fixed minor standard compliance issues.
24484 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
24486         * reflection.c: fixed issue with encoding some custom attributes
24487         (arrays in properties and fields, bug #60411).
24489 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24491         * reflection.c: fix start address when copying the public key token.
24493 2004-06-23  Martin Baulig  <martin@ximian.com>
24495         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
24496         the `exc' object in a static object to put it into the GC's root set.
24498 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
24500         * reflection.c: make mono_reflection_setup_internal_class ()
24501         callable a second time to setup a new parent class.
24503 2004-06-23  Dick Porter  <dick@ximian.com>
24505         * threads.c: Check for WAIT_IO_COMPLETION return values.
24507 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
24509         * appdomain.c: Removed the g_free on the public key token. Now copy 
24510         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
24511         * assembly.c: Added public key token string value when loading 
24512         assemblies. Fix bug #60439.
24513         * icall.c: Added missing informations (like public key) in 
24514         GetReferencedAssemblies. Fix #60519.
24515         * image.h: Changed definition for public key token from const char*
24516         public_tok_value to guchar public_key_token [17];
24517         * reflection.c: Updated for changes to public key token.
24519 2004-06-22  Lluis Sanchez Gual
24521         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
24522         for the field in base classes.
24524 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
24526         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
24527         mark headers as not supported, they are installed only for use by the
24528         debugger.
24530 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
24532         * *.c, *.h: avoid namespace pollution in public headers.
24534 2004-06-21  Martin Baulig  <martin@ximian.com>
24536         * exception.c (mono_get_exception_security): It's in
24537         "System.Security", not in "System".
24539         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
24540         the exception classes.
24542 2004-06-21  Martin Baulig  <martin@ximian.com>
24544         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
24545         Protect the exception object from being finalized.
24547 2004-06-21  Martin Baulig  <martin@ximian.com>
24549         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
24550         public function.
24552 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
24554         * reflection.c: Load the assembly in mono_reflection_type_from_name,
24555         if it was not loaded before. Fix parts of #60439.
24557 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
24559         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
24560         code that was broken since Ben's change: wrappers are now
24561         dependent on the method signature only again.
24563 2004-06-21  Martin Baulig  <martin@ximian.com>
24565         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
24566         added interface support.
24568 2004-06-21  Martin Baulig  <martin@ximian.com>
24570         * class.c (mono_vtable_get_static_field_data): New public method.
24572 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
24574         * filewatcher.c : Windows build fix to be compliant with API changes.
24576 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
24578         * class.h, class.c: more accessors.
24579         * metadata.h, metadata.c: prepare for hiding MonoType and
24580         MonoMethodSignature: people should use the accessors from now on
24581         outside of the tree.
24583 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
24585         * *.c, *.h: more API cleanups.
24587 2004-06-18  Jackson Harper  <jackson@ximian.com>
24589         * assembly.c: Trace loading assemblies.
24590         * loader.c: Trace loading native libraries.
24591         * mono-config.c: Trace loading config files.
24592         
24593 2004-06-18  Dick Porter  <dick@ximian.com>
24595         * locales.c: Tell ICU the lengths of strings, it can cope with
24596         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
24598 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
24600         * image.c: swapped name/filename;
24602 2004-06-18  Martin Baulig  <martin@ximian.com>
24604         * mono-debug-debugger.c (write_class): Write the parent class at
24605         the end of the header.
24607 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
24609         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
24611 2004-06-17  Raja R Harinath  <rharinath@novell.com>
24613         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
24614         (bundle_obj): New conditional define.
24615         (BUILT_SOURCES): Remove.
24616         ($(bundle_srcs)): Make parallel-make safe.
24617         (libmonoruntime_la_LIBADD): Make unconditional.
24618         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
24619         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
24621 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
24623         * culture-info-tables.h: It was inconsistent with the latest
24624           supp info files.
24626 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
24628         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
24629         be loaded.
24631         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
24632         with gcc 2.95.
24634 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
24636         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
24637         cleaned up public header threads.h.
24639 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
24641         * Makefile.am, *.c, *.h: more API cleanups.
24643 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
24645         * Makefile.am: removed monosn from compilation.
24646         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
24647         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
24648         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
24649         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
24650         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
24651         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
24653 2004-06-15  Jackson Harper  <jackson@ximian.com>
24655         * assembly.c: Make locales lower case when searching the GAC for
24656         assemblies. gacutil will always make locales lowercase when
24657         installing so this effectively makes them case insensitive.
24658         
24659 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
24661         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
24662         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
24663           parameter which allows to choose whether the wait can be interrupted or 
24664           not. Also added the method mono_monitor_enter(), which locks the monitor
24665           using an infinite wait and without allowing interruption.
24666           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
24667           interrupted.
24668         * object.h: Added new fields in MonoThread. suspend_event holds the event
24669           used to susped/resume the thread. synch_lock is the lock object to use for
24670           modifying the thread state.
24671         * threads.c: Use the new synch_lock object for locking, instead of "this",
24672           which can generate deadlocks.
24673           Moved thread state change in Thread.Sleep and Thread.Join from managed
24674           to unmanaged code. This avoids a deadlock when the thread was suspended
24675           just after acquiring the thread lock.
24676           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
24677           Implemented Thread.Suspend using an event instead of ThreadSuspend,
24678           which is not fully implemented in the io-layer.
24679         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
24681 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
24683         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
24684         threads-types.h: more API cleanups.
24686 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
24688         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
24689         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
24690         threadpool.c, threads.c: first pass at the exported API cleanup.
24692 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
24694         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
24696 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24698         * icall.c: added internalGetHome.
24700 2004-06-14  Dick Porter  <dick@ximian.com>
24702         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
24703         possible to return successfully when '.' or '..' were the only
24704         entries in a directory, but were skipped.  The MonoIOStat was not
24705         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
24706         Fixes bug 59574.
24708 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
24710         * reflection.c: make binaries run on .Net 1.1 by default.
24712 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
24714         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
24716 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
24718         * marshal.c: keep track of struct size with explicit layout
24719         (bug #59979).
24721 2004-06-12  Martin Baulig  <martin@ximian.com>
24723         * mono-debug-debugger.c: Comment out a debugging g_message().
24725 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
24727         * reflection.c, reflection.h: do not free custom attrs that are cached.
24728         * icall.c: use braces to make code clearer.
24730 2004-06-11  Martin Baulig  <martin@ximian.com>
24732         * class.h (MonoInflatedField): New type.
24733         (MonoClassField): Replaced `MonoType *generic_type' with
24734         `MonoInflatedField *generic_info'.
24736         * icall.c
24737         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
24739 2004-06-11  Martin Baulig  <martin@ximian.com>
24741         * reflection.c (mono_image_create_method_token): Correctly encode
24742         varargs methods.
24744 2004-06-11  Martin Baulig  <martin@ximian.com>
24746         * metadata.c (mono_metadata_parse_method_signature): When parsing
24747         a MethodDef which has VarArgs, also set sentinelpos if we don't
24748         have any parameters.
24750 2004-06-11  Martin Baulig  <martin@ximian.com>
24752         * verify.c (mono_method_verify): In CEE_CALL, use
24753         mono_method_get_signature() to get the method's signature, unless
24754         we're a PInvoke method.
24756 2004-06-10  Jackson Harper  <jackson@ximian.com>
24758         * assembly.c: Use <path>/lib/mono/gac for the extra paths
24759         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
24760         logical name as the supplied path is just a prefix to the gac not
24761         the direct path to it.
24762         
24763 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
24765         * reflection.c: make the token for a created method match
24766         the token of the MethodBuilder it was created from
24767         (IKVM requires this behaviour now).
24769 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
24771         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
24772         reflection.c, socket-io.c: leak fixes.
24774 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
24776         * icall.c: handle sentinel pos in vararg methods in position different
24777         from 0.
24779 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24781         * culture-info-tables.h: freshly generated.
24783 2004-06-09  Martin Baulig  <martin@ximian.com>
24785         * loader.c (mono_get_method_constrained): Call `mono_class_init
24786         (constrained_class)'.   
24788 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
24790         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
24791         any methods. Fixes #59629.
24793 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24795         * culture-info-tables.h: reflecting locale-builder updates.
24797 2004-06-08  Dick Porter  <dick@ximian.com>
24799         * object.h:
24800         * locales.c: Fixed compile warnings, including a real bug in
24801         CompareInfo_internal_compare.
24802         
24803 2004-06-08  Dick Porter  <dick@ximian.com>
24805         * locales.c
24806         (ves_icall_System_Globalization_CompareInfo_internal_index):
24807         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
24808         Double-check the resuls of usearches, because ICU currently
24809         ignores most of the collator settings here.  Fixes bug 59720.
24810         
24811 2004-06-08  Dick Porter  <dick@ximian.com>
24813         * locales.c
24814         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
24815         Fix memory leak and segfault-causing typo.  No idea how this one
24816         lasted so long without being noticed.
24818 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
24820         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
24821         any methods. Fixes #59629.
24823 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24825         * assembly.c:
24826         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
24827         own the critical section before). Removed dead code (that's done
24828         in the preload hook).
24830         (mono_assembly_load_with_partial_name): call the preload hook.
24832 2004-06-08  Martin Baulig  <martin@ximian.com>
24834         * metadata.c (mono_metadata_signature_alloc): Default
24835         `sentinelpos' to -1.
24837         * reflection.c (mono_image_get_array_token): Likewise.
24839 2004-06-08  Martin Baulig  <martin@ximian.com>
24841         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
24843         * metadata.c (mono_metadata_parse_method_signature): When parsing
24844         a MethodDef which has VarArgs, set sentinelpos.
24846         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
24847         `gint16' since we're using -1 for non-varargs methods.
24849         * reflection.c
24850         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
24851         (method_encode_signature): Added varargs support.
24852         (method_builder_encode_signature): Likewise.
24853         (mono_image_get_varargs_method_token): New static method.
24854         (mono_image_create_method_token): New public method; this is
24855         called via an icall instead of mono_image_create_token() when
24856         calling a varargs method.       
24858 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
24860         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
24862 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24864         * culture-info-tables.h : Reflecting the latest locale-builder that
24865           fixed empty array representation ({} to {0}).
24867 2004-06-07  Jackson Harper  <jackson@ximian.com>
24869         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
24870         looking up extra gac paths. This allows MONO_GAC_PATH to act
24871         exactly like a prefix.
24872         
24873 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
24875         * reflection.c (mono_reflection_type_from_name): Make a copy of the
24876         type name before modifying it. Fixes #59405.
24878 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24880         * culture-info.h: added fields for "all datetime patterns".
24881         * locales.c: (  ves_icall_System_Globalization_CultureInfo
24882           _construct_datetime_format ()): fill xxx_patterns fields.
24883         * object.h: added fields for "all datetime patterns" to
24884           MonoDateTimeFormatInfo.
24885         * culture-info-tables.h: reflecting locale-builder updates.
24887 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
24889         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
24890         the event has no add and remove methods. Fixes #59629.
24892 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
24894         * object.c: Fixed possible integer overflow when allocating large
24895         strings.
24897 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
24899         * culture-info-tables.h: reflecting locale-builder updates.
24901 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
24903         * culture-info-tables.h: reflecting locale-builder updates.
24905 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
24907         * culture-info-tables.h: reflecting locale-builder updates.
24909 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
24911         * threads.c: Made Thread.Sleep abortable.
24913 2004-06-02  Martin Baulig  <martin@ximian.com>
24915         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
24917         * debug-mono-symfile.h: Bumped symbol file version number to 37.
24919 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
24921         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
24923 2004-05-30  Jackson Harper  <jackson@ximian.com>
24925         * reflection.c: Do not hardcode assembly versions or public key
24926         tokens anymore. All of this except the corlib section was dead
24927         code anyways.
24928         
24929 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
24931         * object.c (mono_runtime_invoke_array): Automatically create boxed
24932         objects for byref valuetypes if needed. Fixes #59300.
24933         
24934         * object.c (mono_method_return_message_restore): Handle 
24935         MONO_TYPE_OBJECT as well.
24937 2004-05-28  Jackson Harper  <jackson@ximian.com>
24939         * reflection.c: The modified type encoding was causing build
24940         problems. Reverted for now.
24941         
24942 2004-05-28  Jackson Harper  <jackson@ximian.com>
24944         * reflection.c/h: Take an assembly ref so that we dont create
24945         fully qualified names when encoding types in the same assembly as
24946         the custom attribute being emitted.
24947         * appdomain.c: Increment version number.
24948         
24949 2004-05-26  Duncan Mak  <duncan@ximian.com>
24951         * icall.c
24952         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
24953         Set the full version number (major, minor, build, revision).
24955 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
24957         * marshal.c (emit_struct_conv): increment src/dst after blit
24958         (mono_marshal_get_managed_wrapper,
24959         mono_marshal_get_native_wrapper): make sure we have marshalling
24960         info before marshalling params (info computation affects
24961         blittable)
24963         * class.c (class_compute_field_layout): correctly deal with
24964         blittable
24965         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
24966         value types (as per what windows dows by default)
24967         (mono_class_setup_mono_type): System.ValueType is blittable
24968         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
24969         blittable
24971         * marshal.c (mono_marshal_load_type_info): flag types  as
24972         non-blittable if the native layout doesn't match the managed
24973         layout
24975 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24977         * appdomain.c: don't add stuff in the private search path that is
24978         above the application base. If application base is not set, there's
24979         no private search path.
24981 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
24983         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
24984         byref struct arguments in native->managed marshalling.
24986 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
24988         * marshal.c (mono_marshal_get_runtime_invoke): correctly
24989         cache methods using signature (special case for methods
24990         that are value type or string class)
24991         
24992         * image.c (mono_image_close): clean up allocated GSList's
24993         in runtime_invoke_cache.
24995 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24997         * mono-config.c: set the correct path for mono_cfg_dir on windows when
24998         there's no MONO_CFG_DIR environment variable defined.
25000 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25002         * threads.c: windows version must be >= 0x0500 to include OpenThread.
25004 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
25006         * threadpool.c: Really wait for 500ms after the async call, even if the wait
25007           is interrumped.
25008         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
25009           before waiting for it, and call CloseHandle after the wait to unref it.
25010           This will make sure that handles are not disposed too early.
25012 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25014         * appdomain.c:
25015         * appdomain.h:
25016         * icall.c: removed
25017         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
25018         needed now.
25020         * object.c: se the application_base only for the domain that runs
25021         Main. Fixes bug #59216,
25023 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25025         * appdomain.c:
25026         * object.c: only the domain in which Main is run have
25027         SetupInformation.ConfigurationFile set, so moved a few lines from
25028         appdomain.c to object.c.
25030 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25032         * appdomain.c: we tried to load [name].(dll|exe), but according
25033         to bug #57710, we must also try [culture]/[name].(dll|exe) and
25034         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
25035         There's a test case attached to bug #58922.
25037 2004-05-27  Dick Porter  <dick@ximian.com>
25039         * icall.c:
25040         * file-io.c: Implemented icalls for locking and unlocking regions
25041         in a file.
25042         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
25043         FALSE on error (fixes both compiler warning and real bug.)
25045 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
25047         * culture-info-tables.h: reflecting locale-builder updates.
25049           (Added missing ChangeLog entry for 05/26)
25051 2004-05-27  Jackson Harper  <jackson@ximian.com>
25053         * locales.c: Fix some cut and paste errors.
25054         
25055 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25057         * mono-config.c: set the correct path for config. directory on windows.
25059 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
25061         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
25062           on win32.
25064 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
25066         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
25067         from pinvoke functions.
25068         
25069         * marshal.c (mono_ftnptr_to_delegate): Implement this.
25071 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
25073         * culture-info-tables.h: reflecting locale-builder updates.
25075 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
25077         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
25078         #59086.
25080 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
25082         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
25083         * icall.c: Modified icalls for RNG.
25084         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
25085         Windows (CryptoAPI).
25087 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
25089         * locales.c: Fix build.
25091 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
25093         * culture-info-tables.h: reflecting locale-builder updates.
25095 2004-05-25  Jackson Harper  <jackson@ximian.com>
25097         * locales.c: When creating the current culture use the $LANGs
25098         specific culture. So DateTimeFormat and NumberFormat entries are created.
25099         
25100 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
25102         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
25103         a char array as parameter.
25105 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
25107         * image.c: In mono_image_open(), always use an absolute path name to
25108           look for already loaded images.
25110 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
25112         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
25113         missing in the windows build (like older cygwin include files).
25115 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
25117         * icall.c: Fixed check for possible integer overflow in Buffer_
25118         BlockCopy icall. Replaced comments style // by /* */.
25120 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
25122         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
25123         
25124         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
25125         check after MONO_VTADDR. Fixes pinvoke2.exe.
25127         * marshal.h marshal.c metadata.h: Add beginnings of support for
25128         ftnptr -> delegate marshalling.
25130 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
25132         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
25133         * threads.c: Fix warnings.
25135 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
25137         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
25138         * icall.c: Registered icalls for Suspend and Resume.
25139         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
25140           Thread.Abort.
25141         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
25142         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
25143         * process.c: Use WaitForSingleObjectEx.
25144         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
25145           checkpoints.
25146         * threads.c, threads.h: Make use of new Ex wait methods. Improved
25147           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
25148           for Suspend and Resume. Added new mono_thread_stop, used for stoping
25149           background threads. Added basic support for Abort in Windows.
25150           Start new threads using a managed delegate invoke wrapper. This wrapper
25151           has an interruption checkpoint that is needed since an interruption
25152           can be requested before the thread leaves the unmanaged code that starts 
25153           the thread.
25154         * marshal.c: Added interruption checkpoint after every native call, and
25155           also before managed calls for wrappers called from unmanaged code to
25156           go into managed code.
25157         * object.h: Added new field in MonoThread to keep track of interruption
25158           requests.
25160 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
25162         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
25163         calls.
25165 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25167         * appdomain.c:
25168         * assembly.c:
25169         * gc.c:
25170         * locales.c:
25171         * mono-config.c:
25172         * rand.c: getenv -> g_getenv (windows!)
25174         * process.c: complete_path is also used on non-windows platforms.
25176 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25178         * icall.c: new signature for Process_Start.
25180         * process.[ch]: new signature for Process_Start. If we're on windows
25181         and UseShellExecute is false, we have to search for the program by
25182         ourselves if we don't get a full path.
25184 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
25186         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
25187         marshalling and call CleanUpNativeData if needed. Fixes #58646.
25189 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25191         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
25192         Fixes bug #58373.
25194 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25196         * process.c: use double quotes to quote program name and arguments on
25197         windows. Fixes bug #58575.
25199 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25201         * file-io.c: don't return "." and ".." when using windows Find*File.
25203 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
25205         * marshal.c: Don't pass wrappers to message init because method 
25206         addressed used to lookup metadata. part of remoting[2|3] fix.
25208 2004-05-15  Jackson Harper  <jackson@ximian.com>
25210         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
25211         path is essentially the same as MONO_PATH except that it points to
25212         GACs instead of lib directories.
25213         * loader.h: The user gac is gone so we dont need function to
25214         enable/disable it.
25215         * mono-config.c: user gac option is now gone.
25216         
25217 2004-05-15  Jackson Harper  <jackson@ximian.com>
25219         * culture-info.h: Make defines more consistent, add calendar data
25220         to the culture info table.
25221         * culture-info-tables.h: Add basic calendar data. Basically
25222         everyone gets default gregorian until all the data is
25223         updated.
25224         * locales.c: Use the new consistent defines. Set calendar data for
25225         culture info objects.
25226         * object.h: add a field for calendar data to CultureInfo
25227         
25228 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
25230         * image.c: image->runtime_invoke_cache is keyed on signatures now.
25231         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
25232         a signature.
25233         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
25234         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
25235         an extra param that is the pointer of the method to invoke. The IL for
25236         the invoke method is no longer specific to the method, but to the
25237         signature of the method. Thus, we can share the same code for multiple
25238         methods. This reduces the number of methods that have to be compiled.
25240 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
25242         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
25244         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
25246         * icall.c: Optimize Buffer.BlockCopy.
25248 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25250         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
25251         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
25252         quote). Changed them to "MMMM yyyy".
25254 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
25256         * rand.c
25257         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
25259 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
25261         * reflection.h: Updated after changes to managed structures.
25263         * appdomain.c: Bump corlib version.
25265 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25267         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
25268         windows.
25270 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25272         * Makefile.am: link to ../os/libmonoos.la on windows.
25274         * assembly.c:
25275                 -If MONO_DEBUG, warn about non-existing directories in
25276                 MONO_PATH.
25277                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
25278                 compile time variable.
25279                 -Removed init_default_path and call mono_set_rootdir from
25280                 libmonoos.a instead (windows only).
25282         * assembly.h: declare mono_assembly_getrootdir().
25284         * domain.c:
25285         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
25287         * loader.c: s/getenv/g_getenv/
25289 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
25291         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
25293         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
25295         * metadata.h: Add new marshalling conversions.
25297         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
25298         function.
25300         * reflection.c (mono_reflection_get_type): Lookup the type in all
25301         modules of a multi-module assembly. Fixes #58291.
25303 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
25305         * threads.c: Before aborting a background, set the StopRequested
25306         state.  This avoids throwing the Abort exception.
25307         In mono_thread_manage, don't continue with the shutdown until all
25308         aborted threads have actually stopped.
25310 2004-05-10  Jackson Harper  <jackson@ximian.com>
25312         * locales.c: Remove the modifier from culture names.
25313         
25314 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25316         * Makefile.am: monosn is not installed any more. It has been deprecated
25317         in favor of sn.
25319 2004-05-07  Jackson Harper  <jackson@ximian.com>
25321         * locales.c
25322         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
25323         Fix array construction, add bailout if the length is 0.
25325 2004-05-07  Dick Porter  <dick@ximian.com>
25327         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
25328         machine doesn't have a DNS entry.  Patch by Urs Muff
25329         (umuff@quark.com), fixes bug 57928.
25331 2004-05-06  Jackson Harper  <jackson@ximian.com>
25333         * reflection.c: Handle null PublicTokens properly. alloc mem for
25334         assembly names culture so we dont crash when freeing it.
25335         
25336 2004-05-06  Jackson Harper  <jackson@ximian.com>
25338         * assembly.c: Check the usergac when loading with partial names.
25339         
25340 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
25342         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
25343         does nothing for now (not required for Linux/Windows) but the class
25344         library can call it (and a newer or modified runtime could need it).
25345         * icall.c: Registred icall.
25347 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25349         * loader.c: prints a message on module loading error we set MONO_DEBUG
25350         environment variable.
25352 2004-05-05  Jackson Harper  <jackson@ximian.com>
25354         * appdomain.c: Handle PublicKeyToken=null properly.
25355         
25356 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
25358         * environment.c|h: Added icall ves_icall_System_Environment_
25359         GetOSVersionString to get the current OS version as a string.
25360         * icall.c: Registred icall.
25362 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
25364         * object.c: in mono_object_get_virtual_method(), take into account that
25365         non-virtual methods don't have a slot in the vtable. Check needed when
25366         the object is a proxy.
25368 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
25370         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
25371         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
25373         * object.c (mono_class_compute_gc_descriptor): Fix warning.
25375         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
25376         passed when a valuetype is expected.
25378         * object.c (mono_unhandled_exception): Only set the exit code if the
25379         exception happens in the main thread. Fixes thread5.exe.
25381         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
25382         invalid names. Fixes #58047.
25384 2004-05-03  Jackson Harper  <jackson@ximian.com>
25386         * assembly.c: This line was committed accidently and is unneeded.
25387         
25388 2004-05-03  Jackson Harper  <jackson@ximian.com>
25390         * icall.c: Add new icall for Assembly::LoadWithPartialName
25391         * assembly.c/.h: new function that probes the GAC to load partial
25392         assembly names by Paolo Molaro.
25393         
25394 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25396         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
25397         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
25398         (type_get_fully_qualified_name): Added PublicKeyToken when building a
25399         full type name.
25401 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25403         * appdomain.c: fixed check for 'neutral' culture and removed warning.
25404         * reflection.c: fix bug when parsing a full type name and Version is not
25405         the last thing in the string.
25407 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
25409         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
25410         crashes when it is freed.
25412 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25414         * assembly.c: print the compat warning to stderr.
25416 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
25418         * assembly.c (mono_assembly_load_references): Add a compatibility
25419         hack to run old applications that might be still referencing the
25420         3300-based assemblies, only do this for System.xxx.
25422 2004-05-01  Jackson Harper  <jackson@ximian.com>
25424         * appdomain.c: If the culture is neutral we set it to "".
25425         
25426 2004-04-29  Jackson Harper  <jackson@ximian.com>
25428         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
25430 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
25432         * string-icalls.c: added low overhead function for copying chars
25433         * icall.c: added needed icall for the above function
25435 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25437         * icall.c: fix return value of get_global_assembly_cache.  Implemented
25438         Environment.GetLogicalDrives.
25440 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
25442         * rand.c: try and talk to egd or prngd
25443         for random bytes if opening devices fail.
25445 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
25447         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
25448         alignment for the type using the native alignment of its members 
25449         instead of using klass->min_align.
25451         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
25453 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25455         * file-io.c:
25456         * socket-io.c: added check for sys/aio.h.
25458 2004-04-28  Dick Porter  <dick@ximian.com>
25460         * threads.c: Don't abort a thread thats already aborting, when
25461         terminating everything.
25463 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25465         * icall.c: added 2 new async calls for Socket.
25467         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
25468         IO on *nix systems.
25470         * threadpool.c: removed unused variable.
25472 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
25474         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
25476 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25478         * locales.c: put back string_invariant_tolower () and
25479         string_invariant_toupper ().
25481 2004-04-26 David Waite <mass@akuma.org>
25483         * file-io.h:
25484         * socket-io.h:
25485         * threads.h:
25486         * unicode.h: remove comma from end of enumeration declarations
25488 2004-04-26 David Waite <mass@akuma.org>
25490         * debug-mono-symfile.h:
25491         * decimal.c:
25492         * mono_debug.h:
25493         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
25496 2004-04-26  Jackson Harper  <jackson@ximian.com>
25498         * appdomain.c: Increment version number.
25499         
25500 2004-04-26  Jackson Harper  <jackson@ximian.com>
25502         * appdomain.c: Set assembly references public token value when
25503         PublicKeyToken is specified, not the hash_value. Free public token
25504         values when free assembly name data. Previously the public key
25505         token was hex decoded, however we are using hex encoded public key
25506         tokens, so this is not neccasary.
25507         * assembly.c: Lookup assemblies in the gac if their public token
25508         value is set. Add function to allow enabling user gac
25509         lookups. Specify whether or not the assembly was loaded from the
25510         GAC. Compare full assembly names when checking the cache for
25511         assemblies (Temporarily disabled see comment in code). Remove
25512         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
25513         specifies trace-loader they get extra info to stdout on the
25514         loading of assemblies.
25515         * image.h: Add a field for an assembly references public token
25516         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
25517         whether an assembly has been loaded from the GAC.
25518         * image.c: Remove a corlib -> mscorlib name mapping.
25519         * loader.h: Add function to enable/disable the user gac.
25520         * mono-config.c: Check if the usergac is enabled in the config
25521         file.
25522         * icall.c: New icall to determine whether or not an assembly has
25523         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
25524         * tabldefs.h: Add constant for assemblyref flag that specifies a
25525         full public key is used instead of a public token.
25526         * reflection.c: Remove mscorlib -> corlib mappings. Set
25527         PublicTokenValue instead of hash value. This value is a hex
25528         string so it does not need to be expanded.
25530 2004-04-26  Martin Baulig  <martin@ximian.com>
25532         * mono-debug-debugger.c (mono_debugger_initialize): Set
25533         `mono_debugger_initialized' before calling mono_debug_lock().
25535 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
25537         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
25538           InternalToUpper/InternalToLower.
25539         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
25540           removed invariant culture shortcut.  This is now done in managed code.
25541         * locales.c: (string_invariant_toupper/tolower) removed.
25543 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25545         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
25546         Added Poll internal call.
25548         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
25549         call for Poll. Select was too heavy for polling a single socket.
25551         * threadpool.[ch]: added mono_threadpool_cleanup.
25552         * threads.c: use it. Don't use Thread_Abort on windows.
25554 2004-04-23  Martin Baulig  <martin@ximian.com>
25556         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
25558 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
25560         * icall.c: Registred new icalls for key pair protection and added an
25561         icall for Environment.GetFolderPath on Windows.
25562         * security.c|h: Added new icalls for key pair protection.
25564 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25566         * socket-io.c: don't display the non-supported family warning for known
25567         families. Now this is not displayed on windows when checking support
25568         for IPv4/IPv6.
25570 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25572         * class.c: don't display the layout warning for static fields.
25574 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
25576         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
25577         * locales.c, locales.h: Added new icalls for culture-specific
25578         Char.ToLower and Char.ToUpper.
25580 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25582         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
25583         by David Waite.
25585 2004-04-20  Martin Baulig  <martin@ximian.com>
25587         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
25588         of the type name before passing it to mono_reflection_type_from_name().
25590 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
25592         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
25593         encodings here. Fixes #56965.
25595 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
25597         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
25598         fix test on strstr result not that I can see anything that
25599         relies on the result.
25601 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
25603         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
25604         Fixes #57081.
25606         * marshal.c (mono_marshal_get_string_encoding): New helper function.
25608         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
25609         function to determine which marshalling to use for strings. Fixes
25610         #56965.
25612         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
25614         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
25616 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
25618         * icall.c: #include mono-config.h
25620 2004-04-15  Jackson Harper  <jackson@ximian.com>
25622         * culture-info-tables.h: Fix date formats for en-US culture.
25623         
25624 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
25626         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
25627         ThreadPool.SetMinThreads.
25628         * threadpool.c: Implemented ThreadPool.GetMinThreads and
25629         ThreadPool.SetMinThreads.
25631 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
25633         * mono-config.c: also load the .config file in the directory
25634         where the assembly was found.
25636 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
25638         * assembly.c: load per-assembly config files.
25639         * icall.c: decrapified code to get the config dir and moved to
25640         mono-config.c.
25641         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
25642         per-assembly config files. When doing a dll map lookup give precedence
25643         to the per-assembly data.
25645 2004-04-14  Martin Baulig  <martin@ximian.com>
25647         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
25648         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
25649         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
25651         * mono-debugger-debugger.c: While the debugger is locked, remember
25652         whether the symbol tables have changes and send one single
25653         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
25655 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
25657         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
25659         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
25660         function.
25662         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
25663         account when marshalling string arrays. Fixes #56965.
25665 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
25667         * icall.c: Add new icalls mapping for security.
25668         * security.c|h: Add internal calls for WindowsIdentity,
25669         WindowsImpersonationContext and WindowsPrincipal.
25671 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
25673         * class.c: Added comment to ensure the System.MonoDummy class
25674         is removed when no longer necessary
25676 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
25678         * appdomain.c: Pass arguments to the bootstraping exceptions to
25679         minimize JITed methods at boot
25681         * metadata.c (mono_exception_from_name_two_strings): Allow for the
25682         second string to be null.
25684         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
25685         Change the protocol to minimize the JIT methods at startup.  Now
25686         it Returns the internal codepage, if the value of "int_code_page"
25687         is 1 at entry, and we can not compute a suitable code page
25688         number, returns the code page as a string.
25690 2004-04-13  Jackson Harper  <jackson@ximian.com>
25692         * culture-info-tables.h: Fix number of decimal digits for all
25693         english locales.
25695 2004-04-13  Jackson Harper  <jackson@ximian.com>
25697         * icall.c: Clairfy out of sync error message. It is not always
25698         your corlib that is out of sync.
25700 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
25702         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
25703         properties when only the set accessor is overriden. Fixes #55874.
25705 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
25707         * assembly.c (mono_assembly_load_references): Make this thread safe.
25708         Fixes #56327.
25710 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
25712         * monosn.c: Add missing initialization calls.
25714 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
25716         * locales.c:
25717         ves_icall_System_Globalization_CultureInfo_construct_number_format
25718         Fix g_assert so it compiles on fussier compilers re int/ptr
25719         mismatch
25721 2004-04-08  Dick Porter  <dick@ximian.com>
25723         * socket-io.h:
25724         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
25725         53992.  Also rearrange the code so that the internal calls return
25726         an error value and exceptions are thrown from managed code.
25728         * icall.c: Add type info to the socket icalls.
25730 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25732         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
25733         owes me a beer.
25735 2004-04-07  Martin Baulig  <martin@ximian.com>
25737         * class.c (mono_class_from_generic_parameter): Don't default
25738         `klass->parent' to `mono_defaults.object_type'.
25740 2004-04-07  Martin Baulig  <martin@ximian.com>
25742         * reflection.c (mono_reflection_initialize_generic_parameter): Set
25743         `param->pklass->reflection_info'.       
25745 2004-04-07  Jackson Harper  <jackson@ximian.com>
25747         * culture-info-tables.h: Fix date separator symbol.
25748         
25749 2004-04-07  Martin Baulig  <martin@ximian.com>
25751         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
25752         from System.Type to System.MonoType.
25754 2004-04-07  Martin Baulig  <martin@ximian.com>
25756         * reflection.h
25757         (MonoReflectionGenericParam): Added `has_reference_type' and
25758         `has_value_type' fields.
25760         * reflection.c (mono_image_get_generic_param_info): Encode the
25761         correct flags if we have the `class' or `struct' constraint.
25763 2004-04-07  Martin Baulig  <martin@ximian.com>
25765         * reflection.h
25766         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
25768 2004-04-07  Jackson Harper  <jackson@ximian.com>
25770         * appdomain.c: Revert extra patches, just wanted to bump the
25771         version number.
25772         
25773 2004-04-07  Jackson Harper  <jackson@ximian.com>
25775         * Makefile.am: Add culture-info private headers.
25776         * icall.c: Add new icalls for contructing locales.
25777         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
25778         * locales.h: Declare new culture info construction methods.
25779         * object.h: Add new fields used to avoid the CultureMap to
25780         MonoCultureInfo.
25781         * culture-info.h: Definition of structs used in the culture info
25782         tables.
25783         * culture-info-tables.h: Autogenerated tables that contain culture
25784         info data. This file was generated with the locale-builder tool.
25785         * appdomain.c: Incement corlib version number.
25786         
25787 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
25789         * appdomain.c: (mono_runtime_init) move mono_thread_init
25790         to before mono_object_new calls so critical sections
25791         are initialized before use.
25793 2004-04-07  Martin Baulig  <martin@ximian.com>
25795         * icall.c
25796         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
25797         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
25798         (ves_icall_MonoGenericParam_initialize): Removed.
25799         (monogenericparam_icalls): Removed.
25800         (generictypeparambuilder_icalls): Added new table for
25801         System.Reflection.Emit.GenericTypeParameterBuilder.
25803         * reflection.c
25804         (mono_reflection_define_generic_parameter): Removed.
25805         (mono_reflection_initialize_generic_parameter): This is now called
25806         from GenericTypeParameterBuilder's .ctor.
25808 2004-04-06  Martin Baulig  <martin@ximian.com>
25810         * class.c (mono_class_init): Don't inflate nested classes in a
25811         generic instance.
25812         (mono_type_get_name_recurse): Include the generic arguments for
25813         generic instances and generic type declarations.
25814         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
25815         (_mono_class_get_instantiation_name): Removed.
25816         (mono_class_create_generic): Always use `gklass->name' as our name.
25818         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
25820         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
25821         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
25822         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
25823         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
25824         closed generic methods here.
25826         * reflection.c
25827         (mono_reflection_generic_inst_get_nested_types): Removed.
25828         (inflate_mono_method): Copy the generic parameters from the
25829         MonoMethodHeader into out MonoGenericMethod.
25831 2004-04-06  Martin Baulig  <martin@ximian.com>
25833         * row-indexes.h
25834         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
25836         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
25838         * reflection.c (build_compressed_metadata): If we have any entries
25839         in the GenericParam, MethodSpec or GenericParamConstraint tables,
25840         set the header version to 1.1.
25842 2004-04-06  Martin Baulig  <martin@ximian.com>
25844         * class.c (mono_class_init): If we're a generic instance,
25845         initialize our nested classes, too.
25846         (_mono_class_get_instantiation_name): Deal with the new `!%d'
25847         suffix. 
25849 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25851         * process.c: quote the argument passed to the shell on windows.
25853 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
25855         * threads.c (mono_alloc_special_static_data): Allow this to be
25856         called during startup.
25858 2004-04-02  Martin Baulig  <martin@ximian.com>
25860         * icall.c
25861         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
25863 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
25865         * icall.c: Fix build.
25867 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
25869         * Makefile.am: Added security.c|h.
25870         * icall.c: Added icall for get_UserName;
25871         * security.c: New file for security related icalls. Added function
25872         get_UserName for System.Environment (fix #56144).
25873         * security.h: New. Header file for security.c
25875 2004-04-02  Dick Porter  <dick@ximian.com>
25877         * icall.c: Deleted the icalls that were obsoleted some time ago
25878         by the ICU string code, and which were mixed into the icall
25879         rearranging.  Fixes bug 55969.
25881         * string-icalls.h: 
25882         * string-icalls.c: Deleted the code that those icalls reference.
25884 2004-04-01  Martin Baulig  <martin@ximian.com>
25886         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
25888         * class.c (mono_class_from_generic_parameter): Don't set 
25889         TYPE_ATTRIBUTE_INTERFACE.
25890         (my_mono_class_from_generic_parameter): Likewise.
25892 2004-04-01  Martin Baulig  <martin@ximian.com>
25894         * loader.c (find_method): Added an optional `MonoClass *ic'
25895         argument to search in a specific interface.
25896         (mono_get_method_constrained): New public function.
25898 2004-04-01  Martin Baulig  <martin@ximian.com>
25900         * reflection.c (mono_image_get_generic_field_token): Use the
25901         `handleref' cache here.
25903 2004-04-01  Martin Baulig  <martin@ximian.com>
25905         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
25907         * reflection.c (create_generic_typespec): Use the `typespec' hash
25908         here, not the `typeref' one.    
25910 2004-04-01  Martin Baulig  <martin@ximian.com>
25912         * class.c (mono_class_inflate_generic_type): Moved the
25913         functionality into a new static inflate_generic_type() which
25914         returns NULL if it didn't do anything.  Only increment the
25915         `mono_stats.inflated_type_count' if we actually inflated
25916         something.
25917         (mono_class_get_full): Check the classes type to see whether we
25918         need to inflate it; also inflate MONO_TYPE_(M)VAR.
25920 2004-04-01  Jackson Harper  <jackson@ximian.com>
25922         * reflection.c: Set culture for assembly references.
25923         
25924 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
25926         * reflection.[ch], icall.[ch], Fix support for pinning variables.
25928 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25930         * assembly.c:
25931         (do_mono_assembly_open): the critical section also covers
25932         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
25934 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25936         * threads.c:
25937         (mono_manage_threads): abort the background threads when finishing.
25938         Fixes bug #47232.
25940 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25942         * gc.c: only close the done_event handle if there was no timeout.
25943         C-ified comments.
25945 2004-03-30  Martin Baulig  <martin@ximian.com>
25947         * icall.c (icall_entries): It's called "System.Activator", not
25948         "System.Activation".    
25950 2004-03-30  Martin Baulig  <martin@ximian.com>
25952         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
25953         (mono_class_create_from_typespec): Likewise.
25955 2004-03-30  Martin Baulig  <martin@ximian.com>
25957         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
25958         `has_ctor_constraint' and `initialized'.
25960 2004-03-30  Martin Baulig  <martin@ximian.com>
25962         * reflection.c (encode_new_constraint): New static function to add
25963         the constructor constraint attribute to a type parameter.
25964         (encode_constraints): Call encode_new_constraint() if necessary.
25966         * reflection.h
25967         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
25969         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
25970         
25971 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
25973         * reflection.c, icall.c: add support for pinning variables. 
25975 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
25977         * marshal.c (mono_marshal_get_managed_wrapper):
25978         init bool local with zero rather than null.
25980 2004-03-29  Martin Baulig  <martin@ximian.com>
25982         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
25983         the "official" behavior here.
25984         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
25986 2004-03-29  Martin Baulig  <martin@ximian.com>
25988         * icall.c: Reflect latest API changes.
25990 2004-03-29  Martin Baulig  <martin@ximian.com>
25992         * loader.c (mono_get_method_from_token): Also call
25993         mono_metadata_load_generic_params () for abstract and interface
25994         methods; replace the type arguments in the method signature with
25995         the ones which are loaded from the metadata.
25997 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
25999         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
26000         of the lock is not the current thread. MS.NET don't do it, in spite of
26001         what the documentation says. See bug #56157.
26003 2004-03-28  Martin Baulig  <martin@ximian.com>
26005         * class.c (mono_class_init): Don't call init_properties() and
26006         init_events() for generic instances; set `prop->parent' when
26007         inflating properties.
26009         * reflection.c (mono_generic_inst_get_object): Call
26010         `mono_class_init (ginst->klass)'.
26011         (mono_type_get_object): Only create a MonoGenericInst if your
26012         generic type is a TypeBuilder.
26013         (do_mono_reflection_bind_generic_parameters): Only set
26014         `ginst->is_dynamic' if our generic type is a TypeBuilder.
26016 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
26018         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
26019         Fixes #56091.
26021 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26023         * icall.c: added Kill_internal icall.
26024         * process.[ch]: added Kill_internal icall.
26026 2004-03-25  Martin Baulig  <martin@ximian.com>
26028         * class.h (MonoStats): Added `generic_instance_count',
26029         `inflated_method_count', `inflated_type_count' and
26030         `generics_metadata_size'.       
26032 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26034         * reflection.c: no warnings now.
26036 2004-03-25  Martin Baulig  <martin@ximian.com>
26038         * class.c (mono_class_get_full): New public function; does a
26039         mono_class_get(), but also takes a `MonoGenericContext *'.
26041         * loader.c (mono_field_from_memberref): Renamed to
26042         `field_from_memberref', made static and added `MonoGenericContext *'
26043         argument.
26044         (mono_field_from_token): Added `MonoGenericInst *' argument.
26045         (method_from_memberef): Likewise.
26046         (mono_get_method_from_token): Likewise.
26047         (mono_get_method_full): New public function; does a
26048         mono_get_method(), but also takes a `MonoGenericContext *'.
26050         * verify.c (mono_method_verify): Get the method's generic context
26051         and pass it to mono_field_from_token(), mono_get_method_full() and
26052         mono_class_get_full().
26054 2004-03-25  Martin Baulig  <martin@ximian.com>
26056         * class.c (mono_class_inflate_generic_type): Take a
26057         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
26058         `MonoGenericMethod *'.
26060 2004-03-25  Martin Baulig  <martin@ximian.com>
26062         * loader.h (MonoMethodInflated): Store the MonoGenericContext
26063         instead of the MonoGenericMethod here.
26065 2004-03-25  Martin Baulig  <martin@ximian.com>
26067         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
26068         each time we create a new MonoGenericInst, we also create a new
26069         context which points back to us.
26071         * class.c (inflate_method): Use `ginst->context' instead of
26072         creating a new context.
26074         * loader.c (method_from_memberref): Use
26075         `klass->generic_inst->context' instead of creating a new context.
26077 2004-03-25  Martin Baulig  <martin@ximian.com>
26079         * class.h (MonoGenericContext): New struct.
26080         (MonoGenericMethod): Removed `generic_inst'.
26082         * class.c (mono_class_inflate_generic_method): Take a
26083         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
26085 2004-03-25  Martin Baulig  <martin@ximian.com>
26087         * loader.h (MonoMethodInflated): New typedef.
26089         * metadata.h (MonoMethodSignature): Removed `gen_method', make
26090         `generic_param_count' consume just 30 bits, added `is_inflated'
26091         and `has_type_parameters' flags (one bit each).
26093         * class.c (mono_class_inflate_generic_method): Create a
26094         MonoMethodInflated instead of a MonoMethodNormal and set
26095         `is_inflated' in the method signature.
26097         * class.h (MonoGenericMethod): Removed `generic_method'.
26099 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
26101         * image.c: Make sure the name of a MonoImage is always an absolute path.
26102           This fixes bug #54415.
26104 2004-03-24  Martin Baulig  <martin@ximian.com>
26106         * class.c (mono_class_setup_vtable): If we're a generic instance,
26107         use our generic type's vtable size.
26109 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
26111         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
26112         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
26113         problems.
26115 2004-03-23  Martin Baulig  <martin@ximian.com>
26117         * class.h (MonoDynamicGenericInst): Added `int count_events' and
26118         `MonoEvent *events'.
26120         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
26121         (typebuilder_icalls): Added "get_event_info"; calls
26122         mono_reflection_event_builder_get_event_info(). 
26124         * reflection.c (mono_reflection_generic_inst_initialize): Added
26125         `MonoArray *events'.
26126         (mono_reflection_event_builder_get_event_info): New function.
26128 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
26130         * object.h: add mono_type_initialization_init
26132         * object.c (mono_runtime_class_init): 
26133         implement class constructor synchronization rules
26134         to cope with threading issues.  
26135         add mono_type_initialization_init
26137         * appdomain.c (mono_runtime_init): call 
26138         mono_type_initialization_init
26140         * class.h: removing initializing field from MonoVTable
26142 2004-03-23  Martin Baulig  <martin@ximian.com>
26144         * class.c (my_mono_class_from_generic_parameter): Use
26145         `param->name' if it's not NULL. 
26147 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
26149         * class.c: do not insert non-virtual methods in the vtable.
26150         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
26151         that means the method is non-virtual. This never would have
26152         happened before.
26154 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
26156         * profiler.c: Added lock for accessing coverage_hash.
26158 2004-03-22  Martin Baulig  <martin@ximian.com>
26160         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
26161         `method->method->signature->generic_param_count != 0' to make it
26162         work for interface methods.
26164 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26166         * process.c: quote the string passed to the shell using g_shell_quote.
26168 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26170         * threads.c:
26171         (mono_threads_manage): don't remove the finalizer thread and self
26172         from the threads hash table so that mono_thread_manage can be called
26173         more than once.
26175 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26177         * process.c: quote the arguments when UseShellExecute is true. Fixes
26178         bug #55790.
26180 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26182         * threads.c: set mono_thread_detach as a cleanup routine for every
26183         thread. This way it's always executed upon thread termination, either
26184         aborted or finished normally. No more xsp hangs!
26186 2004-03-17  Martin Baulig  <martin@ximian.com>
26188         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
26189         `int count_nested' and a `MonoType **nested'.
26191         * reflection.c (mono_reflection_bind_generic_parameters): Moved
26192         most of the functionality into a new static
26193         do_mono_reflection_bind_generic_parameters() and don't take a
26194         `MonoType *nested_in' argument any more.  Don't compute nested
26195         types here.
26196         (mono_reflection_generic_inst_get_nested_types): New public method
26197         to get nested types.
26199         * class.c (mono_class_create_generic): Set `klass->nested_in' if
26200         we're a nested class.
26202         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
26203         mono_reflection_generic_inst_get_nested_types() to compute the
26204         nested types.
26206 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
26208         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
26209         descriptive error message under windows.
26210         
26211 2004-03-17  Martin Baulig  <martin@ximian.com>
26213         * class.c (dup_type): Added `const MonoType *original' argument;
26214         copy the attrs from the original type.
26216 2004-03-17  Martin Baulig  <martin@ximian.com>
26218         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
26219         `m->generic_inst_cache' here.
26221 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
26223         * exception.h exception.c: Add stack_overflow_exception.
26225 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26227         * threadpool.c:
26228         (overlapped_callback): call SetEvent *after* invoking the callback.
26229         No need to call CloseHandle.
26231 2004-03-16  Martin Baulig  <martin@ximian.com>
26233         * reflection.c (mono_image_get_fieldref_token): Take a
26234         `MonoReflectionField *' instead of a `MonoClassField *' and a
26235         `MonoClass *'; store the `MonoReflectionField *' in the hash.
26237 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26239         * appdomain.c: don't add the culture to the filename we're looking for
26240         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
26242 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26244         * locales.c: don't ignore symbols when doing case insensitive compares.
26245         Thanks Dick! Fixes bug #54046.
26247         * threads.c: surround 'threads' usage with enter/leave in
26248         mono_thread_manage.
26250 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
26252         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
26253         implicitly marshalled as [Out]. Fixes #55450.
26255         (mono_marshal_get_runtime_invoke): Zero out the result if there is
26256         an exception.
26258 2004-03-16  Martin Baulig  <martin@ximian.com>
26260         * class.c (mono_class_from_generic_parameter): Use the actual
26261         parameter name. 
26263 2004-03-16  Martin Baulig  <martin@ximian.com>
26265         * reflection.c (type_get_signature_size): New static function.
26266         Compues the size of the type in a method signature.
26267         (method_get_signature_size): New static function; calls
26268         type_get_signature_size() to compute the actual size of the
26269         method's signature.
26270         (method_encode_signature): Use method_get_signature_size() to get
26271         the signature's size rather than using `nparams * 10'.
26273 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26275         * file-io.h: define here WapiOverlapped on windows. I don't want the
26276         regular OVERLAPPED one.
26278         * file-io.c:
26279         * threadpool.c: somehow, BindIoCompletionCallback is not found.
26280         Disabling AIO on windows.
26282 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26284         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
26285         bug #55385.
26287 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26289         * appdomain.c: upgraded corlib version.
26291         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
26292         and BeginWrite. Allow opening files for asynchrnous operations.
26294         * file-io.h: new struct that maps FileStreamAsyncResult.
26295         * icall.c: added new icalls.
26296         * process.[ch]: support setting child process environment variables
26297         and use the SHELL or COMSPEC when UseShellExecute is true.
26299         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
26300         callback for async. IO is here and also BindHandle.
26302         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
26303         from here.
26305 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
26307         * reflection.c (create_custom_attr): Allow len == 0.
26309         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
26310         computation on big-endian machines.
26312 2004-03-13  Martin Baulig  <martin@ximian.com>
26314         * class.h (MonoGenericInst): Added `int count_ifaces'.
26316         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
26317         `ginst->count_ifaces' instead `klass->interface_count' since we
26318         may get called before the vtable is created.
26320         * loader.c (mono_method_get_param_names): If we're a generic
26321         instance, return and don't initialize the class.
26323         * reflection.c (mono_reflection_setup_generic_class): Don't call
26324         ensure_runtime_vtable().
26325         (mono_reflection_bind_generic_parameters): Set
26326         `ginst->count_ifaces'.
26328 2004-03-11  Jackson Harper <jackson@ximian.com>
26330         * icall.c:
26331         * unicode.c:
26332         * unicode.h: Remove unused System.Char icalls.
26333         
26334 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
26336         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
26337         code when we P/Invoke the first library in Windows.Forms, instead
26338         of when we first open the assembly.
26340         * assembly.c: Drop the lookup from here.
26342 2004-03-10  Martin Baulig  <martin@ximian.com>
26344         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
26345         class for properties, fields and events.  Finally fixes #54945.
26347 2004-03-10  Martin Baulig  <martin@ximian.com>
26349         * metadata.c (mono_metadata_class_equal): New static function;
26350         checks whether two generic instances or two generic parameters are
26351         equal.
26352         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
26353         compare classes.        
26355 2004-03-10  Martin Baulig  <martin@ximian.com>
26357         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
26359         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
26360         argument and write it into the `reflection_info' field.
26362         * icall.c
26363         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
26364         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
26366 2004-03-09  Jackson Harper  <jackson@ximian.com>
26368         * char-conversions.h: use 8 bits for numeric data its all we need
26369         * icall.c: numeric data is only 8 bits now.
26371 2004-03-09  Martin Baulig  <martin@ximian.com>
26373         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
26375         * class.c (init_properties, init_events): Initialize the new
26376         `parent' field.
26378         * reflection.c (typebuilder_setup_properties): Likewise.
26379         (typebuilder_setup_events): Likewise.
26381         * reflection.h (MonoEventInfo): Replaced `parent with
26382         `declaring_type' and `reflected_type'.
26384         * icall.c (ves_icall_get_property_info): Distinguish between
26385         declaring and reflected type.
26386         (ves_icall_get_event_info): Likewise.
26388 2004-03-09  Martin Baulig  <martin@ximian.com>
26390         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
26391         (ves_icall_Type_GetField): Correctly set field->klass.
26393 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
26395         * loader.h: Fix warning.
26397 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
26399         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
26400         library routine if present.  Notice that it will still continue
26401         executing even if its missing, for those working on the Gtk#
26402         edition of Windows.Forms.
26404         * assembly.c (do_mono_assembly_open): If loading the
26405         System.Windows.Forms call mono_loader_wini_init.
26407 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
26409         * class.h: Added MonoRemoteClass struct.
26410         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
26411         function for MonoStrings.
26412         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
26413         Added internal call for getting the proxy type.
26414         * marshal.c: Get the type of transparent proxies from its remote_class.
26415         Added methods that generate the IL for type checks and casts:
26416         mono_marshal_get_isinst, mono_marshal_get_castclass, 
26417         mono_marshal_get_proxy_cancast.
26418         * marshal.h: Declaration of the previous new methods.
26419         * object.c: Added new moethods for creating and updating MonoRemoteClass
26420         instances: mono_remote_class, mono_upgrade_remote_class, 
26421         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
26422         * verify.c: FIx transparent_proxy_fields layout.
26423         * appdomain.c: Bump corlib version.
26425 2004-03-04  Jackson Harper  <jackson@ximian.com>
26427         * icall.c: Add icall to access char conversion tables.
26428         * char-conversions.h: Character conversion tables.
26429         * Makefile.am: Add char-conversions.h private header file.
26430         
26431 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
26433         * appdomain.c (unload_thread_main): Increase unloading timeout to
26434         10 sec as a temporary workaround for Nant problems.
26436 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
26438         * gc.c: Add checks for GC_enable and GC_disable.
26440         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
26441         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
26442         (bug #54988).
26443         
26444 2004-02-27  Martin Baulig  <martin@ximian.com>
26446         * reflection.c (mono_reflection_bind_generic_parameters): Take a
26447         `MonoReflectionType *' instead of a `MonoType *'.
26449 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
26451         * gc.c (run_finalize): Avoid finalizing the object representing the
26452         finalizer thread.
26453         (finalizer_thread): Fix warning.
26455 2004-02-25  Martin Baulig  <martin@ximian.com>
26457         * class.c (_mono_class_get_instantiation_name): Added `int offset'
26458         argument for nested types.
26459         (mono_class_create_generic): Added support for nested generictypes.
26461         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
26462         `GList *nested'.
26464         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
26466         * reflection.c (method_encode_signature): Increase the minimum
26467         value of `size' from 10 to 11.
26468         (mono_reflection_bind_generic_parameters): Take `int type_argc'
26469         and `MonoType **types' arguments instead of the `MonoArray
26470         *types'; added `MonoType *nested_in'.  Recursively instantiate
26471         nested classes. 
26473 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
26475         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
26476         stack_overflow_ex members which are used by exception handling.
26478         * appdomain.c (mono_runtime_init): Initialize the new members.
26480         * gc.c (mono_gc_enable): New helper function.
26481         * gc.c (mono_gc_disable): New helper function.
26483 2004-02-23  Martin Baulig  <martin@ximian.com>
26485         * icall.c: I must have been really stupid - make it actually work
26486         this time ;-)
26488 2004-02-23  Martin Baulig  <martin@ximian.com>
26490         * loader.c (method_from_memberref): Only inflate the method if
26491         it's in another klass.
26493 2004-02-23  Martin Baulig  <martin@ximian.com>
26495         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
26496         (mono_class_init): If we're a generic instance and an interface,
26497         compute `class->interface_id'; also create `class->interfaces'
26498         here and inflate them.
26500         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
26501         `ginst->is_open'.
26502         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
26504         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
26506 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
26508         * reflection.c (method_encode_code): Improved the error message
26509         generated by the exception.
26511 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26513         * icall.c: Martin did not do what he said in the ChangeLog for
26514         2004-02-18, but put back the changes for properties and events.
26515         Commenting those changes out again and adding comment to bug #54518.
26516         
26517         * process.c: removed warning.
26519 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
26521         * marshal.c (emit_struct_conv): Print an error message instead of
26522         asserting when a type does not have the StructLayout attribute.
26524 2004-02-20  Martin Baulig  <martin@ximian.com>
26526         * reflection.c (mono_type_get_object): Also use the cache for
26527         generic instances.
26528         (mono_reflection_bind_generic_parameters): Always compute
26529         `ginst->ifaces'.        
26531 2004-02-20  Martin Baulig  <martin@ximian.com>
26533         * class.h (MonoGenericMethod): Removed `klass'.
26535         * class.c (mono_class_inflate_generic_method): Added `MonoClass
26536         *klass' argument.
26538 2004-02-20  Martin Baulig  <martin@ximian.com>
26540         * reflection.c (method_encode_methodspec): Actually use the
26541         uninflated signature for the memberref.
26543 2004-02-20  Martin Baulig  <martin@ximian.com>
26545         * class.h (MonoGenericMethod): Removed `declaring'.
26547         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
26548         is NULL, compute it here.
26550 2004-02-20  Martin Baulig  <martin@ximian.com>
26552         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
26554         * metadata.c (mono_metadata_generic_inst_hash): New method.
26555         (mono_metadata_generic_inst_equal): New method.
26557         * reflection.c (mono_reflection_bind_generic_parameters): Use the
26558         `klass->image->generic_inst_cache' cache to avoid creating
26559         duplicate MonoGenericInst's.
26561         * class.c (mono_class_inflate_generic_type): Use the cache.
26563 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
26565         * object.c: fixed gc descriptor calculation for embedded valuetypes.
26567 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26569         * icall.c: added Socket.WSAIoctl icall.
26571         * socket-io.[ch]: implemented
26572         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
26574 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
26576         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
26578 2004-02-18  Urs C Muff  <umuff@quark.com>
26580         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
26581         this work on PPC and other big-endian architectures.
26583         * debug-mono-symfile.h: Prepended the names of all the `guint32'
26584         fields with an underscore to make sure they're only accessed by
26585         the read32() macro.
26587 2004-02-18  Martin Baulig  <martin@ximian.com>
26589         * icall.c: Put the klass->refclass changes back for methods and
26590         fields, but not for properties and events.  We're currently not
26591         distinguishing between DeclaringType and ReflectedType for
26592         properties and events, that's what caused the regressions.
26594 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26596         * object.c:
26597         (mono_async_result_new): the handle can be NULL.
26599         * threadpool.c: Use an event instead of a semaphore, don't initialize
26600         it until needed. This saves quite a few semaphores from being created
26601         when using the threadpool.
26603 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
26605         * object.c (mono_string_is_interned_lookup): Fix interning of long
26606         strings. Fixes #54473.
26608         * domain.c (ldstr_equal): Optimize if the two strings are equal.
26610         * icall.c: Revert the klass->refclass changes since they introduce
26611         regressions (bug #54518).
26613 2004-02-18  Martin Baulig  <martin@ximian.com>
26615         * class.c (mono_class_init): If we're a generic instance and don't
26616         come from a TypeBuilder, inflate our members here.
26617         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
26618         (mono_class_create_generic): New public method.
26619         (mono_class_initialize_generic): Removed.
26620         (get_instantiation_name): Renamed to
26621         _mono_class_get_instantiation_name() and made it public.
26623 2004-02-18  Martin Baulig  <martin@ximian.com>
26625         * class.c (mono_class_inflate_generic_type): Clear the new
26626         instance's `nginst->klass' when inflating a generic instance.
26627         (mono_class_is_subclass_of): Added (basic) support for generic
26628         instances.
26630 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
26632         * appdomain.h, domain.c: use a MonoCodeManager instead of a
26633         MonoMempool to hold compiled native code.
26635 2004-02-17  Martin Baulig  <martin@ximian.com>
26637         * class.h (MonoDynamicGenericInst): Added `count_properties' and
26638         `properties'.
26640         * reflection.c (mono_reflection_generic_inst_initialize): Added
26641         `MonoArray *properties' argument.
26643         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
26645 2004-02-17  Martin Baulig  <martin@ximian.com>
26647         * icall.c (ves_icall_Type_GetFields): Renamed to
26648         ves_icall_Type_GetFields_internal() and added a
26649         `MonoReflectionType *rtype' argument; pass it to
26650         mono_field_get_object() to set the field's "reflected" type.
26651         (ves_icall_Type_GetConstructors): Likewise.
26652         (ves_icall_Type_GetEvents): Likewise.
26653         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
26654         argument; pass it to mono_method_get_object() to set the method's
26655         "reflected" type.       
26657 2004-02-17  Martin Baulig  <martin@ximian.com>
26659         * class.h (MonoDynamicGenericInst): New type.
26660         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
26662         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
26663         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
26664         (ves_icall_MonoGenericInst_GetFields): New interncall.
26666         * class.c (mono_class_from_generic): Don't call
26667         mono_class_initialize_generic() if this is a dynamic instance;
26668         ie. it's being created from a TypeBuilder.
26669         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
26670         `class->byval_arg.type'.
26672         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
26673         to `inflate_method' and made static.
26674         (mono_reflection_inflate_field): Removed.
26675         (mono_reflection_generic_inst_initialize): New public method.
26677         * reflection.h (MonoReflectionGenericInst): Removed `methods',
26678         `ctors' and `fields'; added `initialized'.
26680 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
26682         * debug-helpers.c (mono_method_full_name): Fix output for empty
26683         namespaces.
26685 2004-02-12  Martin Baulig  <martin@ximian.com>
26687         * class.h (MonoClassField): Added `MonoType *generic_type'.
26689         * reflection.c (mono_image_get_fieldref_token): Added support for
26690         instantiated generic types.
26691         (field_encode_inflated_field): Removed.
26692         (mono_image_get_inflated_field_token): Removed.
26693         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
26695         * reflection.h (MonoReflectionInflatedField): Removed.
26697 2004-02-12  Martin Baulig  <martin@ximian.com>
26699         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
26700         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
26702         * reflection.c (mono_image_get_methodspec_token): Take a
26703         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
26704         (mono_image_create_token): Check whether we have a
26705         `method->signature->gen_method' and call
26706         mono_image_get_methodspec_token() if appropriate.
26707         (inflated_method_get_object): Removed.
26708         (mono_reflection_bind_generic_method_parameters): Return a
26709         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
26710         (mono_reflection_inflate_method_or_ctor): Likewise.
26712         * reflection.h (MonoReflectionInflatedMethod): Removed.
26714 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
26716         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
26717         for custom valuetype marshalling.
26719         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
26721 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26723         * icall.c: fixed WSAGetLastError_internal name.
26725 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
26727         * threads.c (mono_thread_attach): Allow this to be called multiple
26728         times for a thread.
26729         
26730         * threads.c (build_wait_tids): Do not wait for ourselves.
26732         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
26733         appdomain list is empty.
26735         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
26736         memory returned by mono_string_builder_to_utf16, since it points into
26737         managed memory. Thanks to Bernie Solomon for noticing this.
26739         * icall.c: Add AppDomainSetup icalls.
26741         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
26743         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
26744         types.
26746         * reflection.c (reflection_methodbuilder_to_mono_method): Save
26747         custom attributes to the method_aux struct. Also fix array indexes etc.
26749         * loader.c (mono_method_get_param_names): Make dynamic case work again.
26750         
26751 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
26753         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
26754         (both static and runtime) and reduce startup time.
26756 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
26758         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
26759         AsAny marshalling conversion instead of crashing.
26761         * marshal.c: Fix warnings.
26763 2004-02-09  Martin Baulig  <martin@ximian.com>
26765         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
26767         * reflection.h (MonoReflectionInflatedMethod): Removed the
26768         `declaring' field, it's now in the unmanaged MonoGenericMethod.
26770         * reflection.c (method_encode_methodspec): Removed the `method'
26771         argument; we get it from `gmethod->declaring'.
26772         (inflated_method_get_object): Removed the `declaring' argument.
26774 2004-02-09  Martin Baulig  <martin@ximian.com>
26776         * class.h (MonoGenericMethod): New type.
26777         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
26778         `generic_method'.
26780         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
26781         a `MonoGenericMethod *gen_method' one.
26783         * class.c (mono_class_inflate_generic_type): Take an additional
26784         `MonoGenericMethod * argument.  This is only non-NULL if we're
26785         inflating types for a generic method.   
26786         (mono_class_inflate_generic_signature): Renamed to
26787         inflate_generic_signature() and made static; take a
26788         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
26789         (inflate_generic_header): Take a `MonoGenericMethod *' argument
26790         instead of a `MonoGenericInst *' one.
26791         (mono_class_inflate_generic_method): Likewise.
26793         * reflection.c (encode_generic_method_sig): Take a
26794         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
26795         (method_encode_methodspec): Likewise.
26796         (inflated_method_get_object): Likewise. 
26798         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
26799         field with a `MonoGenericMethod *gmethod' one.  
26801 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
26803         * class.h (mono_class_has_parent): add parens to expansion
26804         so you can ! this.
26806 2004-02-08  Martin Baulig  <martin@ximian.com>
26808         * image.h (MonoImage): Removed `generics_cache'.
26810         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
26811         instead of a `MonoType *' argument; removed the `inflate_methods'
26812         argument.  Don't inflate methods here.
26814         * loader.c (find_method): If it's a generic instance, call
26815         mono_class_init() on the `sclass->generic_inst->generic_type'.
26817         * metadata.c (mono_type_size): Make this work on uninitialized
26818         generic instances; call it on the `ginst->generic_type's class.
26820         * reflection.c (mono_reflection_bind_generic_parameters): Call
26821         mono_class_from_generic() to create the `ginst->klass'.
26823 2004-02-08  Martin Baulig  <martin@ximian.com>
26825         * class.h (MonoClass): Changed type of `generic_inst' from
26826         `MonoType *' to `MonoGenericInst *'.
26828 2004-02-08  Martin Baulig  <martin@ximian.com>
26830         * icall.c (ves_icall_Type_BindGenericParameters): Just call
26831         mono_type_get_object(), this is now creating a `MonoGenericInst'
26832         for MONO_TYPE_GENERICINST.
26833         (ves_icall_MonoGenericInst_GetParentType): Likewise.
26834         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
26836         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
26837         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
26838         (inflated_method_get_object): Added `MonoClass *refclass' argument.
26839         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
26840         and reflected type.
26842         * reflection.h (MonoReflectionInflatedMethod): Removed
26843         `declaring_type' and `reflected_type'.
26845 2004-02-08  Martin Baulig  <martin@ximian.com>
26847         * class.h (MonoGenericInst): Added `MonoType *parent' and
26848         `MonoType **ifaces'.
26850         * reflection.h (MonoReflectionGenericInst): Removed `klass',
26851         `parent' and `interfaces'.
26853         * reflection.c (mono_reflection_bind_generic_parameters): Take a
26854         `MonoType *' argument and return a `MonoType *'.
26856         * icall.c
26857         (ves_icall_MonoGenericInst_GetParentType): New interncall.
26858         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
26860 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
26862         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
26863         valuetype marshalling.
26865 2004-02-06  Martin Baulig  <martin@ximian.com>
26867         * class.c
26868         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
26869         (my_mono_class_from_generic_parameter): Likewise.
26871 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
26873         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
26874         contents of the symbol files lazily.
26876         * object.h (MonoThread): Add 'name' and 'name_len' fields.
26878         * threads.h threads.c icall.c: New icalls for getting and setting the
26879         threads name.
26881 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
26883         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
26884         Raise an exception when the domain is not found.
26886 2004-02-03  Martin Baulig  <martin@ximian.com>
26888         * reflection.c (mono_image_get_methodspec_token): Use the
26889         uninflated signature; fixes gen-33.
26891 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
26893         * gc.c threads.c: Make the finalizer thread a normal managed thread so
26894         the finalizer code can use thread functionality.
26896         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
26897         the finalizer thread.
26899         * threads.c: Make some functions more robust.
26901         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
26903         * metadata.h: Add new marshalling conventions.
26905         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
26906         stringbuilder marshalling. Fixes #53700.
26908         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
26910         * reflection.c (mono_image_get_type_info): Save declarative security
26911         info.
26913         * reflection.c (mono_image_get_field_info): Handle uninitialized 
26914         unmanaged fields as well.
26916         * appdomain.c: Bump corlib version.
26918 2004-02-01  Martin Baulig  <martin@ximian.com>
26920         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
26921         method type arguments.  
26923 2004-01-30  Duncan Mak  <duncan@ximian.com>
26925         * marshal.h: Add prototype for
26926         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
26927         and
26928         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
26929         fix the build.
26931 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
26933         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
26934         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
26936 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
26938         * marshal.c (mono_marshal_get_native_wrapper): Add support for
26939         custom marshalling of valuetypes.
26941         * marshal.c: Fix some warnings.
26943 2004-01-29  Martin Baulig  <martin@ximian.com>
26945         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
26946         for generic method parameters.
26948         * reflection.c (method_encode_methodspec): Write the uninflated
26949         signature into the methodspec table.
26950         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
26951         is always the uninflated method.
26952         (reflection_methodbuilder_to_mono_method): Copy the generic
26953         parameters from the MethodBuilder into `header->gen_params'.
26955 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
26957         * class.c (mono_class_from_generic_parameter): Fix warning.
26959 2004-01-27  Martin Baulig  <martin@ximian.com>
26961         * class.c (mono_class_from_generic_parameter): Don't create
26962         `klass->methods' here.  
26964 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
26966         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
26967         extension since it does not work with libraries named lib<FOO>.dll.so.
26969 2004-01-25  Martin Baulig  <martin@ximian.com>
26971         * class.c (mono_class_inflate_generic_type): Added support for
26972         MONO_TYPE_GENERICINST.
26974         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
26975         inflate methods on open constructed types.      
26977 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26979         * object.c: fire ProcessExit event in the root AppDomain after running
26980         Main. Fixes bug #53299.
26982 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
26984         * socket-io.c: include the new socket-wrappers.h header.
26985         Use the wrappers instead of the unix socket functions to make the code
26986         more clear.
26988 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
26990         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
26992         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
26993         Fixes #22532.
26995 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
26997         * reflection.c (mono_image_create_pefile): Handle the case when the
26998         entry point is not a MethodBuilder.
27000         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
27001         field to ReflectionMethod since it is not allways a builder.
27003         * reflection.c (type_get_fully_qualified_name): New helper function to
27004         return the fully qualified name of a type.
27006         * reflection.c (encode_marshal_blob): Always emit the fully qualified
27007         type name for custom marshallers.
27009         * reflection.c (mono_marshal_spec_from_builder): Ditto.
27011         * class.c (mono_class_setup_vtable): If a parent class already 
27012         implements an interface, use the implementing methods from that class.
27013         Fixes #53148.
27015 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27017         * threadpool.c: just return instead of ExitThread to allow for thread
27018         clean up earlier.
27020 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
27022         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
27023         when closing resource modules.
27025         * reflection.c (mono_image_create_pefile): Handle the case when the
27026         entry point is not a MethodBuilder.
27028         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
27029         field to ReflectionMethod since it is not allways a builder.
27031 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
27033         * marshal.c (mono_marshal_get_managed_wrapper): 
27034         mono_marshal_alloc takes native int so CONV_I
27035         the arg for 64bits.
27037 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
27039         * reflection.c (fixup_cattrs): New function to fixup the methoddef
27040         tokens in the cattr table. Fixes #53108.
27042 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27044         * loader.c: don't trim ".dll" before looking up in the config file.
27045         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
27047 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
27049         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
27050         Return the module which contains the resource as well.
27051         (ves_icall_System_Reflection_Module_Close): New icall.
27053         * appdomain.c: Bump corlib version number.
27055         * image.c (mono_image_addref): New public function.
27057         * assembly.c: Call mono_image_addref.
27059         * reflection.c (mono_module_get_object): Increase reference count of 
27060         the image.
27062         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
27063         Fixes #22532.
27065         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
27066         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
27067         proper exceptions on DllImport problems.
27069 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
27071         * class.c, metadata.c: eliminate CSIZE macro.
27073 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
27075         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
27076         * object.h: Added async_callback field in MonoAsyncResult.
27077         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
27078         * verify.c: Added async_callback in MonoAsyncResult layout.
27080 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
27082         * reflection.c (mono_reflection_get_custom_attrs): Add support
27083         for Modules.
27085 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
27087         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
27088         marshalling.
27089         (mono_marshal_method_from_wrapper): Add null pointer check.
27091 2004-01-16  Martin Baulig  <martin@ximian.com>
27093         * debug-mono-symfile.h: Set version number to 36 and reflect
27094         latest symbol writer changes.
27096 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
27098         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
27099         multi-dimensional arrays.
27100         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
27101         (mono_class_from_mono_type): Use bounded_array_class_get.
27102         
27103         * class.c (mono_bounded_array_class_get): New function which takes
27104         a 'bounded' bool argument to distinguish vectors from one dimensional
27105         arrays.
27107         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
27108         bounded_array_class_get if the array has bounds.
27110         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27111         Search modules loaded using AssemblyBuilder:AddModule as well.
27113 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27115         * appdomain.c: increased corlib version.
27116         * filewatcher.c: removed g_print.
27117         * icall.c:
27118         (get_property_info): only allocate what is actually requested.
27119         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
27121 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27123         * Makefile.am: added filewatcher.[ch]
27124         * filewatcher.[ch]: FileSystemWatcher runtime support.
27125         * icall.c: added new FSW icalls.
27127 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
27129         * string-icalls.c: fix stringbuilder regression as suggested by
27130         Iain McCoy <iain@mccoy.id.au>.
27132 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
27134         * process.c (process_read_stringtable_block): Recognize '007f' as
27135         a language neutral stringtable block.
27137 2004-01-12  Patrik Torstensson
27139         * object.h (MonoStringBuilder) : Changed layout to support our
27140         new stringbuilder class.
27141         * marshal.c: Change marshalling to support the new layout of 
27142         string builder.
27143         * appdomain.c: increased version number because new layout of
27144         string builder.
27146 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
27148         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
27149         assembly name as an string instead of an AssemblyName, since it is
27150         easier to extract info from it.
27152         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
27153         the culture subdirectories too. Fixes #52231.
27155 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27157         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
27158         It takes 2 new parameters with an optional name for the method to look
27159         for and case ignoring info.
27161         * threadpool.c: removed unused variable.
27163 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27165         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
27166         It takes 2 new parameters with an optional name for the property to look
27167         for and case ignoring info.
27168         Fixes bug #52753.
27170 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
27172         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
27173         Fix #52451.
27175 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27177         * appdomain.c:
27178         * assembly.c: escape the uri before passing it to g_filename_from_uri.
27179         Fixes bug #52630.
27181 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
27183         * reflection.c: Add support for more than one unmanaged resource.
27185         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
27186         in field->def_value, as done in all other cases.
27188         * reflection.c (mono_reflection_get_custom_attrs): Add support for
27189         TypeBuilders.
27191         * reflection.c (mono_reflection_create_runtime_class): Remove 
27192         errorneous assignment to klass->element_class, since it is already
27193         done in mono_reflection_setup_internal_class.
27195 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27197         * gc.c: added missing LeaveCriticalSection.
27198         * icall.c: indented a couple of lines.
27199         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
27200         if we call EndInvoke inside a callback. Fixes bug #52601.
27202 2004-01-07  Martin Baulig  <martin@ximian.com>
27204         * mono-debug-debugger.h
27205         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
27207 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
27209         * appdomain.c: Use messages in NotImplementedException.
27211         * exception.c (mono_get_exception_not_implemented): Now this takes
27212         a message argument.
27214         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
27215         exception instead of g_asserting an aborting when something is not
27216         implemented.
27218         Add some inline docs.
27220 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
27222         * reflection.h: Update after changes to object layout.
27224         * reflection.c: Implement saving of unmanaged aka win32 resources.
27226         * appdomain.c: Bump version number.
27228         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
27229         Handle missing domains gracefully.
27231 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
27233         * file-io.c : On Windows, there are much more invalid_path_chars.
27235 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
27237         * class.h, object.c: prepare for GetType () speedup.
27239 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
27241         * profiler.c: workaround for --profile null reference exception on
27242           cygwin. Patch by Patrik Torstensson.
27244 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
27246         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
27247         make work for unaligned access.
27249 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
27251         * class.c: small cleanup (class->fields [i] -> field).
27252         * image.c: check address of metadata is valid.
27254 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
27256         * assembly.h assembly.c (mono_assembly_loaded): New public function to
27257         search the list of loaded assemblies.
27259         * reflection.c (mono_reflection_type_from_name): Use 
27260         mono_assembly_loaded instead of mono_image_loaded.
27262         * reflection.c: Fix warnings.
27264 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
27266         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
27267         is dynamic. This is needed since an assembly can contain both dynamic and
27268         non-dynamic images.
27270         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
27271         assembly->dynamic.
27273         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
27275         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
27276         to store modules loaded using AddModule.
27278         * reflection.c (mono_image_fill_file_table): Generalize this so it works
27279         on Modules.
27281         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
27283         * reflection.c (mono_image_fill_export_table_from_module): New function to
27284         fill out the EXPORTEDTYPES table from a module.
27286         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
27287         into a separate function. Also handle loaded non-dynamic modules.
27289         * reflection.c (mono_image_basic_init): Fix memory allocation.
27291         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
27293         * assembly.c (mono_assembly_load_references): Make this public.
27295 2003-12-19  Martin Baulig  <martin@ximian.com>
27297         * class.c (mono_class_initialize_generic): Made this static, take
27298         a `MonoGenericInst *' instead of a `MonoClass *'.
27299         (mono_class_from_generic): Call mono_class_initialize_generic()
27300         unless we're already initialized or being called from
27301         do_mono_metadata_parse_generic_inst().
27303         * class.h (MonoGenericInst): Added `initialized' and
27304         `init_pending' flags.
27306         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
27307         `mono_class_init (gklass)' or mono_class_initialize_generic()
27308         here; set `generic_inst->init_pending' while parsing the
27309         `type_argv'.
27311 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
27313         * locales.c: include string.h for memxxx prototypes
27315 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
27317         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
27318         constructor when accessing literal fields.
27320 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
27322         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
27324         * reflection.c (assembly_add_resource_manifest): New function to fill
27325         the MANIFESTRESOURCE table.
27327         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
27329         * reflection.h: Update to changes in class layout.
27331         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
27332         Reenable call to mono_runtime_is_shutting_down ().
27334         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
27335         determine if the runtime is shutting down.
27337 2003-12-16  Jackson Harper <jackson@ximian.com>
27339         * icall.c: comment out call to mono_runtime_is_shutting_down to
27340         fix build.
27341         
27342 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
27344         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
27345         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
27347 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
27349         * reflection.c: move definition of swap_with_size
27350         to before its first call
27352 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
27354         * appdomain.c (mono_runtime_is_shutting_down): New public function.
27356         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
27357         icall.
27359         * object.c: Fix warnings.
27361         * icall.c (ves_icall_Type_Get...): Only consider inherited static
27362         members if FlattenHierarchy is set.
27364         * reflection.c (mono_image_add_decl_security): New function to emit
27365         declarative security.
27367         * reflection.h reflection.c: Add support for declarative security.
27369         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
27370         
27371 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
27373         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
27374         
27375         * appdomain.c verify.c: Moved corlib version checking into its own
27376         function in appdomain.c since it needs to create vtables etc.
27378 2003-12-13  Patrik Torstensson <p@rxc.se>
27380         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
27381         instead of unwrapped server.
27383 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
27385         * verify.c (check_corlib): Fix field index.
27387 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
27389         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
27390         GetGacPath icall.
27392 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
27394         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
27395         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
27396         cope with sizeof(size_t) != sizeof(guint32).
27398 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27400         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
27401         in case of failure.
27403 2003-12-10  Mark Crichton <crichton@gimp.org>
27405         * icall.c: removed the GetNonZeroBytes.  We now handle this case
27406         in managed code.
27408         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
27410 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
27412         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
27413         marked as deleted.
27415 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
27417         * verify.c (check_corlib): Handle the case when the version field is 
27418         initialized by a static constructor.
27420 2003-12-08  Patrik Torstensson  <p@rxc.se>
27422     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
27424 2003-12-08  Martin Baulig  <martin@ximian.com>
27426         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
27427         a MonoReflectionGenericParameter, also take the parameter index
27428         and name as arguments.
27429         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
27430         (ves_icall_MonoGenericParam_initialize): New interncall.
27431         (ves_icall_Type_make_byref_type): New interncall.
27433         * reflection.h (MonoReflectionGenericParam): Derive from
27434         MonoReflectionType, not just from MonoObject.  Added `refobj' and
27435         `index' fields.
27437         * reflection.c (mono_reflection_define_generic_parameter): Create
27438         and return a new MonoReflectionGenericParam; don't initialize the
27439         constraints here.
27440         (mono_reflection_initialize_generic_parameter): New public method;
27441         initializes the constraints and creates the `param->pklass'.
27443 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
27445         * reflection.h reflection.c: Use the new fields 'num_types', 
27446         'num_fields' and 'num_methods' to track the number of types etc.
27448         * verify.c (check_corlib): Check corlib version number.
27450 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
27452         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
27453         function works on all methods.
27455 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
27457         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
27458         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
27459         the custom_type_info flag of the transparent proxy.
27460         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
27461         objects that supports IRemotingTypeInfo.
27462         * object.h: Added custom_type_info field in transparent proxy.
27464 2003-12-06  Martin Baulig  <martin@ximian.com>
27466         * class.c (mono_class_create_from_generic): Removed.
27467         (mono_class_from_generic): Check `ginst->klass' before doing
27468         anything else.  This is important to fully support "recursive"
27469         generic types.
27471         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
27472         empty `generic_inst->klass' before doing anything else.
27474 2003-12-06  Dick Porter  <dick@ximian.com>
27476         * verify.c: 
27477         * object.h:
27478         * icall.c:
27479         * locales.c: Use C structs to access class fields.  Don't do a
27480         conversion between MonoString and UChar because both are
27481         platform-endian UTF-16.  Compare now takes startindex and count
27482         parameters.  Add a char overload for IndexOf.  Speed up the
27483         invariant string IndexOf.
27485 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
27487         * Makefile.am (monosn_LDADD): Fix parallel build.
27489 2003-12-04  Martin Baulig  <martin@ximian.com>
27491         * icall.c
27492         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
27493         (ves_icall_Type_make_array_type): New interncall.       
27495 2003-12-04  Martin Baulig  <martin@ximian.com>
27497         * locales.c: also change it in the !HAVE_ICU case.
27499 2003-12-04  Dick Porter  <dick@ximian.com>
27501         * icall.c:
27502         * locales.c: construct_compareinfo is now in CompareInfo, not
27503         CultureInfo.
27505 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
27507         * image.c (mono_image_load_file_for_image): Cache loaded images in the
27508         image->files array.
27510         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
27511         table as well.
27513         * assembly.c (mono_assembly_load_references): Only load references
27514         once.
27516         * class.c (mono_class_from_name): Avoid linear search of the 
27517         EXPORTEDTYPE table.
27519         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
27521 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
27523         * image.h (MonoImage): Add 'field_cache' field.
27525         * loader.c (mono_field_from_token): Cache field lookups.
27526         
27527         * reflection.c (mono_module_get_object): Fix name property.
27529         * icall.c (ves_icall_get_enum_info): Update after changes to 
27530         mono_metadata_get_constant_index ().
27532         * icall.c: Get rid of get_type_info icall, use a separate icall for
27533         each type property to avoid needless memory allocations. Fixes #51514.
27535         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
27536         to avoid needless binary searches.
27538         * class.c (class_compute_field_layout): Move the initialization of
27539         field->def_value to mono_class_vtable ().
27541         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
27542         non-corlib types.
27544         * object.c (mono_object_allocate): Make it inline.
27546         * object.c (mono_object_allocate_spec): Make it inline.
27547         
27548 2003-12-02  Dick Porter  <dick@ximian.com>
27550         * locales.c (create_NumberFormat): NumberFormatInfo construction.
27551         Patch by Mohammad DAMT (mdamt@cdl2000.com).
27553 2003-12-01  Dick Porter  <dick@ximian.com>
27555         * threads.c: Fix signature and call in CreateMutex and
27556         CreateEvent.
27558 2003-12-01  Dick Porter  <dick@ximian.com>
27560         * icall.c: 
27561         * locales.c: Implement string compares and searching
27563         * object.h: Add extra Thread field
27565 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
27567         * reflection.c (fixup_method): Add support for MonoCMethod.
27569 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
27571         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
27573         * reflection.c (assembly_name_to_aname): Allow extra characters in
27574         assembly names. Fixes #51468.
27576 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
27578         * exception.c (mono_exception_from_name_domain): New helper function.
27580         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
27581         exception object in the correct domain.
27583         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
27584         formatting + make a copy a the input data.
27586         * loader.c (mono_get_method_from_token): Methods which contain
27587         native code do not have entries in the ImplMap.
27589         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
27590         Thanks to Gonzalo for spotting this.
27591         
27592         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
27593         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
27595         * assembly.h (mono_assembly_load_from): Split the second part of 
27596         assembly loading into a new public function.
27598         * exception.h (mono_get_exception_bad_image_format): New function.
27600 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
27602         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27603         Enumerate all modules inside a dynamic assembly. Fixes #51293.
27604         
27605         * icall.c: Add new icall for creating dynamic methods.
27607         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
27609         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
27611         * reflection.c (mono_reflection_create_dynamic_method): New icall to
27612         create a dynamic method.
27614         * reflection.c (resolve_object): New helper function.
27616         * reflection.c: Generalize ReflectionMethodBuilder and the functions
27617         which manipulate it so they can also work on dynamic methods.
27619         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
27620         creating the MonoReflectionMethodAux structure if it is not needed.
27621         
27622         * reflection.h verify.c: Update after changes to object layout.
27624         * reflection.c (method_builder_encode_signature): Fix compilation on
27625         gcc 2.95.x.
27627 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
27629         * appdomain.h: Added support for context static fields. Added static_data
27630           field to MonoAppContext and renamed thread_static_fields to a more
27631           generic special_static_fields in MonoAppDomain, since it can now contain
27632           context static fields.
27633         * domain.c: Updated hashtable name.
27634         * object.c: Replaced field_is_thread_static() for a more generic
27635           field_is_special_static() which also checks for context static attribute.
27636           In mono_class_vtable(), added support for static context fields.
27637         * threads.c: Changed methods that manage thread static fields to more
27638           generic methods so they can be reused both for thread and context static
27639           data.
27640         * threads.h: Declared some new methods.
27642 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
27644         * reflection.h: Update after changes to the managed types.
27646         * reflection.c (encode_custom_modifiers): New helper function.
27648         * reflection.c (method_encode_signature): Emit custom modifiers.
27650         * reflection.c (field_encode_signature): Emit custom modifiers.
27652 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
27654         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
27656         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
27657         implementation.
27659         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
27660         icall.
27662         * object.c (mono_field_get_value_object): New function.
27664         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
27665         specific.
27667 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
27669         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
27670         return a preallocated out-of-memory exception instance.
27672         * object.c (out_of_memory): Use the new function.
27674         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
27675         flag is before the custom modifiers. Fixes #49802.
27677 2003-11-16  Martin Baulig  <martin@ximian.com>
27679         * class.c (mono_class_is_open_constructed_type): Implemented the
27680         MONO_TYPE_GENERICINST case.
27682 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
27684         * assembly.c (mono_assembly_fill_assembly_name): New function to
27685         fill out the MonoAssemblyName structure.
27686         (mono_assembly_open): Use the new function.
27688         * icall.c (fill_reflection_assembly_name): New helper function.
27690         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
27691         new function.
27693         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
27695 2003-11-15  Martin Baulig  <martin@ximian.com>
27697         * class.c (mono_class_is_open_constructed_type): New public
27698         function; checks whether a type is an open constructed type,
27699         ie. whether it still contains type parameters.
27700         (mono_class_inflate_generic_type): If we're a type parameter and
27701         the inflated type is also a MONO_TYPE_(M)VAR, return the original
27702         type.
27704         * class.h (MonoGenericInst): Added `guint32 is_open'.
27706         * loader.c (method_from_methodspec): Check whether we're an open
27707         or closed constructed type and set `ginst->is_open'.
27709         * reflection.c (mono_reflection_bind_generic_parameters): Check
27710         whether we're an open or closed constructed type and set
27711         `ginst->is_open'.
27712         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
27713         from open constructed types.
27715 2003-11-15  Martin Baulig  <martin@ximian.com>
27717         * reflection.c (mono_reflection_bind_generic_parameters): If we're
27718         a generic instance (instead of a generic type declaration) with
27719         unbound generic parameters, bind them to our actual types.
27721 2003-11-14  Martin Baulig  <martin@ximian.com>
27723         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
27725         * reflection.c (mono_reflection_bind_generic_parameters): If we're
27726         an interface type, populate `res->interfaces' with instantiated
27727         versions of all the interfaces we inherit.
27729 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
27731         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
27732         when MONO_PATH is set but doesn't contain the install dir.
27734 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27736         * icall.c:
27737         (ves_icall_Type_GetInterfaces): don't return an interface twice when
27738         it's also implemented in base classes. Fixes bug #50927.
27740 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
27742         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
27743         if this method is called from a finalizer. Fixes #50913.
27745 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
27747         * threads.c: Implement VolatileRead/VolatileWrite
27749         * icall.c: Add new icalls for VolatileRead/VolatileWrite
27751 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
27753         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
27754         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
27755         2.95.3.
27757         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
27758         from Peter Ross (pro@missioncriticalit.com).
27759         
27760 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
27762         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
27764 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
27766         * assembly.c (mono_assembly_load_references): Disable check because it
27767         triggers on older corlibs which lots of people have.
27769 2003-11-12  Jackson Harper  <jackson@ximian.com>
27771         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
27772         load corlib.dll if mscorlib.dll is not found.
27773         * assembly.h: Remove corlib name define.
27774         * class.c:
27775         * domain.c:
27776         * image.c: Change corlib name to mscorlib.
27777         
27778 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
27780         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
27782 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
27784         * appdomain.h: Added loader_optimization here to sync with the C#
27785         code, and add disallow_binding_redirects field.
27787 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
27789         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
27791         * reflection.c (mono_image_build_metadata): Fix crash on modules
27792         with no types.
27794         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
27796         * icall.c (ves_icall_get_method_info): Return callingConvention as
27797         well.
27799         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
27800         namespaces from the EXPORTEDTYPE table as well.
27802         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
27803         from all modules inside the assembly.
27804         
27805 2003-11-11  Martin Baulig  <martin@ximian.com>
27807         * reflection.c (mono_reflection_bind_generic_parameters): Make
27808         this work for interfaces.
27810 2003-11-11  Martin Baulig  <martin@ximian.com>
27812         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
27814 2003-11-11  Martin Baulig  <martin@ximian.com>
27816         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
27817         "MonoInflatedMethod" and "MonoInflatedCtor".
27819 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
27821         * reflection.c (resolution_scope_from_image): Use the assembly table
27822         from the manifest module, since other modules don't have it.
27824         * debug-helpers.c (mono_type_full_name): New helper function.
27826         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
27828         * image.c (mono_image_load_file_for_image): New public function which
27829         is a replacement for the load_file_for_image in class.c.
27831         * assembly.c (mono_assembly_load_module): A wrapper for the function
27832         above which does assembly association and reference loading too.
27834         * class.c (mono_class_from_name): Call mono_assembly_load_module.
27836 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27838         * appdomain.c: not all of the attributes for the full assembly name
27839         are required and the order doesn't matter. Fixes bug #50787.
27841 2003-11-10  Dick Porter  <dick@ximian.com>
27843         * locales.c: Use platform-endian UTF16
27845 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
27847         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
27848         
27849 2003-11-10  Martin Baulig  <martin@ximian.com>
27851         * metadata.c
27852         (mono_metadata_load_generic_params): Make this actually work.
27854         * reflection.c (mono_reflection_bind_generic_parameters): If our
27855         parent is a generic instance, pass all the `types' to it, no
27856         matter whether it has the same number of type parameters or not.
27858 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
27860         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
27862         * assembly.c (mono_assembly_load_references): Move the image<->assembly
27863         assignment code to this function so it gets called recursively for all
27864         modules.
27866         * image.c (load_modules): Remove the assembly assignment since it is
27867         now done by mono_assembly_load_references.
27868         
27869         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27870         Add 'module' argument.
27871         (mono_module_get_types): New helper function.
27872         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
27874 2003-11-08  Martin Baulig  <martin@ximian.com>
27876         * class.c (mono_class_inflate_generic_method): Interface method
27877         don't have a header.
27879         * reflection.c (mono_image_get_methodspec_token): Take an
27880         additional `MonoGenericInst *' argument instead of reading it from
27881         the header; this is necessary to support interfaces.
27882         (mono_image_create_token): Pass the `MonoGenericInst *' from the
27883         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
27884         (inflated_method_get_object): Take an additional `MonoGenericInst *'
27885         argument.
27887         * reflection.h (MonoReflectionInflatedMethod): Added
27888         `MonoGenericInst *ginst'.
27890 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
27892         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
27894 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
27896         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
27898 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
27900         * reflection.c 
27901         (reflection_methodbuilder_from_method_builder):
27902         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
27903         initialize a ReflectionMethodBuilder structure.
27904         (mono_image_get_methodbuilder_token):
27905         (mono_image_get_ctorbuilder_token): New functions to emit memberref
27906         tokens which point to types in another module inside the same assembly.
27908         * reflection.c: Use the new helper functions.
27909         
27910         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
27912         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
27913         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
27915         * reflection.c (resolution_scope_from_image): Emit a moduleref if
27916         neccesary.
27918         * reflection.c (mono_image_build_metadata): Emit metadata only for the
27919         current module. Emit the manifest only for the main module.
27921         * reflection.c (mono_image_create_token): Add assertion when a 
27922         memberref needs to be created.
27924         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
27926         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
27927         larger buffer for the custom attribute blob. Fixes #50637.
27928         
27929 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27931         * threadpool.c: notify listener on async processing handles after
27932         invoking the async callback. Thanks to Zoltan.
27934 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27936         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
27937         avoid code duplication.
27939         * reflection.h (MonoDynamicImage): New type which is currently unused,
27940         but will be used through the ref.emit code in place of 
27941         MonoDynamicAssembly.
27943         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
27944         object layout.
27946         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
27947         a MonoDynamicImage instead of just a MonoImage.
27948         
27949         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
27950         icalls to ModuleBuilder but keep their semantics, so they will work
27951         with moduleb->assemblyb. This will change later.
27952         
27953 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27955         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
27956         object layout.
27958         * reflection.c (mono_image_build_metadata): Avoid creation of a default
27959         main module, since it is now done by the managed code.
27961 2003-11-03  Martin Baulig  <martin@ximian.com>
27963         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
27964         `ginst->klass' here.
27965         (method_encode_methodspec): Don't use the `ginst->generic_method's
27966         klass if it's a generic instance, use `ginst->klass' in this case.
27968 2003-11-03  Martin Baulig  <martin@ximian.com>
27970         * reflection.c (mono_image_get_generic_method_param_info):
27971         Removed, use mono_image_get_generic_param_info() instead.
27972         (mono_image_get_type_info): Write the GenericParam table before
27973         the Method table.  This is neccessary because in the GenericParam
27974         table, type parameters of the class (ie. '!0' etc.) must come
27975         before the ones from its generic methods (ie. '!!0' etc).
27977 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27979         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
27981 2003-11-02  Martin Baulig  <martin@ximian.com>
27983         * reflection.c (create_generic_typespec): Take a
27984         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
27985         the generic parameters from it.
27987 2003-11-02  Martin Baulig  <martin@ximian.com>
27989         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
27990         instead of a `MonoClassField *' since we just need the type.
27991         (create_generic_typespec): New static function.  Creates a
27992         TypeSpec token for a generic type declaration.
27993         (mono_image_get_generic_field_token): New static function.
27994         (mono_image_create_token): If we're a FieldBuilder in a generic
27995         type declaration, call mono_image_get_generic_field_token() to get
27996         the token.
27998 2003-11-02  Martin Baulig  <martin@ximian.com>
28000         * reflection.h
28001         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
28002         `MonoReflectionGenericInst *declaring_type' and
28003         `MonoReflectionGenericInst *reflected_type' fields.
28005         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
28006         `MonoReflectionGenericInst *declaring_type' and a
28007         `MonoReflectionGenericInst *reflected_type' argument instead of a
28008         single `MonoReflectionGenericInst *type' one.  Set
28009         `res->declaring_type' and `res->reflected_type' from them.
28010         (mono_reflection_inflate_field): Likewise.      
28012 2003-11-02  Martin Baulig  <martin@ximian.com>
28014         * class.c (mono_class_setup_vtable): Don't store generic methods
28015         in the vtable.  
28017 2003-11-02  Martin Baulig  <martin@ximian.com>
28019         * reflection.h (MonoReflectionGenericInst): Added
28020         `MonoReflectionType *declaring_type'.
28022         * reflection.c (mono_reflection_bind_generic_parameters): Use
28023         `if (tb->parent)' instead of `klass->parent'.
28025 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
28027         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
28028         with an empty ASSEMBLY table.
28030         * reflection.c (mono_image_build_metadata): Avoid using the same loop
28031         variable in the inner and outer loops.
28033 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
28035         * metadata.h (mono_metadata_make_token): Put parentheses around macro
28036         argument.
28038         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
28039         
28040         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
28041         icalls. Instead, do everything in managed code. This is needed since
28042         it is hard to restore the original domain etc. in unmanaged code in the
28043         presence of undeniable exceptions.
28045         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
28046         New icalls to push and pop appdomain refs.
28048 2003-10-31  Martin Baulig  <martin@ximian.com>
28050         * class.c (inflate_generic_type): Renamed to
28051         mono_class_inflate_generic_type() and made it public.
28053         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
28054         New interncall.
28056         * loader.c (mono_field_from_memberref): Also set the retklass for
28057         typespecs.
28059         * fielder.c (mono_image_get_inflated_field_token): New static
28060         method; creates a metadata token for an inflated field.
28061         (mono_image_create_token, fixup_method): Added support for
28062         "MonoInflatedField".
28063         (fieldbuilder_to_mono_class_field): New static function.
28064         (mono_reflection_inflate_field): New public function.
28066         * reflection.h
28067         (MonoReflectionGenericInst): Added `MonoArray *fields'.
28068         (MonoReflectionInflatedField): New typedef.     
28070 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
28072         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
28073         for Solaris and other platforms without s6_addr16
28075 2003-10-30  Martin Baulig  <martin@ximian.com>
28077         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
28078         argument instead of two.
28079         (mono_class_inflate_generic_signature): Likewise.
28080         (inflate_generic_header): Likewise.
28081         (mono_class_inflate_generic_method): Likewise.  In addition, if
28082         `ginst->klass' is set, it becomes the new `method->klass'.
28084         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
28085         field.
28087         * reflection.c (encode_generic_method_sig): Write a 0xa as the
28088         first byte. [FIXME]
28089         (method_encode_methodspec): If we have generic parameters, create
28090         a MethodSpec instead of a MethodRef.
28091         (fixup_method): Added support for "MonoInflatedMethod" and
28092         "MonoInflatedCtor".
28093         (mono_image_create_token): Added support for "MonoInflatedMethod"
28094         and "MonoInflatedCtor".
28095         (inflated_method_get_object): New static function; returns a
28096         managed "System.Reflection.MonoInflatedMethod" object.
28097         (mono_reflection_bind_generic_method_parameters): Return a
28098         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
28099         (mono_reflection_inflate_method_or_ctor): Likewise.
28100         (mono_image_get_generic_method_param_info): Initialize unused
28101         fields to zero.
28102         (mono_image_get_generic_param_info): Likewise.
28104         * reflection.h (MonoReflectionInflatedMethod): New public
28105         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
28106         "S.R.MonoInflatedCtor" classes.
28108         * loader.c (method_from_memberref): If we're a TypeSpec and it
28109         resolves to a generic instance, inflate the method.
28111 2003-10-28  Dick Porter  <dick@ximian.com>
28113         * object.c (mono_runtime_run_main): Convert command-line arguments
28114         into utf8, falling back to the user's locale encoding to do so.
28116 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
28118         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
28119         at this time.
28121         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
28123         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
28124         up icalls at method definition time. Partially fixes #33569.
28126 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
28128         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
28129         marshalling of arrays. Fixes #50116.
28131         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
28133         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
28134         points to a vtable in the dying appdomain.
28136         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
28137         listeners into unmanaged code inside the lock.
28139         * object.c (mono_class_vtable): Turn off typed allocation in non-root
28140         domains and add some comments.
28142 2003-10-25  Martin Baulig  <martin@ximian.com>
28144         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
28146         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
28148         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
28149         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
28150         currently parsing.  Create the generic class and store it in
28151         `generic_inst->klass' before parsing the type arguments.  This is
28152         required to support "recursive" definitions; see mcs/tests/gen-23.cs
28153         for an example.
28154         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
28155         to support recursive typespec entries.
28157         * class.c (mono_class_setup_parent): If our parent is a generic
28158         instance, we may get called before it has its name set.
28159         (mono_class_from_generic): Splitted into
28160         mono_class_create_from_generic() and mono_class_initialize_generic().
28162 2003-10-25  Martin Baulig  <martin@ximian.com>
28164         * icall.c (ves_icall_Type_BindGenericParameters): Return a
28165         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
28166         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
28167         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
28169         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
28170         (create_typespec): Likewise.
28171         (mono_reflection_bind_generic_parameters): Return a
28172         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
28173         (mono_reflection_inflate_method_or_ctor): New public function.
28175         * reflection.h (MonoReflectionGenericInst): New typedef.        
28177 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
28179         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
28180         inside the domain lock. Fixes #49993.
28181         
28182         * object.c (mono_class_vtable): When typed allocation is used, 
28183         allocate vtables in the GC heap instead of in the mempool, since the
28184         vtables contain GC descriptors which are used by the collector even
28185         after the domain owning the mempool is unloaded.
28187         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
28189         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
28190         reflect what it does. Also invalidate mempools instead of freeing
28191         them if a define is set.
28193         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
28194         of the appdomain.
28195         
28196         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
28197         hold the finalizable objects in this domain.
28199         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
28200         appdomain.
28202         * appdomain.c (mono_domain_set): New function to set the current
28203         appdomain, but only if it is not being unloaded.
28205         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
28206         appdomain which is being unloaded.
28207         
28208         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
28209         unloading of the root appdomain.
28211         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
28212         icall to execute a method in another appdomain. Intended as a 
28213         replacement for InternalSetDomain, which can confuse the code 
28214         generation in the JIT.
28216         * appdomain.c (mono_domain_is_unloading): New function to determine
28217         whenever an appdomain is unloading.
28219         * appdomain.c (mono_domain_unload): New function to correctly unload
28220         an appdomain.
28222         * assembly.c (mono_assembly_load_references): Check that an assembly
28223         does not references itself.
28225         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
28226         domain manually, it asks the finalizer thread to do it, then waits for
28227         the result. Also added a timeout.
28229         * icall.c: Register the new icalls.
28231         * threads.h threads.c: Export the mono_gc_stop_world and 
28232         mono_gc_start_world functions.
28233         
28234         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
28235         function to fill out the mempool with 0x2a.
28237 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
28239         * reflection.h (MonoReflectionMethodAux): New structure to store
28240         information which is rarely used, thus is not in the MonoMethod
28241         structure.
28243         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
28244         store the aux info.
28246         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
28247         and marshalling info into the aux structure.
28249         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
28250         from the aux structure.
28252         * loader.c (mono_method_get_param_names): Retrieve the param names from
28253         the aux structure.
28254         
28255 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
28257         * exception.h exception.c: Add AppDomainUnloadedException && fix 
28258         warning.
28260 2003-10-21  Dick Porter  <dick@ximian.com>
28262         * socket-io.c
28263         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
28264         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
28266 2003-10-21  Martin Baulig  <martin@ximian.com>
28268         * reflection.c (mono_reflection_bind_generic_parameters):
28269         `klass->parent' is NULL for interfaces.
28271 2003-10-21  Martin Baulig  <martin@ximian.com>
28273         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28275 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
28277         * exception.c (mono_exception_from_name_msg): New helper function for
28278         creating exceptions and initializing their message field.
28280         * exception.c: Simplify functions using the new helper.
28282         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
28283         New function.
28285         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
28286         mono_raise_exception, since otherwise gcc doesn't generate the function
28287         epilog for raise_exception, confusing the stack unwinding in the JIT.
28288         Fixes #45043.
28290         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
28291         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
28292         Fixes #49499.
28294 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28296         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
28297         utf8.
28299 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
28301         * icall.c: Removed GetUninitializedObject method because
28302           AllocateUninitializedClassInstance does the same.
28304 2003-10-18  Martin Baulig  <martin@ximian.com>
28306         * class.c (inflate_generic_signature): Renamed to
28307         mono_class_inflate_generic_signature() and made it public.
28308         (my_mono_class_from_generic_parameter): New static function; if we
28309         don't already have the generic parameter's MonoClass, create a
28310         very simple one which is just used internally in the runtime and
28311         not passed back to managed code.
28313         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
28315         * metadata.h (MonoMethodSignature): Moved the
28316         `MonoGenericParam *gen_params' to the MonoMethodHeader.
28317         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
28319         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
28320         ves_icall_MonoMethod_GetGenericArguments(); this is now an
28321         interncall on the MonoMethod class, not on MethodInfo.
28322         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
28323         calling mono_reflection_bind_generic_method_parameters() directly.
28325         * loader.c (mono_method_get_signature): If this is a MethodSpec;
28326         return the already computed `method->signature'.
28327         (method_from_methodspec): New static function to load a method
28328         from a MethodSpec entry.
28329         (mono_get_method_from_token): Call the new method_from_methodspec()
28330         for MethodSpec tokens.  
28331         (mono_get_method_from_token): If we're a generic method, load the
28332         type parameters.
28334         * reflection.c (mono_image_get_memberref_token): Allow
28335         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
28336         table.
28337         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
28338         (mono_image_create_token): First check whether it's a generic
28339         method (so we'd need to create a MethodSpec), then do the other
28340         two alternatives.
28341         (mono_reflection_bind_generic_method_parameters): Return a
28342         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
28343         called directly from the interncall.
28345 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
28347         * reflection.c (load_public_key): Move loading of the public key
28348         into managed code.
28350         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
28352         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
28353         fields.
28355         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
28356         culture, hash_alg and public_key. Fixes #49555.
28358 2003-10-17  Martin Baulig  <martin@ximian.com>
28360         * class.h (MonoGenericInst): Moved this declaration here and added
28361         `MonoMethod *generic_method'.
28363         * icall.c
28364         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
28365         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
28367         * metadata.c (mono_metadata_type_equal): Two types of
28368         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
28369         index; ie. don't compare the address of the `MonoGenericParam'
28370         structure.
28371         (mono_metadata_load_generic_params): Removed the `MonoMethod
28372         *method' argument.
28374         * metadata.h (MonoGenericInst): Moved declaration to class.h.
28375         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
28377         * reflection.c (method_encode_signature): Encode the number of
28378         generic parameters.
28379         (encode_generic_method_sig): New static function.
28380         (method_encode_methodspec): New static function; creates an entry
28381         in the MethodSpec table for a generic method.
28382         (mono_image_get_methodspec_token): New static function.
28383         (mono_image_create_token): Call mono_image_get_methodspec_token()
28384         for generic methods.
28385         (mono_reflection_bind_generic_method_parameters): New public
28386         function.  Instantiates a generic method.
28388 2003-10-16  Martin Baulig  <martin@ximian.com>
28390         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
28391         *gen_params' here from MonoMethodHeader.
28393         * metadata.c (mono_metadata_parse_method_signature): If we have
28394         generic parameters, initialize `method->gen_params' and then set
28395         the correct `type->data.generic_param' in all the parameters.
28397 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
28399         * threads.c (mono_threads_get_default_stacksize): New function to 
28400         return the default stacksize.
28402         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
28403         termination of the finalizer thread, since the previous method had
28404         race conditions. Fixes #49628.
28406         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
28407         as for the other managed threads.
28409 2003-10-16  Martin Baulig  <martin@ximian.com>
28411         * class.c (inflate_generic_signature): Copy `generic_param_count'
28412         and `gen_params'.
28414         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
28415         New interncall.
28417         * metadata.c (mono_metadata_parse_method_signature): Actually set
28418         the `method->generic_param_count' here.
28419         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
28421 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
28423         * object.h: Add a new field to TypedRef to simplify the implementation
28424         of the REFANY opcodes in the JIT.
28426         * icall.c: Make use of the new field.
28428         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
28429         dynamically.
28431 2003-10-15  Martin Baulig  <martin@ximian.com>
28433         * class.c (mono_class_from_gen_param): Renamed to
28434         mono_class_from_generic_parameter() and moved most of the
28435         functionality from mono_reflection_define_generic_parameter()
28436         here; ie. we create a "real" class here.
28437         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
28438         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
28439         previously been called.
28441         * class.h (MonoGenericParam): Moved the declaration of this struct
28442         here from metadata.h and added `MonoMethod *method'.
28444         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
28445         interncall.
28447         * loader.c (mono_get_method_from_token): If we have any generic
28448         parameters, call mono_metadata_load_generic_params() to read them
28449         from the MONO_TABLE_GENERICPAR.
28451         * metadata.c (mono_metadata_load_generic_params): Added
28452         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
28454         * metadata.h (MonoMethodSignature): Replaced
28455         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
28456         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
28458         * reflection.c (mono_reflection_define_generic_parameter): Moved
28459         most of the functionality into the new
28460         mono_class_from_generic_parameter(); set the `method' field if
28461         we're a method parameter.       
28463 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
28465         * marshal.c (emit_struct_conv): if native size is 0
28466         emit no code.
28468 2003-10-14  Martin Baulig  <martin@ximian.com>
28470         * icall.c: The generics API has changed in the spec since it was
28471         added to System.Type; these modifications make it match the spec
28472         again.
28473         (ves_icall_Type_GetGenericParameters): Renamed to
28474         `ves_icall_Type_GetGenericArguments'.
28475         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
28476         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
28477         `ves_icall_MonoType_get_HasGenericArguments'.
28478         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
28479         `ves_icall_MonoType_get_IsGenericParameter'.
28480         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
28481         this is no interncall anymore.
28482         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
28483         `ves_icall_TypeBuilder_get_IsGenericParameter'.
28485 2003-10-14  Martin Baulig  <martin@ximian.com>
28487         * reflection.c (mono_reflection_bind_generic_parameters): Also
28488         inflate generic methods if we're reading the class from IL.
28490 2003-10-13  Martin Baulig  <martin@ximian.com>
28492         * reflection.c (mono_reflection_define_generic_parameter): This
28493         method isn't called directly from the icall anymore; take a
28494         `MonoReflectionAssemblyBuilder *' so we can use this for type and
28495         method generic parameters.
28496         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
28497         (method_builder_encode_signature): Encode generic parameters.
28498         (mono_image_get_method_info): Write generic params to the
28499         MONO_TABLE_GENERICPARAM table.
28501         * reflection.h (MonoReflectionMethodBuilder): Added
28502         `MonoArray *generic_params'.
28504         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
28506         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
28507         wrapper for mono_reflection_define_generic_parameter().
28508         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
28510 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
28512         * marshal.h: Add missing function to fix build.
28514         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
28515         the SetLastError pinvoke attribute.
28517         * marshal.c (mono_marshal_set_last_error): New helper function called
28518         by the generated code.
28519         
28520         * marshal.c (mono_mb_emit_branch): New helper function.
28522         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
28524         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
28525         classes as parameters and return values of delegates. Fixes #29256. 
28527 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
28529         * locales.c: use gint32 in non HAVE_ICU case
28531 2003-10-11  Martin Baulig  <martin@ximian.com>
28533         * mono-debug.c (mono_debug_add_method): Added a workaround for
28534         bug #48591.
28536 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
28538         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
28539         delegates passed to native code must use the STDCALL calling 
28540         convention. Fixes #35987.
28542 2003-10-10  Martin Baulig  <martin@ximian.com>
28544         * class.c (inflate_generic_type): If we're inflating for a generic
28545         type instance (and not for a generic method), return
28546         MONO_TYPE_MVAR unchanged.
28548 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28550         * string-icalls.c: Join ignores null strings in the source array.
28551         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
28552         * threads.c: GetAvailableTheads is slightly more accurate.
28554 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
28556         * threads.h threads.c : add mono_threads_set_default_stacksize
28557         and pass default to CreateThread calls.
28559 2003-10-09  Dick Porter  <dick@ximian.com>
28561         * icall.c:
28562         * locales.h:
28563         * locales.c: Internal calls for constructing CultureInfo and
28564         related objects from libicu (if its available.)
28566 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
28568         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
28570 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28572         * threadpool.c: added an argument to async_invoke_thread that is the
28573         item to process, pass the MonoAsyncResult to the thread start function
28574         when creating a new thread. This way we don't need to acquire any lock
28575         when we're creating a new thread. Readded a semaphore for faster
28576         response times (instead of that Sleep i added).
28578 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
28580         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
28581         get daylight change dates better on Windows, fix handling
28582         of platforms without tm_gmtoff.
28584 2003-10-06  Martin Baulig  <martin@ximian.com>
28586         * class.c (inflate_generic_method): Renamed to
28587         mono_class_inflate_generic_method() and made public.
28588         (mono_class_init): Don't inflate the generic methods here.
28589         (mono_class_from_generic): Added `gboolean inflate_methods'
28590         argument.  Inflate the methods here.
28592         * loader.c (mono_method_get_param_names): Ignore instances of
28593         generic types for the moment.
28595         * reflection.c (fixup_method): Added support for inflated methods.
28596         (mono_image_create_token): Use mono_image_get_methodref_token()
28597         for inflated methods.
28598         (mono_custom_attrs_from_param): Ignore instances of generic types
28599         for the moment.
28600         (mono_reflection_bind_generic_parameters): New public function.
28601         Moved all the functionality from
28602         ves_icall_Type_BindGenericParameters() here and added support for
28603         dynamic types.
28604         (mono_reflection_define_generic_parameter): Initialize
28605         `klass->methods' here.
28607         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
28608         functionality into mono_reflection_define_generic_parameter().
28609         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
28610         TypeBuilder, return that TypeBuilder.
28612 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28614         * appdomain.c: removed mono_delegate_semaphore.
28616         * threadpool.c:
28617         (mono_thread_pool_add): moved hash table creation inside and the thread 
28618         creation outside of the critical region.
28619         (mono_thread_pool_finish): removed obsolete code.
28620         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
28621         continue or exit the thread depending on the queue.
28623 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
28625         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
28626         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
28627         handle more bool marshalling options
28629 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
28631         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
28632         arrays of structs. Also add a more descriptive error message when
28633         a structure member is marshalled as LPArray.
28635 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
28637         * marshal.c (mono_marshal_get_native_wrapper): Add support for
28638         marshalling arrays of complex types. Fixes #29098. Also remove an
28639         usused and incomplete function.
28641 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
28643         * gc.c: report heap_size - free_bytes as total memory allocated
28644         (bug#49362).
28646 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
28648         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
28649         fix timezone handling problems on Windows.
28650         
28651         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
28652         asserts when the year is outside the range handled by ms the functions.
28654         * class.c (setup_interface_offsets): If the class is an interface,
28655         fill out its interface_offsets slot.
28657 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28659         * threadpool.c: mark threadpool threads as background.
28661 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
28663         * decimal.c - define DECINLINE to nothing if not using GCC
28665 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
28667         * assembly.c: More refcount fixes.
28669 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28671         * string-icalls.c: if we're not trimming, return the same string.
28672         When not splitting, don't create a new string.
28674 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28676         * image.c:
28677         (mono_image_open): increment the ref_count inside the critical section.
28679 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
28681         * image.c (mono_image_open): Fix reference counting bug.
28683 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
28685         * marshal.c (mono_marshal_type_size) struct alignment changed for 
28686         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
28687         64bits. Avoid leak in mono_marshal_get_native_wrapper when
28688         mono_lookup_pinvoke_call throws.        
28690 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
28692         * reflection.c (mono_reflection_parse_type): Fix #49114.
28694         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
28695         temporary workaround for cygwin header problem.
28697         * object.c (mono_object_isinst): Synchronize this with the code
28698         generated by the JIT for casts.
28700 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
28702         * reflection.c (encode_type): Fix #38332.
28704 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
28706         * marshal.c (mono_marshal_method_from_wrapper): New function to return
28707         the original method from the wrapper method.
28709 2003-09-25  Martin Baulig  <martin@ximian.com>
28711         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
28712         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
28713         (ves_icall_Type_get_IsGenericInstance): New interncall.
28715 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
28717         * object.c: fix cast warning in big endian code.
28719 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
28721         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
28722         
28723 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28725         * assembly.c: don't call check_env from mono_assembly_load. It's
28726         already done once in mono_assemblies_init and may cause headaches when
28727         multiple threads are loading assemblies.
28729 2003-09-19  Martin Baulig  <martin@ximian.com>
28731         * reflection.c (mono_reflection_define_generic_parameter): Don't
28732         allocate `klass->methods', set `klass->flags' to
28733         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
28735 2003-09-18  Martin Baulig  <martin@ximian.com>
28737         * class.c (mono_class_init): Don't create `class->methods' if it's
28738         already initialized.
28740         * metadata.c (mono_metadata_load_generic_params): Make this
28741         actually work.
28743         * reflection.c (mono_reflection_define_generic_parameter): Set
28744         parent class and interfaces from the constraints.
28746         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
28747         to keep this struct in sync with the declaration in TypeBuilder.cs.
28749 2003-09-17  Martin Baulig  <martin@ximian.com>
28751         * metadata.h (MonoType): Replaced the data's `int type_param'
28752         field with `MonoGenericParam *generic_param'.
28753         (MonoGenericParam): Added `MonoClass *klass'.
28755         * class.c (mono_class_from_gen_param): Removed the
28756         `MonoImage *image' and `int type_num' arguments.
28758         * metadata.c (mono_metadata_parse_generic_param): New static
28759         method; creates a MonoGenericParam which just contains the index.
28760         (do_mono_metadata_parse_type): Call
28761         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
28762         MONO_TYPE_MVAR.
28764         * reflection.c (mono_image_typedef_or_ref): Generic type
28765         parameters may be in the same assembly, but never use a typedef
28766         for them.
28767         (mono_reflection_define_generic_parameter): We're now creating a
28768         "real" class for the type parameter; it's now safe to call
28769         mono_class_from_mono_type() on the class'es type, it'll do the
28770         right thing.
28772 2003-09-16  Martin Baulig  <martin@ximian.com>
28774         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
28775         `symfile->range_entry_size' and `symfile->class_entry_size' here;
28776         the `symfile' data structure must be fully initialized before it
28777         gets added to the table.
28779 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
28781         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
28783         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
28784         class init trampolines.
28786 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
28788         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
28789         to the built-in profiler to turn off time and allocation profiling
28790         respectively.
28792 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
28794         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
28795         g_direct_equal.
28797         * debug-helpers.c (mono_method_full_name): Print the wrapper type
28798         in human readable form.
28800 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
28802         * reflection.c icall.c: Fixed warnings.
28804         * image.c (load_class_names): Use a temporary hash table to hold the
28805         namespaces in order to avoid doing many string comparisons.
28807         * image.h: Fix typo.
28809         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
28810         Pass NULL instead of g_direct_equal to the GHashTable constructor 
28811         since the NULL case is short-circuited inside g_hash_table_lookup, 
28812         leading to better performance.  
28814         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
28815         obtain the first custom attribute for a given index. Depends on the
28816         CustomAttribute table being sorted by the parent field.
28818         * reflection.c (mono_custom_attrs_from_index): Use the new function 
28819         for better performance.
28821 2003-09-07  Martin Baulig  <martin@ximian.com>
28823         * class.c (mono_class_init): If we're a generic instance, inflate
28824         all our methods instead of loading them from the image.
28825         (mono_class_from_generic): Set `class->methods = gklass->methods'.
28827 2003-09-07  Martin Baulig  <martin@ximian.com>
28829         * mono-debug-debugger.c: Added support for constructors.
28831 2003-09-06  Martin Baulig  <martin@ximian.com>
28833         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
28834         New interncall.
28836         * reflection.c (mono_reflection_setup_generic_class): Call
28837         ensure_runtime_vtable() to create the vtable.
28839 2003-09-05  Martin Baulig  <martin@ximian.com>
28841         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
28842         MONO_TYPE_MVAR.
28844 2003-09-04  Martin Baulig  <martin@ximian.com>
28846         * reflection.c (mono_reflection_define_generic_parameter): Generic
28847         parameters start with zero.
28849 2003-09-04  Martin Baulig  <martin@ximian.com>
28851         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28853         * reflection.h (MonoReflectionGenericParam): New typedef.
28854         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
28855         the generic parameters from the managed TypeBuilder.
28857         * reflection.c (mono_reflection_define_generic_parameter): New function.
28858         (mono_reflection_create_runtime_class): Encode generic parameters.
28859         (mono_reflection_setup_generic_class): New function; this is
28860         called after adding adding all generic params to the TypeBuilder.
28861         (encode_type): Added MONO_TYPE_VAR.
28863 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
28865         * class.h class.c (mono_class_needs_cctor_run): Moved this method
28866         here from the JIT.
28868         * assembly.h assembly.c: Moved the AOT loading code into an assembly
28869         load hook.
28871 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
28873         * reflection.h reflection.c class.h class.c: Delete duplicate 
28874         definition of mono_type_get_name () from reflection.c and export the
28875         one in class.c.
28877         * class.c: Class loading fixes from Bernie Solomon 
28878         (bernard@ugsolutions.com).
28880         * reflection.c: Endianness fixes from Bernie Solomon 
28881         (bernard@ugsolutions.com).
28882         
28883 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
28885         * assembly.h assembly.c: Define a file format version for AOT
28886         libraries.
28887         
28888         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
28890         * appdomain.h (MonoJitInfo): New field to determine whenever the
28891         code is domain neutral.
28892         
28893 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
28895         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
28897 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
28899         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
28900         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
28901         Avoid caching the result since strings must be domain specific. Fixes
28902         #48050.
28904 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
28906         * marshal.c (mono_marshal_init): Make this callable multiple times
28907         since it is hard to find a correct place to call it.
28909         * object.c (mono_runtime_class_init): Execute static constructors in
28910         the correct appdomain.
28912         * image.c (build_guid_table): Handle the case when multiple images have
28913         the same GUID.
28915 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28917         * icall.c: added a couple of icalls for System.Web.
28919 2003-08-28  Martin Baulig  <martin@ximian.com>
28921         * icall.c (ves_icall_Type_BindGenericParameters): Use
28922         `klass->generic_inst' instead of `&klass->byval_arg' in the
28923         mono_type_get_object() call.  The returned type must be
28924         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
28926 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
28928         * NOTES: New file.
28930         * object.c (mono_class_proxy_vtable): Make it thread safe.
28932         * pedump.c: Fix warning.
28934         * object.c appdomain.h: Get rid of metadata_section. 
28935         It is no longer needed and it was causing deadlocks with domain->lock.
28937         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
28939 2003-08-26  Martin Baulig  <martin@ximian.com>
28941         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
28943 2003-08-26  Martin Baulig  <martin@ximian.com>
28945         * pedump.c (main): Call mono_metadata_init(),
28946         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
28947         and mono_loader_init().
28949 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
28951         * loader.h: Add missing include to fix build.
28953         * image.h: mono_image_load_references is no more.
28955         * assembly.c: Reworked assembly loading to make it really thread safe.
28956         After these changes, the assembly returned by mono_assembly_open is
28957         fully initialized, i.e. all its references assemblies are loaded.
28959         * assembly.c (mono_image_load_references): Renamed to 
28960         mono_assembly_load_references, and made private, since clients no
28961         longer need to call it.
28963         * class.c: Removed calls to mono_assembly_load_references, since it was
28964         a source of deadlocks.
28966         * loader.h loader.c class.h class.c: Protect data structures using a 
28967         new lock, the loader lock.
28969         * class.c (mono_class_setup_vtable): Create temporary hash tables and
28970         GPtrArrays only when needed.
28972         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
28973         into empty structures by mcs. Fixes pinvoke7.cs.
28974         
28975         * domain.c (mono_init): Call a new initialization function.
28977         * appdomain.c (mono_runtime_init): Call the new initializer function
28978         of the marshal module.
28980         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
28981         inserted into empty structures by mcs. Fixes pinvoke7.cs.
28983         * marshal.h marshal.c: Added locks around the wrapper caches to make
28984         this module thread safe.
28986         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
28987         this argument. Fixes pinvoke1.exe.
28989 2003-08-25  Lluis Sanchez <lluis@ximian.com>
28991         * object.h: Added call_type field to MonoMethodMessage and the corresponding
28992         enumeration of values. Removed fields to store remote call output values in
28993         MonoAsyncResult. Not needed any more.
28994         * object.c: Initialize call_type and async_result fields in mono_message_init.
28995         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
28996         dispatching the message.
28997         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
28998         async call to finish. To do it use a message with EndInvoke call type.
29000 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
29002         * loader.h loader.c (mono_method_hash_marhal_info): New function which
29003         determines whenever a method has marshalling info.
29005 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29007         * assembly.c: fix the build on windows.
29009 2003-08-22 Lluis Sanchez <lluis@ximian.com>
29011         * object.cs: Fixed bug #47785.
29013 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
29015         * string-icalls.c (StringReplace): If their are no occurances of
29016         the old string found return a reference to the supplied
29017         string. This saves some memory and matches MS behavoir.
29018         
29019 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29021         * socket-io.c: fixed compilation for systems that define AF_INET6
29022         and don't define SOL_IP/SOL_IPV6.
29024 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
29026         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
29027         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
29029         * rawbuffer.c rawbuffer.h: Make this module thread safe.
29031         * domain.c: Make this module thread safe.
29033         * domain.c (mono_init): Call new initialization function.
29035         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
29036         reference types too. Fixes #38812.
29038         * image.c (mono_image_init): Fixed warnings.
29040         * class.c (mono_class_from_typeref): Handle assembly load failure
29041         correctly.
29043         * appdomain.c (add_assemblies_to_domain): Handle the case when
29044         the references of an assembly are not yet loaded.
29046         * metadata.c image.c assembly.c: Moved initialization of global
29047         variables to a separate function called at startup since lazy 
29048         initialization of these variables is not thread safe.
29049         
29050         * image.c assembly.c: Made this module thread safe by adding locks in 
29051         the appropriate places.
29053         * domain.c (mono_init): Call the new initialization functions of the
29054         three modules.
29056 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
29058         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
29059           make a direct call. It is proxy's work to make the call asynchronous.
29060           mono_delegate_end_invoke(): If the targe is a proxy, just collect
29061           the return values.
29062         * object.cs: mono_method_call_message_new(): read AsyncResult and
29063           state object from parameters list, if this info is requested.
29064         * object.h: Added fields to store remote call output values in
29065           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
29067 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29069         * object.h: add needed fields to MonoThread.
29070         * threads.c, threads.h: allow registering a function to cleanup data
29071         allocated per thread by the JIT.
29073 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29075         * loader.h: portability fix by Bernie Solomon
29076         * <bernard@ugsolutions.com>.
29078 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
29080         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
29081         return a MonoArray. This simplifies the code and also ensures that
29082         the cache allways contains an object reference as a value.
29084         * icall.c (ves_icall_get_parameter_info): Simplified using the new
29085         function.
29087 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29089         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
29090         fixes a problem with byte ordering when getting the address family for
29091         a socket.
29093 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
29095         * .cvsignore: Added monosn.
29097         * reflection.h reflection.c loader.c: Added support for parameter
29098         marshalling to dynamically created types. Fixes #47295.
29100 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
29102         * rand.c: remove useless warnings.
29104 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
29106         * class.c: implemented ldtoken for methods and fieldrefs.
29108 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29110         * threadpool.c: when mono_async_invoke was called, no one took care of
29111         monitoring the queue. So if the method invoked took some time and we
29112         got new async invoke requests after 500 ms (the thread created waited
29113         that long in WaitForSingleObject), the new async invoke was not called
29114         until the previous one finished.
29116         This is fixed now. Thanks to Totte for helping with it.
29118 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29120         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
29122 2003-08-11  Martin Baulig  <martin@ximian.com>
29124         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
29126 2003-08-06  Martin Baulig  <martin@ximian.com>
29128         * mono-debug-debugger.c: Added support for static fields,
29129         properties and methods.
29131 2003-08-06  Martin Baulig  <martin@ximian.com>
29133         * mono-debug-debugger.c: Don't store the MonoString's vtable to
29134         make this work for applications with multiple application domains.
29136 2003-08-04  Martin Baulig  <martin@ximian.com>
29138         * mono-debug-debugger.c: Completely reworked the type support; the
29139         most important thing is that we're now just using one single
29140         `MonoType' instance per type.
29142 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
29144         * mono-endian.h, mono-endian.c, icall.c: Added icall
29145         ves_icall_System_Double_AssertEndianity to assert double word endianity
29146         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
29148 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29150         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
29151         support, icalls and fixes.
29153 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
29155         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
29156         classes that are a punctuation character in .NET is not the same a
29157         g_unichar_ispunct.
29159 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29161         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
29163 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
29165         * icall.c: Add new MemCopy internalcall.
29166         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
29167         Simplified code; It is not necessary to handle all the cases here,
29168         as the C# code takes care of it.  Only handle the case of the name
29169         resource embedded into the assembly.
29171         Changed signature to return the data pointer and the size of the
29172         data. 
29174 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
29176         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
29177         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
29179 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
29181         * socket-io.c: ignore EINTR error in select.
29183 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
29185         * class.h, class.c: removed unused subclasses field in MonoClass.
29187 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
29189         * icall.c: improve fix of get_base_definition(). If the parent class
29190           doesn't have the mehod, look at the parent of the parent.
29191         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
29192           to check if a parameter is an in or out parameter
29193           (PARAM_ATTRIBUTE_IN is not set by default).
29194           mono_method_return_message_restore(): Use mono_class_value_size to
29195           get the size of a value type. mono_type_stack_size (parameterType)
29196           does not return the correct value if parameterType is byRef.
29197           mono_load_remote_field(), mono_load_remote_field_new(),
29198           mono_store_remote_field(), mono_store_remote_field_new():
29199           raise exception if the remote call returns an exception.
29201 2003-07-28  Martin Baulig  <martin@ximian.com>
29203         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
29204         method.  This is a wrapper around mono_runtime_invoke() which
29205         boxes the instance object if neccessary.
29207 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29209         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
29210         metadata.h, row-indexes.h, verify.c: first cut of generics support.
29212 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29214         * icall.c: disable mcs bug workaround.
29216 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
29218         * object.c (mono_runtime_class_init): Take the metadata_section
29219         mutex before obtaining the domain mutex.
29221         * appdomain.h: Added definition of metadata_section mutex here. 
29223         * object.c: define metadata_mutex here.
29225 2003-07-24  Ravi Pratap  <ravi@ximian.com>
29227         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
29228         fixed.
29230 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
29232         * reflection.c: Fix bug #46669
29234 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29236         * exception.c:
29237         * exception.h:
29238         * icall.c:
29239         * object.h: fill in the type name for TypeLoadException.
29241 2003-07-23  Ravi Pratap  <ravi@ximian.com>
29243         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
29244         relationship between TypeBuilders while compiling corlib) and bug
29245         45993 (Array types returned from the runtime while compiling
29246         corlib were from the loaded corlib).
29248 2003-07-22  Martin Baulig  <martin@ximian.com>
29250         * mono-debug-debugger.c: Reworked the type support a bit more;
29251         distinguish between types and classes.
29253 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
29255         * icall.c: add IsArrayImpl icall.
29257 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
29259         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
29260         initializing real_size only once. Also fix bug #46602.
29262 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
29264         * object.c: Renamed mono_metadata_section to metadata_section.
29266 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
29268         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
29269           empty array if the type is an array. Fixed.
29270           ves_icall_MonoMethod_get_base_definition: if the base method
29271           is abstract, get the MethodInfo from the list of methods of
29272           the class.
29273         * reflection.c: ParameterInfo.PositionImpl should be zero-based
29274           and it was 1-based. Fixed in mono_param_get_objects.
29276 2003-07-20  Martin Baulig  <martin@ximian.com>
29278         * mono-debug.h: Set version number to 31.
29279         (mono_debug_init): Added `MonoDomain *' argument.
29281         * mono-debug-debugger.c: Reworked the type support; explicitly
29282         tell the debugger about builtin types; pass the `klass' address to
29283         the debugger.
29285 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
29287         * image.c: Allow new metadata tables to be loaded without a
29288         warning. Also update the warning message to give the new constant value.
29289                 
29290 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
29292         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
29293         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
29294         array type representation changes.
29296 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
29298         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
29299         on Environment.Exit () call.
29301 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
29303         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
29304         requires a matching corlib.
29306 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
29308         * Changelog: My editor decided to add a CR to each line. Sorry about that.
29309           Committed again without the CRs.
29310         
29311 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
29313         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
29314           getting it from the "this" socket instance. Did not work
29315           if the socket is a subclass of Socket.
29316           Also fixed bug #35371.
29318 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
29320         * metadata.c: fixed size for TypedByRef.
29321         * loader.c: when searching for a method, consider the vararg amrker.
29322         * unicode.c, decimal.c: constify some arrays.
29324 2003-07-15  Dick Porter  <dick@ximian.com>
29326         * socket-io.c: Fixed compilation for gcc < 3.2.
29328         Fixed compilation for machines that don't have AF_INET6 (thanks to
29329         Bernie Solomon <bernard@ugsolutions.com> for that part.)
29331         Fixed compile warnings.
29332         
29333         Fixed formatting and line endings.
29335 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
29337         * socket-io.h:
29338         * socket-io.c: Added IPv6 support.
29340 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
29342         * class.c (mono_class_is_assignable_from): New function to implement
29343         the is_assignable_from logic. Used by mono_object_isinst, 
29344         Type::IsAssignableFrom () and the interpreter.
29346         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
29347         Object, even interfaces.
29348         
29349         * object.c (mono_object_isinst): Implement in terms of 
29350         is_assignable_from.
29352         * icall.c (ves_icall_type_is_assignable_from): New icall.
29354 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
29356         * domain.c (foreach_domain): fix compiler warning.
29358 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
29360         * image.c (load_metadata_ptrs): use g_strndup because strndup is
29361         not available on all plattforms
29363 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
29365         * image.h image.c: Store the metadata version string in MonoImage.
29366         * icall.c: New icall to retrieve the image version.
29367         * reflection.c (create_dynamic_image): Fill in the image version field
29368         * reflection.c (build_compressed_metadata): Use the image version
29369         from the image structure.
29371 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29373         * appdomain.c: modified comment.
29374         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
29375         That will be its last iteration when mono_gc_cleanup is called from
29376         mono_runtime_cleanup and before the domain is unloaded.
29378         Fixes bug #45962.
29380 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
29382         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
29383         attributes.
29385 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29387         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
29388         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
29389         Bernie Solomon <bernard@ugsolutions.com>.
29391 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
29393         * object.c, object.h: provide mono_object_new_fast() for faster
29394         allocation in some special cases.
29396 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
29398         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
29399         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
29401 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
29403         * threadpool.c: fix leaks.
29405 2003-07-01  Dick Porter  <dick@ximian.com>
29407         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
29408         using MonoGHashTables.  Fixes threadpool bug posted to list.
29410 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
29412         * image.h, image.c: added support to load an assembly from a byte array.
29413         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
29414         assembly bundle support.
29416 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
29418         * threadpool.c (mono_thread_pool_add): keep a reference to the
29419         AsyncResult to prevent GC
29421 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
29423         * class.c: leak fix.
29425 2003-06-25  Dick Porter  <dick@ximian.com>
29427         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
29428         for the async object, the WaitHandle object will close the handle.
29429         Fixes bug 45321.
29431 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
29433         * class.c: in mono_array_class_get (), lookup from the hash with the
29434         same type we insert: this works around a bug in
29435         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
29436         lluis. The real fix will have to wait for after the release.
29438 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
29440         * icall.c: fix memory leak when getting type members.
29442 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
29444         * reflection.c: added more pubtoken special cases.
29446 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
29448         * class.c: handle field offset correctly when class size
29449         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
29451 2003-06-20  Martin Baulig  <martin@ximian.com>
29453         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
29454         *image' field.
29456 2003-06-20  Martin Baulig  <martin@ximian.com>
29458         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
29460 2003-06-20  Martin Baulig  <martin@ximian.com>
29462         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
29463         just distinguish between variables in registers and variables at
29464         an offset relative to a register.
29466 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29468         * icall.c: #ifdef out latest changes until mcs is fixed.
29470 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29472         * icall.c: return members in metadata order.
29474 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
29476         * icall.c: avoid infinite loop in GetTimeZoneData.
29478 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
29480         * icall.c: added Marshal.Prelink/All icalls.
29482 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
29484         * object.c, object.h: fix warnings and do some overflow checking
29485         when creating arrays.
29487 2003-06-17  Dick Porter  <dick@ximian.com>
29489         * file-io.h:
29490         * file-io.c: File attributes need to be tweaked slightly when
29491         passed from the managed to the w32 world.
29493 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
29494         * profiler.h profiler-private.h profiler.c: Rework last patch
29495         based on suggestion by Paolo.
29496         
29497 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
29499         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
29500         instruction level coverage data collection.
29501         * profiler.h profiler.c (: Added new callback function which can be
29502         used by the profiler to limit which functions should have coverage
29503         instrumentation.
29504         * profiler.c (mono_profiler_load): Call g_module_build_path to
29505         generate the file name of the profiler library.
29507 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29509         * profiler.c, profiler.h, profiler-private.h: added basic block 
29510         coverage profiling API.
29512 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
29514         * reflection.c (mono_reflection_create_runtime_class): Add support
29515         for events in dynamically generated code.
29517         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
29518         not allocated.
29520 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
29522         * icall.c: when getting timezone info, return reasonable values if we
29523         can't get the actual data.
29525 2003-06-14  Dick Porter  <dick@ximian.com>
29527         * threads.c (start_wrapper): Remove the reference to the thread
29528         object in the TLS data, so the thread object can be finalized.
29529         This won't be reached if the thread threw an uncaught exception,
29530         so those thread handles will stay referenced :-( (This is due to
29531         missing support for scanning thread-specific data in the Boehm GC
29532         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
29534 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
29536         * reflection.c: ensure streams and tables are first allocated with
29537         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
29539 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29541         * icall.c: fixed GetElementType for byrefs (bug# 44792).
29543 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
29545         * reflection.c (mono_reflection_create_runtime_class): Add support for
29546         properties to dynamically created classes.
29547         * reflection.c: Fix a few places where non-MonoObjects were inserted
29548         into the tokens hashtable.
29550 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
29552         * object.c: some support to handle out of memory exceptions.
29554 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
29556         * marshal.c (mono_marshal_get_native_wrapper): support reference
29557         return types
29559 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
29561         * object.h, object.c: more portability stuff from Bernie Solomon.
29562         Unexport mono_object_allocate(). Added mono_object_unbox ().
29563         Set exitcode when an unhandled exception is thrown.
29565 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
29567         * marshal.c (mono_marshal_get_native_wrapper): use custom
29568         marshaler for return types.
29570 2003-06-10  Dick Porter  <dick@ximian.com>
29572         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
29573         ip_mreq is available
29575 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
29577         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
29578         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
29579         by Bernie Solomon <bernard@ugsolutions.com>.
29581 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
29583         * gc.c (mono_gc_init): Avoid error message on shutdown when
29584         GC_DONT_GC=1 is used.
29586         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
29587         New icall to return the GUID of a module.
29589 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
29591         * class.c: ensure instance size always includes the parent's size
29592         even whem class size is set explicitly (fixes bug#44294).
29594 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
29596         * profiler.h, profiler.c: made the simple profiler thread-safe,
29597         get more accurate timing info. Allow the loading of an
29598         externally-developed profiler module.
29600 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
29602         * marshal.c (mono_marshal_get_native_wrapper): improved
29603         class/byref arguments.
29604         (mono_marshal_get_native_wrapper): better string marshaling support.
29606 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
29608         * class.c: ensure .pack and .size are handled correctly and
29609         simplified layout of static fields.
29611 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
29613         * appdomain.c
29614         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
29616         * loader.c (mono_lookup_pinvoke_call): look for modules in the
29617         current directory (fix bug 44008)
29619 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
29621         * marshal.c (mono_marshal_get_native_wrapper): started support for
29622         custom marshalers.
29623         (mono_delegate_to_ftnptr): consider marshalling specifications
29625 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
29627         * reflection.c, reflection.h: emit custom marshal info.
29629 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29631         * object.c: free the GError.
29632         * icall.c: added CloseEvent_internal.
29633         * threads.[ch]:
29634         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
29635         call.
29637 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
29639         * loader.c (mono_method_get_signature): Add support for dynamic
29640         assemblies.
29642 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
29644         * reflection.c: fixed bug #43905.
29646 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
29648         * class.c, domain.c, icall.c, metadata.h, object.h: support for
29649         handling TypedReference and ArgIterator.
29650         * loader.c, loader.h: added function to get signature at call site.
29652 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
29654         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
29655         data readonly. Buglets and warning fixes. Some MethodSpec support.
29657 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
29659         * class.h, class.c, object.c: remove relative numbering support.
29661 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
29663         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
29664         free the string, until we get a chance to fix Gtk#
29666 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29668         * marshal.c: revert last patch.
29670 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
29672         * icall.c: updates for new mono_class_vtable() not calling
29673         the type constructor anymore.
29675 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
29677         * object.h, object.c: separate vtable creation from type
29678         initialization. Make running the .cctor thread safe.
29680 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
29682         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
29684 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
29686         * loader.c (mono_get_method): consider calling convention
29688 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
29690         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
29691         to return the invisible global type for a module.
29693         * reflection.c (mono_image_build_metadata): Emit global fields too.
29695 2003-05-20  Peter Williams  <peterw@ximian.com>
29697         * loader.c (mono_lookup_internal_call): Add a few newlines.
29699 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
29701         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
29702         literal strings.
29704         * appdomain.c (set_domain_search_path): Recalculate search path when
29705         AppDomainSetup.PrivateBinPath changes.
29707         * object.c (mono_class_compute_gc_descriptor): It turns out some
29708         parts of the class libs (like System.Thread) holds pointers to
29709         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
29710         to treat native int a pointer type here.
29711         
29712 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
29714         * appdomain.h, domain.c: add hashtable for jump target resolution.
29716 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
29718         * reflection.h reflection.c icall.c: Added new icalls 
29719         GetManifestResourceInfoInternal, GetModulesInternal and support
29720         infrastructure.
29722 2003-05-16  Dick Porter  <dick@ximian.com>
29724         * icall.c:
29725         * file-io.h:
29726         * file-io.c: Implement System.IO.MonoIO::GetTempPath
29728 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
29730         * object.c: mono_store_remote_field: little fix to previous patch.
29732 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29734         * class.c: add constructors to array classes.
29735         * icall.c: special case array construction for InternalInvoke (),
29737 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
29739         * class.h class.c reflection.c object.c: Added support for field
29740         defaults in dynamically generated classes.
29742 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
29744         * reflection.c: properly encode charset for ddlimport.
29746 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
29748         * threads.c: allow compiling without GC.
29750 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
29752         * appdomain.h, object.c, object.h, threads.c, threads.h: added
29753         handling of thread static data.
29755 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29757         * reflection.h, reflection.c: added mono_custom_attrs_free ().
29759 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
29761         * class.c (mono_array_class_get): always set the serializable flags
29762         (mono_array_class_get): always set the SEALED attribute for array types
29764 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
29766         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
29767         attributes (fix for bug 42021).
29769 2003-05-12  Dick Porter  <dick@ximian.com>
29771         * gc.c: Don't run finalizers when the finalizer thread is
29772         finishing up, because the default domain has already been
29773         destroyed.
29775 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
29777         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
29778         value is null, we should throw an exception.   This is slightly
29779         different than the other conventions used for the constructor.
29781 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29783         * socket-io.c: fixed windows build.
29785 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29787         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
29789 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
29791         * object.c (mono_string_new_wrapper): Compatibility fix for MS
29792         compilers.
29794 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
29796         * class.c (mono_class_layout_fields): Add experimental GC aware
29797         auto layout facility. Requires class library changes to work correctly.
29799         (mono_class_setup_vtable): Avoid overriding explicit interface
29800         method implementations. Fixes iface3.exe test.
29802         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
29803         object reference.
29804         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
29805         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
29807         * metadata.h: Add new type classification macro which determines
29808         whenever the type holds an object reference.
29810 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
29812         * marshal.c (mono_marshal_get_native_wrapper): cleanups
29814 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
29816         * gc.c (finalizer_thread): Work around a GC bug.
29818 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
29820         * marshal.c (emit_struct_conv): allow unions
29822         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
29824 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
29826         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
29828 2003-05-06  Martin Baulig  <martin@ximian.com>
29830         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
29832 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29834         * socket-io.c:
29835         (Select_internal): allow NULLs, don't create arrays if not needed.
29836         Coupled with Socket.cs changes.
29838         * threadpool.c:
29839         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
29840         register a finalizer for it that will close the semaphore handle. This
29841         fixes the leak and make Lupus' test run with > 4080 loops.
29843 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
29845         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
29846         Jerome Laban (bug #42287)
29848 2003-05-02  Martin Baulig  <martin@ximian.com>
29850         * debug-mono-symfile.h
29851         (MonoSymbolFile): Moved declaration into mono-debug.h.
29852         (MonoDebugMethodJitInfo): Likewise.
29853         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
29854         argument.
29855         (_mono_debug_address_from_il_offset): Take a
29856         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
29858         * mono-debug.h
29859         (MonoDebugDomainData): New struct.
29860         (mono_debug_get_domain_data): New function.
29861         (mono_debug_add_method): Take an additional `MonoDomain *'
29862         argument.
29863         (mono_debug_source_location_from_address): Likewise.
29864         (mono_debug_il_offset_from_address): Likewise.
29865         (mono_debug_address_from_il_offset): Likewise.
29867 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
29869         * reflection.c: one more check for null type in custom attrs.
29871 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29873         * reflection.c: avoid warning (comparison is always false due to limited
29874         range of data type).
29876 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29878         * icall.c: throw an exception in Type.GetField if the argument 'name'
29879         is NULL.
29881 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
29883         * reflection.c: fixed handling of enums in named arguments to custom
29884         attributes (bug #42123).
29886 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
29888         * reflection.c: use the right array element type and handle
29889         a null for a Type argument, too.
29891 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
29893         * reflection.c: handle arrays as arguments to custom attributes.
29895 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
29897         * reflection.c: handle a string value in a custom attr
29898         ctor that takes an object.
29900 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
29902         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
29903         (fix bug #42063)
29905 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
29907         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
29909 2003-04-27  Martin Baulig  <martin@ximian.com>
29911         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
29912         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
29913         MONO_DEBUGGER_EVENT_BREAKPOINT.
29914         (mono_breakpoint_trampoline_code): Removed.
29915         (mono_debugger_event_handler): The last argument is now a
29916         `guint32'.
29917         (mono_debugger_insert_breakpoint_full): Removed the
29918         `use_trampoline' argument.
29919         (mono_debugger_method_has_breakpoint): Likewise.
29920         (mono_debugger_trampoline_breakpoint_callback): Renamed to
29921         mono_debugger_breakpoint_callback(); take the method and
29922         breakpoint number as arguments.
29924 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
29926         * metadata.c: fix off by one when loading parameters attributes.
29928 2003-04-24  Martin Baulig  <martin@ximian.com>
29930         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
29932 2003-04-24  Martin Baulig  <martin@ximian.com>
29934         * mono-debug-debugger.c: Moved all code which interacts with the
29935         Mono Debugger here.
29937         * debug-mono-symfile.c: This code now just deals with the symbol
29938         file itself, the debugger code is now in mono-debug-debugger.c.
29940 2003-04-23  Martin Baulig  <martin@ximian.com>
29942         * mono-debug.c (mono_debug_source_location_from_il_offset):
29943         New method; like mono_debug_source_location_from_address(), but
29944         takes an IL offset instead of a machine address.
29946 2003-04-23  Martin Baulig  <martin@ximian.com>
29948         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
29949         `line' field; this is now computed by the debugger.
29951 2003-04-23  Martin Baulig  <martin@ximian.com>
29953         * mono-debug.[ch]: New files.  This is the new debugging interface.
29955         * mono-debug-debugger.[ch]: New files.  Moved all code which
29956         interacts with the Mono Debugger here.
29958 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
29960         * domain.c (mono_init): initialize mono_defaults.monitor_class
29962 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
29964         * reflection.c (method_encode_code): Add a spicy exception to help
29965         future compiler authors.
29967 2003-04-21  Martin Baulig  <martin@ximian.com>
29969         * icall.c
29970         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
29971         Make this work with relative pathnames; g_filename_to_uri() needs
29972         an absolute filename.
29974 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
29976         * icall.c: Track name changes in Object and ValueType.
29978 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
29980         * metadata.c (mono_type_stack_size): size should be a multiple of
29981         sizeof (gpointer)
29983 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29985         * gc.c:
29986         (internal_domain_finalize): moved into mono_domain_finalize. No need
29987         to create another thread because the finalizers will be run in the
29988         finalizer thread.
29989         
29990         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
29991         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
29992         to be run (MS does this too).
29994 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
29996         * object.c (mono_class_compute_gc_descriptor): Update comment.
29998         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
30000         * image.h: Add synchronized wrapper cache.
30002         * image.c (do_mono_image_open): Initialize cache.
30004         * reflection.c (create_dynamic_mono_image): Initialize cache.
30006 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30008         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
30009         ves_icall_System_Buffer_ByteLengthInternal.
30011 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
30013         * reflection.c: setup klass->nested_in earlier. Allow
30014         a dash in the assembly name.
30016 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
30018         * metadata.c (mono_type_to_unmanaged): dont access
30019         type->data.klass for MONO_TYPE_OBJECT
30020         (mono_type_to_unmanaged): consider System.Delegate class
30022 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
30024         * class.c: just setup supertypes in the proper place instead of
30025         initializing the full element class for arrays.
30027 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
30029         * class.c: ensure the element class of arrays is initialized.
30030         Setup the supertype info for array classes, too.
30032 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
30034         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
30036 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30038         * Makefile.am: re-added -m option when running cygpath. This way,
30039         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
30040         separator.
30041         * mono-config.c: same codepath for locating mono config file for WIN32
30042         and the rest.
30043         * assembly.c: if mono_assembly_setrootdir is called, don't override
30044         the value set.
30046 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30048         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
30049         MONO_ASSEMBLIES variable.
30051 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
30053         * icall.c: added Assembly::GetNamespaces() icall.
30055 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30057         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
30059 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
30061         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
30062         * object.c: fixed bug in the construction of vtable for proxies
30064 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
30066         * object.c (mono_array_new): Mark mono_array_new as an icall.
30068 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30070         * class.c: fixed test for public method when overriding interfaces.
30071         Closes bug #40970.
30073 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
30075         * appdomain.h, domain.c: added mono_domain_foreach() to
30076         be able to access the currently loaded appdomains.
30077         * object.c: make string interning work across sppdomains.
30078         Mark some functions for use as icalls.
30080 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
30082         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
30084         * reflection.h reflection.c: Allocate long living data using 
30085         GC_MALLOC_ATOMIC so the collector does not need to scan it.
30087         * reflection.c: Double the allocation size in streams instead of
30088         increasing it, to prevent unneccesary copying on large assemblies.
30089         
30090         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
30091         creation if the assembly does not have the Run flag set.
30093 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
30095         * class.h: avoid the C++ keywords in header files (Jerome Laban
30096         spotted and fixed this).
30098 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30100         * object.c:
30101         (mono_unhandled_exception): fill in the arguments for the
30102         UnhandledException event. Only trigger that event for the default
30103         domain (as MS does).
30105 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
30107         * object.c: Improve typed allocation stuff based on suggestions from
30108         Paolo. Also turn it on if the GC library supports it.
30110 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
30112         * object.c object.h class.h: Added experimental typed allocation
30113         facility using the interfaces in gc_gcj.h.
30115         * os/gc_wrapper.h: Added new include files.
30116         
30117 2003-04-03  Martin Baulig  <martin@ximian.com>
30119         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
30120         which is not yet enabled by default.
30122         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
30123         functions.
30124         (mono_gc_lock, mono_gc_unlock): New static functions.
30126         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
30127         functions; stop/start the world for the garbage collector.  This
30128         is using the windows API; we need to complete the SuspendThread()/
30129         ResumeThread() implementation in the io-layer to make this work on Unix.
30130         (mono_gc_push_all_stacks): New public function; tells the garbage
30131         collector about the stack pointers from all managed threads.
30133 2003-04-03  Martin Baulig  <martin@ximian.com>
30135         * object.h (MonoThread): Added `gpointer stack_ptr'.
30137         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
30139 2003-04-03  Martin Baulig  <martin@ximian.com>
30141         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
30143 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
30145         * reflection.c (typebuilder_setup_fields): Initialize field.first and
30146         field.last.
30148 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
30150         * loader.c (mono_lookup_internal_call): Report the corlib that is
30151         out of sync.
30153 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
30155         * icall.c (ves_icall_type_GetTypeCode): fixed check for
30156         System.DBNull (it's class not valuetype).
30158 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
30160         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
30161         if the array method was already assigned a token (fixes bug#40646).
30163 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
30165         * reflection.c (mono_reflection_get_type): Attempt type resolve even
30166         if no assembly is given.
30168 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
30170         * metadata.h: Added the new tables.
30172         * row-indexes.h: Added definitions for new tables.
30174         * metadata.c: Add schemas for new tables, and add support for
30175         computing the sizes of them.
30177         * class.c: Update for handling the new type cases.
30179 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
30181         * metadata.h (MONO_TYPE_IS_VOID): new macro
30183 2003-03-31  Martin Baulig  <martin@ximian.com>
30185         * threads.h (MonoThreadCallbacks): Added `thread_created'.
30187         * threads.c (mono_thread_new_init): Call `thread_created' in the
30188         mono_thread_callbacks.
30190 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
30192         * loader.h: added marshalbyrefobject_class to mono_defaults
30193         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
30194         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
30195           generation of output parameters.
30196           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
30197         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
30198           contextbound and the target object belongs to the context of the caller.
30199         * object.h: added context and unwrapped_server variables in MonoRealProxy.
30200         * object.c: Implemented support for interfaces and abstract classes
30201           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
30202           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
30204 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
30206         * class.h class.c (mono_class_is_subclass_of): New function.
30207         
30208         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
30209         routines for most common case (calls from ArrayList::ToArray).
30211         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
30212         routine so programs which call Environment::Exit() can be profiled.
30214         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
30215         Added MONO_ARCH_SAVE_REGS.
30217         * icall.c (ves_icall_type_is_subtype_of): Use new function.
30219 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
30221         * blob.h: Add a couple of new MonoType types definitions.
30223         * tabledefs.h: Add a couple of new call convs.
30225 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
30227         * reflection.h (MonoReflectionDynamicAssembly): track changes in
30228         the layout of the class.
30230         * reflection.c (alloc_table): double the size on overflow to avoid
30231         unnecessary copying.
30233         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
30234         avoid filling out metadata tables and blobs. Also set mb->ilgen to
30235         null so it can be garbage collected.
30236         
30237 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
30239         * reflection.c (mono_reflection_get_type): Return the resolved type
30240         only if it is in the assembly we searched.
30242         * reflection.c (ensure_runtime_vtable): Initialize method slots.
30244         * class.c (mono_class_setup_vtable): Set the slot of the overriding
30245         method.
30247 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30249         * appdomain.c:
30250         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
30251         the right one is 'file:///blah', but MS allows it.
30252         * assembly.c:
30253         (mono_assembly_open): allow 'file://blah'
30255         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
30257 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
30259         * socket-io.c: fixes bug #40310.
30261 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
30263         * reflection.c (mono_reflection_parse_type): handle deeply nested
30264         types correctly.
30266         * reflection.c (mono_image_create_token): Use unique token values
30267         since they will be put into a hash table.
30269         * class.c (mono_class_setup_vtable): If a method occurs in more than
30270         one place in the vtable, and it gets overriden, then change the
30271         other occurances too.
30273         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
30274         object as return type.
30276 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30278         * icall.c: Deleted "ToString" implementation for double and float
30279         because they are full implemented in managed code.
30281 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30283         * reflection.c, reflection.h: implemented and exported functions
30284         to retrieve info about custom attributes.
30286 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30288         * appdomain.c: moved Uri handling to assembly.c
30289         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
30290         work when using a file Uri in *nix and windows.
30292         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
30293         GetReferencedAssemblies.
30295 2003-03-18  Dick Porter  <dick@ximian.com>
30297         * icall.c: Rename a couple of internal calls
30299         * threads.c: Set the thread state to Stopped when a thread exits.
30300         Fixes bug 39377.
30302 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
30304         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
30305         New icall.
30307         * object.c (mono_class_vtable): fix warning.
30309 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
30311         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
30313         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
30314         memory.
30315         (method_encode_clauses): Create exception info structures in the right
30316         order.
30317         (mono_reflection_setup_internal_class): Initialize supertypes field.
30319         * class.c object.c: Handle interfaces which implement other interfaces 
30320         correctly.
30322         * class.h class.c: Move the supertypes array initialization code into 
30323         a separate function so it can be used for dynamic types too. Also call
30324         it earlier, in mono_class_init(), since it can be used before the
30325         type is initialized.
30327 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30329         * Makefile.am:
30330         * assembly.c:
30331         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
30333         * appdomain.c:
30334         * appdomain.h:
30335         * marshal.c:
30336         * object.c: remove warnings.
30338 2003-03-13  Martin Baulig  <martin@ximian.com>
30340         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
30341         (MonoDebugLexicalBlockEntry): New types.
30343         * debug-mono-symfile.c
30344         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
30346 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30348         * process.c: ret can be any non-zero value accroding to MS doc.
30350 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
30352         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
30353         fixing a warning for a miss-used prototype, would have cause
30354         random memory corruption.
30356 2003-03-07  Martin Baulig  <martin@ximian.com>
30358         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
30359         getting really annoying ....
30361 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
30363         * reflection.c (fixup_method): added support for array methods.
30365 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
30367         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
30368         (pointed out by Michael Adams).
30370 2003-03-04  Dick Porter  <dick@ximian.com>
30372         * icall.c: Temporarily reverted the Double and Single ToString()
30373         change, because it broke nunit.
30375 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
30377         * object.h, threads.h: make include files compatible with C++
30378         (patch by Jerome Laban <jlaban@wanadoo.fr>).
30380 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30382         * icall.c: Erased ToString helper functions for Double and Single.
30383         Now, that implementations ar all in managed code (Double and Single
30384         Formatters).
30386 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
30388         * appdomain.c: Added method for initializing the default context of
30389         a domain. Added internal call for getting the default context.
30390         * appdomain.h: Added context variable in MonoDomain struct.
30391         * domain.c: mono_domain_set also sets the default context of the domain
30392         * icall.c: Mapped internal method InternalGetDefaultContext.
30393         * object.c: mono_object_get_virtual_method returns always a remoting
30394         wrapper if the object is a transparent proxy.
30395         mono_runtime_invoke_array: when creating an object by calling the
30396         constructor, if the created object is a proxy, then the constructor should
30397         be called using the a remoting wrapper.
30399 2003-03-03  Dick Porter  <dick@ximian.com>
30401         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
30402         variable so it compiles on solaris.  Problem spotted by
30403         Christopher Taylor <ct@cs.clemson.edu>
30405 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30407         * appdomain.c:
30408         (get_info_from_assembly_name): don't leak value.
30410         * icall.c:
30411         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
30412         result.
30414 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
30416         * assembly.c: export mono_image_load_references ().
30417         * class.c: handle function pointers. mono_class_from_name() now
30418         supports nested type names directly.
30420 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
30422         * reflection.h reflection.c: Encode already created dynamic methods 
30423         and fields correctly as a DEF instead of a REF.
30425         * reflection.c: Get rid of the force_ref argument to 
30426         mono_image_typedef_or_ref since it was wrong in the first place.
30428         * string-icalls.c: add error checking to string constructors according
30429         to the MSDN docs.
30431         * reflection.c: Emit types in the order their TypeBuilders were 
30432         created. Previously, a new table index was assigned to each type before
30433         the tables were emitted. This was wrong because the signature blob
30434         might already refer to a type by its original table index.
30436 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
30438         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
30439         change.
30440         
30441 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30443         * Makefile.am: make assemblies dir have \ instead of / on windows.
30445 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
30447         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
30448         iterate over the NESTEDCLASS table using a linear search since the
30449         table is not guaranteed to be sorted by the secondary key.
30451         * class.c (mono_class_create_from_typedef): fixed up call to
30452         mono_metadata_nesting_typedef.
30453         
30454 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
30456         * marshal.c (mono_string_to_byvalstr): clear the memory as
30457         suggested by Jerome Laban <jlaban@wanadoo.fr>
30459 2003-02-26  Dick Porter  <dick@ximian.com>
30461         * process.c: Cope with padding in .rsrc blocks
30463 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
30465         * metadata.h: reverted the filter_len change, it breaks reflection
30466         
30467 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
30469         * metadata.h: added a new field to store the filter_len
30470         
30472 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
30474         * reflection.c: handle custom attributes for types and members
30475         created with Reflection.Emit (bug#38422).
30477 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
30479         * reflection.c: define RTSpecialName automatically for constructors for
30480         compatibility with MS.NET.
30482         * reflection.c (mono_reflection_create_runtime_class): initialize
30483         nested_in field of dynamically created classes.
30485 2003-02-22  Martin Baulig  <martin@ximian.com>
30487         * debug-mono-symfile.h: Incremented version number.
30489 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
30491         * object.h icall.c process.c: fix warnings.
30493 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
30495         * appdomain.h appdomain.c:
30496         (mono_domain_try_type_resolve): split the 
30497         name_or_tb argument into a name and a tb argument.
30498         (mono_domain_has_type_resolve): new function to check whenever the
30499         application has registered a TypeResolve event handler.
30500         
30501         * icall.c reflection.h reflection.c: move the type resolve logic into
30502         mono_reflection_get_type () so it will be invoked when 
30503         Assembly::GetType () is called.
30505         * reflection.c:
30506         (mono_reflection_get_type): renamed to get_type_internal.
30507         (mono_reflection_get_type): fixed type name generation so it works 
30508         for nested types too.
30509         (mono_reflection_get_type): call has_type_resolve () to avoid the 
30510         costly type name generation if there is no resolve event handler.
30512 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30514         * class.c, image.c: load exported types from file references.
30516 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
30518         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
30519           used to cache the managed methods used to create proxies and make 
30520           remote invocation of methods.
30521         * class.h: Added in MonoVTable a flag to indicate that a class needs 
30522           to be remotely created.
30523         * object.c: Modified the method mono_class_vtable(). It now initializes 
30524           the remote flag of the vtable. Modified mono_object_new_specific(), 
30525           so now it checks the remote flag.
30526         * icall.c: Added a couple of internal methods, one for enabling instance 
30527           creation interception for a type, and one for creating objects bypassing
30528           the remote check.
30530 2003-02-18  Martin Baulig  <martin@ximian.com>
30532         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
30533         New interncall to get a method's metadata token.
30535         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
30536         New interncall for the debugger.
30538 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
30540         * class.c (mono_class_setup_vtable): allocate supertype array
30542 2003-02-18  Martin Baulig  <martin@ximian.com>
30544         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
30546 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30548         * reflection.c:
30549         (assembly_name_to_aname): jump over unknown properties (i've found
30550         something like: 'type, assembly, version=xxx, custom=null, public...',
30551         so now will ignore custom=null and still get the rest of the values).
30553 2003-02-17  Dick Porter  <dick@ximian.com>
30555         * threads.c: Have Thread.Start() wait for a semaphore to signal
30556         that the thread has set up all its local data.  This fixes bug
30557         34323, where Abort() raced the new thread's TLS data.
30559         Also removes the handle_store() call from start_wrapper, because
30560         threads are now always created suspended and there is no longer a
30561         race between the parent and child threads to store the info.
30563 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
30565         * image.c: explain the #- heap issue in a message, hopefully
30566         avoiding FAQs on mono-list.
30568 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30570         * icall.c:
30571         (GetEntryAssembly): if the domain has not invoked
30572         AppDomain.ExecuteAssembly yet, return the assembly of the default
30573         AppDomain.
30575 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
30577         * class.c (mono_ldtoken): make it work in dynamic assemblies.
30579 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
30581         * metadata.c, reflection.c: simple speedup to type hash
30582         and equals code.
30584 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
30586         * image.c, image.h, class.c, assembly.c: move module loading
30587         to MonoImage. When loading metadata, consider alignemnet from
30588         the start of metadata, not from the metadata address in memory.
30590 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
30592         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
30593         AssemblyBuilder objects. Factored out custom attribute creation into
30594         a separate function.
30595         (create_custom_attr): new function to create custom attributes.
30597 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
30599         * Makefile.am: Got tired of typing the full pathname to pedump.
30600         Until there is another option, am installing this.
30602 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
30604         * class.c (class_compute_field_layout): always set field->parent 
30605         (mono_ldtoken): use mono_defaults.fieldhandle_class;
30607 2003-02-11  Dick Porter  <dick@ximian.com>
30609         * threads-types.h:
30610         * monitor.c: Rewrote Monitor, making lock much faster and
30611         Pulse/Wait work as specified.  Also uses much fewer handles, and only
30612         creates them as needed.
30614         * exception.c: Added SynchronizationLockException
30616         * threads.c: Deleted old Monitor implementation.  The new one is
30617         in a new file.
30619 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
30621         * class.c: handled TypedReference type code. Set the correct size for
30622         class data. Setup interface_offsets for interface classes, too.
30624 2003-02-09  Martin Baulig  <martin@ximian.com>
30626         * debug-mono-symfile.h: Reflect latest symbol writer changes.
30628 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
30630         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
30631         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
30632         * object.c: fixed mono_object_get_virtual_method () for interfaces.
30633         * verify.c: check for code that runs after the end of the method.
30635 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30637         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
30638         "System.Math::Round2".
30639         * sysmath.h: Added Floor, Round and Round2 definitions.
30640         * sysmath.c: Modified certain functions that were not 100% compliant
30641         with MS.NET (math precision) and added the implementation of Floor,
30642         Round and Round2.
30644 2003-02-07  Martin Baulig  <martin@ximian.com>
30646         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
30648 2003-02-07  Martin Baulig  <martin@ximian.com>
30650         * debug-mono-symfile.c: Reflected latest symwriter changes.
30651         (mono_debug_create_mono_symbol_file): Removed.
30652         (mono_debug_open_mono_symbol_file): Take an argument which
30653         specifies whether to create a dynamic symbol file.
30655 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
30657         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
30659 2003-02-05  Martin Baulig  <martin@ximian.com>
30661         * reflection.c (mono_image_build_metadata): Make this public,
30662         protect it against being called multiple times, don't create
30663         resources and don't build the compressed metadata here.
30664         (mono_image_create_pefile): Do this here.
30666         * icall.c
30667         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
30669 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30671         * socket-io.c: fixed bug #36322.
30673 2003-02-06  Piers Haken <piersh@friskit.com>
30675         * appdomain.[ch]:
30676         * class.h:
30677         * debug-mono-symfile.c:
30678         * icall.c:
30679         * loader.c:
30680         * mono-config.c:
30681         * monosn.c:
30682         * reflection.c:
30683         * socket-io.c: warning cleanups
30685 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
30687         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
30688         function. works like remoting invoke, but does a check for the Proxy first.
30690 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
30692         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
30694 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
30696         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
30697         array of pointers.
30698         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
30699         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
30701         * object.c (mono_store_remote_field_new): used by the new jit
30702         instead of mono_store_remote_field
30703         (mono_load_remote_field_new): used by the new jit
30704         instead of mono_load_remote_field
30706 2003-02-05  Patrik Torstensson
30708         * appdomain.c: changed unload to take the domain id instead
30709         of domain
30710         
30711         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
30714 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30716         * appdomain.c: don't look for assemblies in ApplicationBase if
30717         PrivateBinPathProbe is set.
30719 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30721         * object.c: make the first argument in main_args contain the absolute
30722         path to the assembly. Fixes bug #37511.
30724 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30726         * icall.c: get correct UTC offset for countries not using daylight
30727         time saving. Fixes bug #30030.
30729 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30731         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
30732         and 1 are the family).
30734 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
30736         * icall.c (ves_icall_InternalExecute): removed wrong assertion
30738         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
30740 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
30742         * reflection.c: added support for SignatureHelper tokens, which is
30743         needed by the Calli opcode.
30745         * reflection.h: track changes to SignatureHelper class.
30747         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
30749 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30751         * appdomain.c: fixed loading assemblies from PrivateBinPath.
30753 2003-02-03  Patrik Torstensson
30754         * appdomain.[c|h], domain.c : 
30755          - Added support for getting a domain via domain id
30756          - Support for setting and getting domain from System.AppDomain 
30757            (used in cross appdomain channel)
30758          - Added support for get/set for a MonoAppContext on a thread 
30759            (Context class in System.Runtime.Remoting.Contexts),
30760          - Removed hack in Get/SetData and ExecuteAssembly.
30761         
30762         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
30763         the managed world to get control when a proxy is created.
30765         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
30766         
30767 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
30769         * icall.c
30770         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
30771         Populate the codebase field as well.
30773 2003-02-02  Martin Baulig  <martin@ximian.com>
30775         * debug-mono-symfile.c
30776         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
30777         (mono_debug_symfile_add_method): Allow interncalls.
30779 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30781         * icall.c: throw parse exception if strtod fails or the string is empty.
30783 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
30785         * marshal.c: handle object type separately from defined
30786         class types.
30788 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
30790         * marshal.c: handle NATIVE_LPSTR for strings when it's
30791         explicitly specified.
30793 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
30795         * reflection.c, reflection.h, icall.c: setup the reflection
30796         handle cache for ModuleBuilders and AssemblyBuilders.
30798 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
30800         * reflection.c (reflection_methodbuilder_to_mono_method): set
30801         pinvoke flag
30803 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30805         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
30807 2003-01-29  Dick Porter  <dick@ximian.com>
30809         * threads.c: No need for the fake_thread kludge now that Thread
30810         doesn't run a class constructor
30811         
30812 2003-01-29  Dick Porter  <dick@ximian.com>
30814         * threads.c: Use g_direct_hash instead of the rather bogus
30815         g_int_hash
30817 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
30819         * marshal.c (mono_marshal_get_native_wrapper): add check for null
30820         (fix pinvoke12.exe)
30821         (mono_marshal_get_struct_to_ptr): generate valid IL code
30822         (mono_marshal_get_ptr_to_struct): generate valid IL code
30823         (*): correctly set sig->pinvoke, we need to memdup the signature
30824         to do that
30826 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30828         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
30829         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
30831 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
30833         * profiler.c: provide more callers information.
30835 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
30837         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
30839         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
30841         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
30843 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30845         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
30846         exception instead of going into an infinite loop on dates which it 
30847         can't yet handle.
30849         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
30850         out-of-range exception if needed.
30852         * class.c (mono_class_setup_vtable): allow a virtual method to provide
30853         an implementation for an interface method and to override an inherited
30854         method at the same time. 
30855         Imagine a scenario when a virtual method is used to override a
30856         virtual abstract method in a parent class, and this same method 
30857         provides an implementation for an method inherited from an interface. 
30858         In this case, the interface resolution code will set im->slot, which 
30859         means that the virtual method override pass will skip this method 
30860         which means a pointer to the abstract method inherited from the parent
30861         will remain in the vtable of this non-abstract class.
30863         * class.c: (mono_class_setup_vtable): continue search for a real 
30864         method if only an abstract method is found.     
30866 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
30868         * reflection.c: add size to encoding for ByValStr and ByValArray
30869         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
30871 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30873         * class.c (mono_class_setup_vtable): pass the override info as an
30874         argument.
30876         * class.c (mono_class_setup_vtable): set the slot of overriding methods
30877         correctly.
30878         
30879         * reflection.c (ensure_runtime_vtable); add support for method 
30880         overrides.
30881         
30882 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30884         * reflection.c (resolution_scope_from_image): Hack to work to work with
30885         dynamic assemblies.
30887         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
30888         added a 'force_ref' argument to force this function to allways return 
30889         a TypeRef. This is needed by mono_image_get_memberref_token ().
30890         
30891 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30893         * reflection.c (mono_image_get_type_info): interfaces really don't have
30894         a parent.
30896         * reflection.c (mono_image_basic_init): fill out missing fields of
30897         image structure.
30899         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
30900         dynamic assemblies. This is required so dynamic assemblies show up in
30901         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
30902         Type::GetType() etc. This is consistent with MS behaviour.
30904         * image.c image.h reflection.c: add newly created classes to the name 
30905         cache so mono_class_get () will find them.      
30907 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30909         First part of changes to get IKVM.NET running under mono.
30910         
30911         * appdomain.h, appdomain.c: added new function 
30912         mono_domain_try_type_resolve() which will emit TypeResolve events. 
30913         This function will call AppDomain::DoTypeResolve to do the actual work.
30915         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
30916         moved existing code dealing with dynamic tokens to a new function 
30917         called mono_reflection_lookup_dynamic_token (). This function will 
30918         raise TypeResolve events when appropriate. Since reflection.c is not 
30919         part of libmetadata, a new hook function called 
30920         mono_lookup_dynamic_token() is added to class.c which will call this.
30922         * assembly.h assembly.c: make the invoke_load_hook function public,
30923         so it can be called for dynamic assemblies.
30925         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
30927         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
30928         type isn't found.
30930         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
30931         MonoGHashTable, since it contains pointers to objects which the GC 
30932         needs to track.
30934         * assembly.c (search_loaded): remove unused variable.
30935         
30936 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
30938         * object.c: fixed issue exposed by gcc-generated IL programs
30939         that use RVA data for pointers.
30941 2003-01-25  Martin Baulig  <martin@ximian.com>
30943         * threads.c (start_wrapper): Moved the initialization of
30944         `start_func' above the mono_new_thread_init() call to which we
30945         pass it as argument.
30947 2003-01-24  Martin Baulig  <martin@ximian.com>
30949         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
30950         the MonoThread pointer.
30952 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
30954         * icall.c: Rename `PowImpl' to Pow.
30956 2003-01-23  Dick Porter  <dick@ximian.com>
30958         * threads.c (start_wrapper): Create a Thread object if needed, so
30959         the Main() thread can do the class initialisation in a subthread
30960         that has been set up to allow managed code execution.
30962         Pass the thread ID instead of the MonoThread pointer to the thread
30963         start and attach callbacks.  This change is required, because the
30964         jit thread start callback must be called _before_ the Thread
30965         object can be created.
30966         
30967         (mono_thread_init): Removed much object creation code that is no
30968         longer needed.  No managed code is called from here now.
30970         * object.c (mono_runtime_exec_managed_code): Create a subthread
30971         for Main, and call back to the runtime to use it.
30972         Set the exit code when Main exits.
30974         * gc.c: Make sure domain finalisation happens in a subthread.
30975         Re-enable threaded GC, fixing bug 31333 (again).
30977         * environment.c: System.Environment internall calls (so far just
30978         ExitCode is here, the others are still in icall.c)
30980         * appdomain.c (mono_runtime_cleanup): All threads running managed
30981         code should have finished before mono_runtime_cleanup() is
30982         reached, so no need to clean up threads.
30984 2003-01-22  Martin Baulig  <martin@ximian.com>
30986         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
30987         `gpointer func' arguments.      
30988         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
30989         but added `MonoThread *thread' argument.
30990         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
30992         * threads.c (mono_new_thread_init): Added `gpointer func' argument
30993         and pass it to the mono_thread_start_cb callback.
30994         (mono_install_thread_callbacks): New public function to install a
30995         set of callbacks which are set by the debugger.
30996         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
30998 2003-01-22  Martin Baulig  <martin@ximian.com>
31000         * Makefile.am: Install debug-mono-symfile.h.
31002 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
31004         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
31006 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
31008         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
31009         * class.c (mono_ptr_class_get): correctly set access levels of pointers
31010         (mono_array_class_get): correctly set access levels of arrays
31012 2003-01-20      Patrik Torstensson
31013         * image.h (MonoAssemblyName): changed major, minor, build, revision
31014         from signed to unsigned.
31016 2003-01-20  sean kasun <skasun@azstarnet.com>
31018         * reflection.c (load_cattr_value): Now this handles
31019         MONO_TYPE_SZARRAY.  Fixes bug #35629
31021 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
31023         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
31024         integer value
31026 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31028         * decimal.c: fixed bug #26056.
31030 2003-01-17  Martin Baulig  <martin@ximian.com>
31032         * gc.c: Raise an ExecutionEngineException instead of using g_error().
31034 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31036         * exception.[ch]:
31037         (mono_get_exception_type_initialization): new function.
31039         * object.c: throw a TypeInitializationException when an exception is
31040         thrown invoking the class constructor.
31042 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31044         * reflection.c: fixed attribute reading.
31046 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31048         * icall.c:
31049         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
31050         provided, look for the type in the calling assembly and then in
31051         mscorlib; if the assembly name is provided, only try that one.
31053 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
31055         * object.c: register the vtable before there is a chance it's
31056         queried again recursively.
31058 2003-01-13  Duncan Mak  <duncan@ximian.com>
31060         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
31061         gc-internal.h. 
31062         
31063 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
31065         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
31067 2003-01-11  Martin Baulig  <martin@ximian.com>
31069         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
31070         this to 20 for the release.
31072 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
31074         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
31076         * loader.c (mono_method_get_marshal_info): bug fix
31078         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
31079         structures with explicit layout
31081 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
31083         * profiler.c: made the output more readable (and sorted). 
31084         Added caller information for the allocation profiler.
31086 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
31088         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
31090 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31092         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
31093         to get value types.
31094         
31095 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
31097         * object.c, profiler.h, profiler.c, profiler-private.h:
31098         Added object allocation profiler.
31100 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
31102         * reflection.h, reflection.c: handle global methods.
31103         Compress blob entries.
31105 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
31107         * marshal.c: fix compilation.
31109 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
31111         * loader.c (mono_method_get_marshal_info): impl.
31113         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
31115 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31117         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
31118         for reference types.
31120 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
31122         * loader.c: fixed off by one error in loaded parameter names.
31124 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
31126         * marshal.c (mono_marshal_get_icall_wrapper): like
31127         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
31128         instead of a MonoMethod.
31130 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31132         * decimal.c: fixed bug #36537.
31134 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
31136         * marshal.c: throw a missing method exception if a
31137         P/Invoke method is not found.
31139 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
31141         * icall.c: allow a null this for constructors.
31143 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
31145         * icall.c: raise the proper exceptions if the arguments to the
31146         internal Invoke are incorrect.
31148 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
31150         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
31152 2003-01-03  Martin Baulig  <martin@ximian.com>
31154         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
31156 2002-12-31  Martin Baulig  <martin@ximian.com>
31158         * debug-mono-symfile.c: Completely rewrote the type section.
31159         Instead of using individual malloc()ed fields, we use one big
31160         continuous memory area and offsets into this area.
31161         See the comments in the source code for details.
31163 2002-12-30  Martin Baulig  <martin@ximian.com>
31165         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
31167 2002-12-30  Martin Baulig  <martin@ximian.com>
31169         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
31170         line number table in this data blob instead of using an external
31171         pointer.
31173 2002-12-28  Martin Baulig  <martin@ximian.com>
31175         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
31177 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
31179         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
31180         as a boxed return type.
31182 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
31184         * appdomain.c
31185         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
31186         g_build_filename to properly get separators on the filename created.
31188         * object.h: Small change, introduce MonoMarshalByRefObject to
31189         track the layout of that structure in the C# universe as we make
31190         changes there.
31192 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
31194         * object.c: removed assert to allow static fields on interfaces.
31195         * loader.c: a TypeSpec may be used for any type, not just arrays.
31197 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
31199         * class.c, class.h: added mono_class_array_element_size ().
31200         Ignore static methods in interfaces.
31202 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31204         * threads.c: fixed the build under cygwin.
31206 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
31208         * reflection.c: handle nullref constants. Allocate keys for
31209         reflection handles with the GC.
31211 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
31213         * threads.c, threads.h: added mono_thread_get_abort_signal()
31214         to get a suitable signal for thread abort.
31216 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
31218         * metadata.c: fix handling of ExportedType table.
31220 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31222         * icall.c: added WriteWindowsDebugString internal call.
31224 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31226         * reflection.h: added fields to match C# implementation.
31228 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31230         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
31232 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
31234         * gc.h, gc-internal.h: Rename header for GC internal calls to
31235         gc-internal.h from gc.h as to not clash with Boehm GC having its
31236         header installed as <gc.h> in outside include paths.
31237         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
31238         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
31240 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31242         * icall.c: assign minor, build and revision in FillName.
31244 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
31246         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
31247         Added support for running code generated by Reflection.Emit.
31249 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31251         * appdomain.c: check for NULL argument in LoadFrom.
31253 2002-12-10  Dick Porter  <dick@ximian.com>
31255         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
31257 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31259         * appdomain.c: fix buglet when building exe file name.  Handle full
31260         assembly name (needed after latest changes to AssemblyName).
31261         * image.c:
31262         (mono_image_close): free some hashtables.
31264 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
31266         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
31267         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
31268         on some systems (redhat 7.3) 
31270 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
31272         * threads.c: delete the critical section of a sync block,
31273         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
31275 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
31277         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
31279 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31281         * appdomain.[ch]: handle the assembly preload event to try loading the
31282         assemblies using the paths we have in the current domain.
31284         * assembly.[ch]: created an assembly preload hook that is called to try
31285         loading the assembly by other means that the ones provided here.
31287         * domain.c: initialize the domain search path.
31289         From now on, assemblies (TODO: except corlib and System) are loaded
31290         according to these rules when using mono_assembly_load ():
31292                 1. It tries to load the assembly from the ApplicationBase
31293                 of the current domain appending .dll and .exe (TODO: have to
31294                 try loading from name/name.dll and name/name.exe).
31296                 2. It tries the search path specified in PrivateBinPath for the
31297                 current domain (if any).
31299                 3. Previous behavior.
31301 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
31303         * icall.c: implemented GetInterfaceMap() related icall.
31304         * domain.c, loader.h: load MethodInfo in mono_defaults.
31306 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
31308         * gc.c: disable the finalizer thread for now, untill all the issues
31309         with it are resolved.
31311 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
31313         * string-icalls.c: handle embedded nulls in string ctor when the
31314         length is specified.
31316 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
31318         * class.c: look for explicit interface implementation in parent
31319         classes, too.
31321 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
31323         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
31325 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
31327         * gc.c: protect handles with a critical section.
31329 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31331         * icall.c:
31332         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
31333         parameters. If no assembly specified, try getting the type from all
31334         the assemblies in the current domain, else, load the assembly and get
31335         the type from it.
31337 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31339         * marshal.c: applied patch from Aleksey Demakov that fixes
31340         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
31342 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31344         * icall.c: fixed get_location.
31346 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
31348         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
31349         declarations to make it work with older gcc. 
31351         * loader.c (mono_get_method): set signature->pinvoke for native calls
31353 2002-11-20  Dick Porter  <dick@ximian.com>
31355         * threads.c (mono_thread_init): Set the main thread's handle
31357 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
31359         * gc.c: allow compilation without GC support. Changed to match the
31360         mono coding style.
31362 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
31364         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
31366 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
31368         * reflection.c: set a public key token on the core assemblies.
31370 2002-11-18  Dick Porter  <dick@ximian.com>
31372         * threads.c: Split out some thread initialisation so that other
31373         files can set the start callback function.
31375         * gc.c: Run finalisers in a separate thread, to avoid stack
31376         overflow.  Fixes bug 31333.
31378         * appdomain.c: Set up GC finalisation thread.
31380         * reflection.c: 
31381         * object.c: 
31382         * domain.c: Use gc.h macros for GC_malloc
31383         
31384 2002-11-15  Dick Porter  <dick@ximian.com>
31386         * threadpool.c: 
31387         * threads.c:
31388         * appdomain.c: Removed mono_runtime_init_with_attach(),
31389         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
31390         merging the extra parameter with the existing function.  Removed
31391         unneeded code in mono_thread_attach().
31393 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
31395         * image.c (mono_image_loaded_by_guid): a method to get loaded
31396         images by guid. 
31397         (load_metadata_ptrs): we store the guid as string.
31399 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
31401         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
31403         * metadata.c (mono_guid_to_string): imported method form Zoltan
31404         Varga (slightly modified)
31406         * assembly.c (mono_assembly_open): load precompiled code
31408         * loader.h (MonoMethod): we store the method token for use in the
31409         aot compiler. 
31411 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31413         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
31414         the hook function called when an assembly is loaded.
31415         
31416         * domain.c: Modified file.
31417         (mono_domain_assembly_load): removed hash table insertion of assemblies.
31419         Fixes bug #33196.
31421 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
31423         * reflection.c: Map PEFileKind to the value expected by the WinNT
31424         image loader. 
31426 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31428         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
31429         Read until the buffer is filled completely.
31431 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31433         * icall.c: implemented MonoType.InternalGetEvent ().
31435 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31437         * appdomain.c: implemented InitAppDomainSetup. Delayed
31438         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
31439         the entry_assembly.
31441         * assembly.c: base_dir is now an absolute path ending with
31442         G_DIR_SEPARATOR.
31444         * icall.c: modified get_location according to the above changes.
31446         * object.c: init AppDomain.SetupInformation for the default domain after
31447         we have the entry assembly.
31449         * domain.c: when unloading a domain, setup = NULL.
31451 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
31453         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
31455 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
31457         * object.h, object.c: introduced mono_object_get_virtual_method ()
31458         to lookup the method invoked on an object when a callvirt is done on
31459         a method.
31460         * icall.c: make MethodInfo::Invoke() always do a virtual call.
31462 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31464         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
31465         current domain when loaded an assembly and failed to load it.
31467         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
31469 2002-10-31  Dick Porter  <dick@ximian.com>
31471         * icall.c: 
31472         * file-io.h: 
31473         * file-io.c: Return the error status in a parameter, as the
31474         GetLastError() value has long since been blown away if we try and
31475         look it up in a subsequent internal call invocation.  Delete the
31476         GetLastError() internal call, because it's useless.
31478 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
31480         * class.[ch]: added cast_class to fix bug 29517
31482 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
31484         * marshal.c: create valid IL code in the filter clause:
31485         the new JIT is less forgiving:-)
31487 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31489         * icall.c: removed get_property internal call.
31491 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
31493         * appdomain.h domain.c: Added an ID to appdomains.
31494         
31495         * threads.c threads.h icall.c: Implement icall
31496         Thread:GetDomainID(), and remove unused icall 
31497         CurrentThreadDomain_internal.
31499 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31501         * icall.c: Don't recurse through the base types in GetConstructor.
31502         Fixes bug #32063. 
31504 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
31506         * mempool.h, mempool.c: added mono_mempool_empty() and
31507         mono_mempool_stats().
31509 2002-10-23  Dick Porter  <dick@ximian.com>
31511         * file-io.c: 
31512         * file-io.h: 
31513         * icall.c: Added MonoIO.GetFileType internal call
31515 2002-10-17  Dick Porter  <dick@ximian.com>
31517         * appdomain.c (mono_runtime_cleanup): Don't signal the async
31518         delegate semaphore before waiting for all threads to finish,
31519         because new threads can also call async delegates.  Fixes bug
31520         32004.
31522         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
31523         of 3 seconds, in case another async job is queued.  (This part is
31524         needed because the bug fix reintroduced the 3s exit lag.)  This
31525         makes the mono_runtime_shutdown flag superfluous.
31527 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
31529         * reflection.c: include ehader size in method section headers.
31530         Really check for suplicated modules entries.
31532 2002-10-17  Martin Baulig  <martin@gnome.org>
31534         * debug-mono-symfile.c: Added back support for locals.
31536 2002-10-14  Martin Baulig  <martin@gnome.org>
31538         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
31539         MONO_TYPE_VOID.
31541 2002-10-14  Martin Baulig  <martin@gnome.org>
31543         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
31544         mono_class_get() instead of looking in the class cache. 
31546 2002-10-13  Martin Baulig  <martin@gnome.org>
31548         * debug-mono-symfile.c: Set version number to 28, include the
31549         signature in method names.
31551 2002-10-13  Martin Baulig  <martin@gnome.org>
31553         * debug-mono-symfile.h: Set version number to 27.
31555 2002-10-11  Martin Baulig  <martin@gnome.org>
31557         * gc.c: Don't register/unregister NULL pointers as disappearing links.
31559 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31561         * metadata.c, metadata.h: added helper function to allocate signatures.
31563 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31565         * icall.c: added internal call to get the location of machine.config.
31567 2002-10-08  Martin Baulig  <martin@gnome.org>
31569         * debug-mono-symfile.c: Ignore classes with a pending init for the
31570         moment.
31572 2002-10-03  Dick Porter  <dick@ximian.com>
31574         * threads.c: Freebsd pthread_t is a pointer
31576 2002-10-03  Dick Porter  <dick@ximian.com>
31578         * socket-io.c: Implemented GetHostName_internal
31580 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31582         * mono-config.c:
31583         (mono_config_parse_file): don't leak the text.
31585 2002-10-02  Martin Baulig  <martin@gnome.org>
31587         * debug-mono-symfile.c: Added support for methods.
31589 2002-10-01  Martin Baulig  <martin@gnome.org>
31591         * debug-mono-symfile.c: Don't emit methods and line numbers for
31592         the dynamic symbol file, just write the type table.  We can easily
31593         have an external helper program which creates a symbol file for an
31594         IL file.        
31596 2002-10-01  Dick Porter  <dick@ximian.com>
31598         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
31599         Only add the handle to the cleanup array when we're about to
31600         launch the thread.  Bug 31425 deadlocked when the test was run on
31601         mono under w32.
31603 2002-10-01  Martin Baulig  <martin@gnome.org>
31605         * debug-mono-symfile.c: Added support for properties.
31607 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
31609         * reflection.c: unaligned store fix from Mark Crichton
31610         <crichton@gimp.org>.
31612 2002-09-27  Martin Baulig  <martin@gnome.org>
31614         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
31615         New interncall.
31617 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
31619         * assembly.h, assembly.c: use a sane API to hook into the assembly
31620         loading process instead of a useless special-purpouse hack
31621         (ngen needs a hook, too, for example).
31623 2002-09-27  Dick Porter  <dick@ximian.com>
31625         * threads.c (mono_thread_init): Call GetCurrentProcess() so
31626         io-layer can set up some process handle info.  Not needed on w32,
31627         but doesn't hurt either.
31629         * process.c: Pass the program name in the second parameter to
31630         CreateProcess, so the path is searched.  Include the working
31631         directory. Implemented process name, process enumeration, and some
31632         process detail internal calls.
31633         
31634         * icall.c: Added internal calls for process lookup, and some
31635         process details
31637 2002-09-26  Martin Baulig  <martin@gnome.org>
31639         * assembly.c (mono_install_open_assembly_hook): New global
31640         function to install a function to be invoked each time a new
31641         assembly is loaded.
31642         (mono_assembly_open): Run this callback function if set.
31644         * debug-mono-symfile.c: Put back line numbers for the dynamic
31645         symbol file and also record the .il file as source file.  This
31646         allows us to install the temporary symbol file as `file.dbg' just
31647         like a compiler-generated one.
31649 2002-09-26  Nick Zigarovich <nick@chemlab.org>
31651         * Corrected typo in gc.c (BOHEM vs BOEHM).
31653 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31655         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
31656         GetProperties. Also avoid calling g_slist_length in GetProperties and
31657         GetMethods.
31659 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
31661         * reflection.c: avoid unaligned stores (bug spotted by
31662         Mark Crichton  <crichton@gimp.org>).
31664 2002-09-25  Martin Baulig  <martin@gnome.org>
31666         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
31667         instead of guint64 for addresses and added prologue/epilogue info.
31669 2002-09-25  Martin Baulig  <martin@gnome.org>
31671         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
31672         store line number info.  For the dynamic symbol file, we only need
31673         to provide the JIT generated dynamic line number info for the dynamic
31674         symbol file.
31676 2002-09-25  Martin Baulig  <martin@gnome.org>
31678         * debug-mono-symfile.h: Incremented version number.
31680 2002-09-24  Martin Baulig  <martin@gnome.org>
31682         * class.c (mono_debugger_class_init_func): New global function
31683         pointer variable.
31684         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
31685         call it.
31687         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
31688         function.  This is called via the mono_debugger_class_init_func
31689         hook to add all types to the dynamic type table.
31690         (ves_icall_MonoDebugger_GetType): New interncall to get a class
31691         from its metadata token.
31693         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
31694         New interncall for the debugger.
31696 2002-09-24  Nick Drochak <ndrochak@gol.com>
31698         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
31699         before using it in case it is null.
31700         
31701 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31703         * metadata.c: allow custom modifiers in local var signatures
31704         (bug spotted by Zoltan Varga).
31706 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
31708         * class.c: deal with the <Module> class that may have a NULL vtable.
31709         Eliminate warnings.
31711 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31713         * image.c, image.h: more strong name helpers.
31714         * monosn.c: more work: convert pem keys to cryptoapi format.
31716 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
31718         * string-icalls.c: speedup IndexOf.
31720 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31722         * icall.c: updates from Zoltan.2.Varga@nokia.com.
31724 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
31726         * icall.c: cleanup: use mono_object_domain ().
31728 2002-09-23  Martin Baulig  <martin@gnome.org>
31730         * debug-mono-symfile.c: Improved type support.
31732 2002-09-22  Martin Baulig  <martin@gnome.org>
31734         * debug-mono-symfile.c: Added support for reference types and strings.
31736 2002-09-22  Martin Baulig  <martin@gnome.org>
31738         * debug-mono-symfile.c: Started to work on the type table.
31740 2002-09-21  Martin Baulig  <martin@gnome.org>
31742         * debug-mono-symfile.c: Largely reworked the symbol table format.
31743         The symbol table is now incrementally updated each time a new
31744         method is added.  We're now also using our own magic and version
31745         so that you don't need to recompile all your classes if the
31746         dynamic table changes.
31747         (mono_debug_update_mono_symbol_file): Removed.
31748         (mono_debug_symfile_add_method): New function to add a method.
31750 2002-09-21  Martin Baulig  <martin@gnome.org>
31752         * icall.c
31753         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
31754         New interncall.
31756         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
31757         New interncall to get a method from its metadata token.
31759 2002-09-21  Martin Baulig  <martin@gnome.org>
31761         * debug-mono-symfile.c: Create type table.
31763 2002-09-20  Martin Baulig  <martin@gnome.org>
31765         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
31767 2002-09-20  Martin Baulig  <martin@gnome.org>
31769         * debug-mono-symfile.c: Provide information about params and locals.
31771 2002-09-20  Martin Baulig  <martin@gnome.org>
31773         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
31774         New interncall.
31776         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
31777         interncall to get a method from its metadata token.
31779 2002-09-20  Martin Baulig  <martin@gnome.org>
31781         * debug-mono-symfile.c: Added a few checks for method->header
31782         being non-NULL.  This should never happen, but for the moment
31783         let's use a g_warning() rather than a g_assert().
31785 2002-09-19  Mark Crichton  <crichton@gimp.org>
31787         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
31788         even if support for it isn't present.  Added an #ifdef to fix this.
31790         * socket-io.c: Added checks back for Solaris support.
31792 2002-09-19  Martin Baulig  <martin@gnome.org>
31794         * debug-mono-symfile.c (read_string, write_string): Reflect latest
31795         changes in the symbol file format.
31797 2002-09-18  Martin Baulig  <martin@gnome.org>
31799         * debug-mono-symfile.c: Set version number to 21.
31801 2002-09-18  Dick Porter  <dick@ximian.com>
31803         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
31804         on netbsd.  Fixes bug 30051.
31806 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31808         * reflection.c:
31809         (set_version_from_string): little fix.
31811 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31813         * monosn.c, Makefile.am: added strong name utility.
31814         * reflection.h, reflection.c: implemented delayed signing,
31815         locale, version and hash id assembly attributes.
31817 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
31819         * loader.c, metadata.c: load param attributes in signatures.
31821 2002-09-16  Martin Baulig  <martin@gnome.org>
31823         * debug-mono-symfile.c: Added string table with all method names.
31825 2002-09-14  Martin Baulig  <martin@gnome.org>
31827         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
31828         fast method lookup.
31830 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
31832         * reflection.c: record the public key token of referenced assemblies.
31834 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31836         * image.c, image.h: added functions to get the strong name and the
31837         public key of an assembly.
31838         * pedump.c: use them.
31840 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
31842         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
31844 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
31846         * marshal.c (mono_marshal_get_managed_wrapper): Added
31847         MONO_TYPE_BOOLEAN 
31849 2002-09-11  Martin Baulig  <martin@gnome.org>
31851         * gc.c: Call GC_unregister_disappearing_link() on all links when
31852         finalizing them, this is necessary to aviod a crash in boehm's
31853         finalize handler.
31855 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
31857         * gc.c: handle GetTarget for finalized objects spotted and fixed by
31858         nick@chemlab.org.
31860 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
31862         * icall.c: implemented MonoType::Module.
31863         * reflection.c, reflection.h: mono_module_get_object () from
31864         Tomi Pakarinen <tomi.pakarinen@welho.com>.
31866 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
31868         * icall.c: ignore overridden methods in GetMethods ().
31869         Fix for FieldInfo::SetValue().
31870         * object.c: handle float/double in runtime invoke.
31872 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
31874         * object.c: allow a constructor to be called again on an object.
31876 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31878         * class.h, class.c: move field layout code to it's own function and
31879         export it. Get an interface id earlier. Move fields in MonoClass
31880         so they are more cache friendly and align the bitfields.
31881         * loader.c: temporary handle get_param_names() for a runtime method.
31882         * reflection.c, reflection.h: more code to handle runtime creation of
31883         types.
31885 2002-09-09  Martin Baulig  <martin@gnome.org>
31887         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
31888         signature with the pinvoke field being set for the actual call.
31890 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31892         * icall.c: removed some unused icalls. Start of map of glib charsets
31893         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
31895 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
31897         * debug-helpers.c: break infinite loop (found and fixed by
31898         Holger Arnold <harnold@gmx.de>).
31900 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
31902         * icall.c: target may be null in create_delegate.
31904 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31906         * marshal.c: handle a boolean return type.
31908 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31910         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
31912 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
31914         * gc.c: fix weakreferences.
31916 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
31918         * icall.c: added icall to get default codepage.
31920 2002-09-03  Dick Porter  <dick@ximian.com>
31922         * threads.h: 
31923         * threads.c: Use MonoThread instead of MonoObject where
31924         apropriate.
31926         Store running thread objects in a hash table, so that we have all
31927         the info to hand when waiting for them to finish
31928         (means we don't need OpenThread() any more, so mingw builds should
31929         be fully functional again.)
31931         * verify.c:
31932         * object.h: Added thread ID to MonoThread
31934 2002-09-03  Martin Baulig  <martin@gnome.org>
31936         * icall.c (System.Reflection.Assembly::get_location): New interncall.
31938 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31940         * icall.c: fixed leak in get_temp_path. Thanks lupus.
31942 2002-09-03  Martin Baulig  <martin@gnome.org>
31944         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
31945         argument to store the end address of the disassembled instruction.
31947         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
31948         here from debug-symfile.h.
31949         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
31950         JIT into this struct.
31951         (MonoSymbolFile): Added `char *image_file' field.
31952         (MonoDebugGetMethodFunc): Removed.
31953         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
31954         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
31955         (mono_debug_find_method): New method.
31957         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
31958         create a full symbol file.
31959         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
31960         and static symbol files.
31961         (mono_debug_find_method): The symbol file keeps an internal method hash,
31962         call this to get a MonoDebugMethodInfo from a MonoMethod.
31964         * debug-symfile.[ch]: Removed.
31966 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
31968         * image.c (do_mono_image_open): Remove linker version check.
31970 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
31972         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
31973         wrappers for instance methods.
31974         
31975 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31977         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
31979 2002-08-28  Dick Porter  <dick@ximian.com>
31981         * Makefile.am: Export HOST_CC for w32 builds
31983 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31985         * file-io.c process.c: MonoString are null terminated, no
31986         need for mono_string_to_utf16() anymore.
31988 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
31990         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
31992 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
31994         * icall.c, reflection.h: speedup System.MonoType.
31996 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
31998         * reflection.c: allow null as the value of a string argument in
31999         custom attributes constructors.
32001 2002-08-27  Martin Baulig  <martin@gnome.org>
32003         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
32004         `trampoline_address' field.
32006 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
32008         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
32009         check (fixes bug #29486) 
32011 2002-08-27  Martin Baulig  <martin@gnome.org>
32013         * debug-mono-symfile.c: Changed the file format in a way that allows us
32014         open it read-only and to use a specially malloced area for all the
32015         dynamic data.  We can now also generate a symbol file on-the-fly if we're
32016         debugging IL code and there is no MCS generated symbol file for it.
32018 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32020         * object.c: added a define for a good string and array
32021         creation speedup (not enabled by default because we need to deal with
32022         the synch stuff).
32024 2002-08-26  Martin Baulig  <martin@gnome.org>
32026         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
32027         function to create a dynamic symbol file.  This is used by the
32028         debugger to create a symbol file for IL code on-the-fly.
32030 2002-08-26  Martin Baulig  <martin@gnome.org>
32032         * loader.c (mono_lookup_pinvoke_call): Include the error message
32033         from g_module_error() in the error message.
32035 2002-08-24  Martin Baulig  <martin@gnome.org>
32037         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
32038         function to update the symbol file.  The symbol file is mmap()ed
32039         writable, but private.  This allows us to install the symbol file
32040         together with the assembly.
32042 2002-08-24  Martin Baulig  <martin@gnome.org>
32044         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
32045         but they can read the new symbol file format which mcs is now creating.
32047         * debug-symfile.c (mono_debug_find_source_location): Moved to
32048         debug-mono-symfile.c; this is now operating on the new symbol file.
32050 2002-08-23  Martin Baulig  <martin@gnome.org>
32052         * debug-helpers.c (mono_method_desc_from_method): New function to get
32053         a MonoMethodDesc from a MonoMethod.
32055 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
32057         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
32058         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
32060 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
32062         * string-icalls.[ch]: make helper methods static.
32064 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32066         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
32067         types to it and to SetValueInternal.
32069         * object.c: Moved handle_enum label to its proper place. This was the
32070         f... bug! ;-)
32072         This time i compiled mcs and gtk-sharp and they both work.
32074 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32076         * icall.c: reverted partially my previous patch until 
32077         object.c:set_value handles enums correcly.
32079 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32081         * icall.c:
32082         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
32083         (ves_icall_System_Environment_get_MachineName): removed warning when
32084         compiling under cygwin.
32086 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32088         * object.c: fixed field_get_value() for reference types.
32090 2002-08-22  Dick Porter  <dick@ximian.com>
32092         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
32093         Don't free a buffer while it's still needed.  Patch from Jonathan
32094         Liger <Jonathan.liger@wanadoo.fr>
32096 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
32098         * icall.c (ves_icall_System_Environment_get_Platform): Add new
32099         internal call.
32101 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
32103         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
32104         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
32106         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
32107         we call unmanaged code which throws exceptions.
32109 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32111         * appdomain.h: added per-domain entry_assembly.
32112         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
32113         arguments.
32114         * icall.c: Assembly::GetEntryAssembly icall.
32115         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
32116         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
32118 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32120         * appdomain.h, gc.c: added mono_domain_finalize ().
32122 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32124         * object.c:
32125         (mono_print_unhandled_exception): changed g_warning by g_printerr
32126         because g_log has a 1024 characters limit (yeah, i got a big stack
32127         trace). Don't print exception name, that should be in ToString 
32128         returned string.
32130 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32132         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
32133         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
32135 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32137         * object.c:
32138         (mono_print_unhandled_exception): after previous commit, i realized
32139         that MS calls ToString on the exception. I changed this function to
32140         do that. This way we get stack_trace for free.
32142 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32144         * object.c:
32145         (mono_print_unhandled_exception): invoke Message property instead of
32146         getting 'message' field from Exception. Don't allocate memory for
32147         'trace' and 'message' if not needed.
32149 2002-08-18  Dick Porter  <dick@ximian.com>
32151         * unicode.c: Fix asserts to match Encoder.cs checks
32153 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32155         * marshal.c: fix unaligned store issue and a few wrong
32156         opcode argument types.
32158 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32160         * icall.c: added GetUninitializedObjectInternal internal call.
32162 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
32164         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
32165         to the right domain.
32167 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
32169         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
32171         * class.c (class_compute_field_layout): set blittable to false for Strings
32173         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
32175 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32177         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
32178         first chunk of code to create types at runtime. Code to
32179         handle ReflectedType/DeclaringType. Make reflection handles
32180         domain specific.
32182 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
32184         * class.c: set correct name in arrays.
32186 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
32188         * appdomain.c (mono_domain_transfer_object): make it work with
32189         valuetypes. bug fixes.
32191 2002-08-12  Dick Porter  <dick@ximian.com>
32193         * object.h: Rename some parameters to avoid c++ keywords (Patch
32194         from Joseph Wenninger <kde@jowenn.at>)
32196 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
32198         * icall.c: added icall to implement Assembly.GetFile*.
32200 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32202         * reflection.h, reflection.c: code to embed managed resources.
32204 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
32206         * class.c: move all the type size stuff into
32207         class_compute_field_layout().
32209 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32211         * class.c: ensure enums have always the correct instance size.
32212         * unicode.c: remove wrong assert.
32214 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
32216         * assembly.c: fix mem corruption issue.
32217         * image.h, image.c: added mono_image_get_resource () to access
32218         managed resources.
32219         * icall.c: implemented Assembly.EntryPoint property and some
32220         Managed Resources related internalcalls.
32223 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
32225         * image.c, image.h: impemented mono_image_get_entry_point ().
32226         * appdomain.c: use mono_image_get_entry_point.
32228 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32230         * reflection.c: support the object type argument when loading
32231         custom attributes.
32233 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
32235         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
32236         String as return type.
32238 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
32240         * reflection.c: fix encoding of named args for custom attrs to match
32241         the ms implementation. Read them back when instantiating custom
32242         attributes.
32244 2002-08-02  Radek Doulik  <rodo@ximian.com>
32246         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
32247         by Dietmar as quick fix
32248         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
32249         16 as stack size, used on more places as quick fix before Dietmar
32250         will fix it properly
32252 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32254         * object.h, object.c: added accessors for fields and properties.
32256 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32258         * class.c, class.h: made mono_class_get_field_from_name ()
32259         loop on parent types.
32260         Added mono_class_get_property_from_name ().
32262 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32264         * class.c, class.h: move the code to setup the type vtable in its own
32265         function so that it can be reused also for types created at runtime.
32266         Eliminate the "class" identifier from the header file.
32267         * reflection.c: setup the vtable for enums so that we can create
32268         objects for use in SetConstant ().
32270 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
32272         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
32273         instead of the delegate itself as this pointer (bug #28383)
32275 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
32277         * marshal.c (mono_marshal_get_managed_wrapper): added return type
32278         conversions.
32280 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32282         * loader.c: don't set the pinvoke bit on icalls.
32284 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
32286         * debug-helpers.c (mono_method_full_name): only print a number to
32287         indicate wrapper type (so that the output is more readable in traces).
32289 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
32291         * class.c (mono_class_init): include method override patch from Paolo
32293 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
32295         * icall.c: fixed GetTypeCode().
32297 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
32299         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
32300         use real delegate invoke function to make it work with multicast
32301         delegates (fix bug# 28291).
32303 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32305         * object.c: load constant strings.
32307 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32309         * reflection.c: no magic numbers.
32310         * tabledefs.h: security action enum.
32312 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32314         * assembly.c: fix possible memory corruption.
32316 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32318         * reflection.h, reflection.c: added support for linking resources.
32319         * verify.c: check we have an updated corlib.
32321 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
32323         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
32324         string arrays.
32325         (mono_marshal_string_array): null terminate unmanaged string arrays.
32326         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
32328 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32330         * icall.c: Type.GetType () can now return also types from the
32331         calling assembly.
32333 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
32335         * loader.h, loader.c: stack walking support.
32336         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
32337         GetCallingAssembly.
32339 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
32341         * marshal.c: added optimisations for blittable types 
32343         * class.c (mono_array_class_get): do not set blittable attribute on arrays
32344         (mono_class_setup_mono_type): set blittable attribute for single
32345         and double.
32347         * marshal.c (mono_string_utf8_to_builder): impl.
32348         (mono_string_builder_to_utf8): impl.
32349         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
32351 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
32353         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
32354         (mono_marshal_get_managed_wrapper): impl. byref types
32356 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32358         * icall.c:
32359         (search_method): don't display debug message. 
32361 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
32363         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
32365 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
32367         * appdomain.c: set the missing filename when throwing exception.
32369 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
32371         * metadata.c (mono_type_size): code cleanup
32372         (mono_type_stack_size): removed some test code
32374 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
32376         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
32377         mono_get_exception_file_not_found now.
32379         * exception.c (mono_exception_from_name_two_strings): New version
32380         that will call a constructor with two string arguments. 
32381         (mono_get_exception_file_not_found): New helper routine, used to
32382         report file-not-found errors.
32384 2002-07-20  Dick Porter  <dick@ximian.com>
32386         * process.h:
32387         * process.c: Pass file handles to CreateProcess
32388         
32389         * icall.c:
32390         * file-io.h:
32391         * file-io.c: Implemented CreatePipe
32393 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
32395         * metadata.c (mono_get_param_info): set alignment for value types
32397 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32399         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
32400         Constify mono_domain_assembly_open().
32401         * loader.c: handle null namespace in icalls.
32403 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
32405         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
32406         (emit_str_to_ptr_conv): marshal object as structs
32408         * metadata.c (mono_type_to_unmanaged): marshal object as structs
32410         * marshal.c (mono_marshal_get_runtime_invoke): support value types
32412 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
32414         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
32415         (mono_marshal_get_native_wrapper): we an now return value types
32417 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32419         * verify.c: more checks implemented.
32421 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
32423         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
32424         (fix bug #27695)
32425         (mono_marshal_get_native_wrapper): allow byref arguments
32426         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
32427         impl. PtrToStringXXX methods
32428         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
32429         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
32430         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
32431         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
32432         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
32434 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32436         * reflection.c: fix buglet in parsing an assembly name.
32438 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
32440         * marshal.c (emit_ptr_to_str_conv): first impl.
32442 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
32444         * object.c, class.h: cache the vtable in the class as suggested by
32445         vargaz@freemail.hu (Zoltan Varga).
32447 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32449         * class.h, loader.c: added mono_field_from_token().
32450         * verify.c: first cut of type checking code.
32452 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
32454         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
32456 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
32458         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
32459         (fix bug #27782)
32460         (mono_marshal_get_remoting_invoke): impl.
32461         (mono_delegate_begin_invoke): impl.
32462         (mono_mb_emit_save_args): impl.
32463         (mono_delegate_end_invoke): impl.
32464         (mono_marshal_get_delegate_begin_invoke):
32465         (mono_marshal_get_delegate_end_invoke):
32466         (mono_marshal_get_delegate_invoke): generate a special name for
32467         those methods (including the signature) and associate them whith
32468         the delegate class. 
32470 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
32472         * reflection.[ch]: 
32473         (mono_reflection_type_from_name): now it has a MonoImage parameter
32474         which is used as the default image to search the type in. If the image
32475         is NULL or getting the type from it fails, it defaults to corlib.
32477         * icall.c: changed 1 call to mono_reflection_type_from_name to match
32478         new parameter.
32480 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32482         * reflection.c: update the parameter table index.
32484 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32486         * domain.c: don't include the mark byte in the string hash.
32488 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32490         * icall.cs: icall for Type.GetTypeCode ().
32491         * verify: a couple of fixes and disabled local initialization checks.
32493 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
32495         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
32497         * debug-helpers.c (mono_method_full_name): print the type of the
32498         runtime wrapper
32500         * metadata.c (mono_signature_hash): a hash function for signatures
32501         (mono_signature_hash): better hash algorithm
32503         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
32505         * debug-helpers.c (mono_method_full_name): this can now generate
32506         method names with signatures
32508         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
32509         method dont have this pointers.
32511 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
32513         * reflection.c: fixup typebuilder tokens.
32514         * image.c: fix buglet.
32515         * marshal.h: remove whitespace.
32516         * metadata.h, metadata.c: reinstate code that was removed.
32517         * verify.c: handle catch directives and fix another couple of bugs.
32519 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
32521         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
32522         (mono_marshal_get_native_wrapper): make it comp. with the old code
32523         (mono_marshal_get_native_wrapper): support boolean
32524         (mono_marshal_get_managed_wrapper): support more types
32526 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
32528         * class.c (class_compute_field_layout): compute class->blittable attribute.
32530 2002-07-09  Dick Porter  <dick@ximian.com>
32532         * threads.c: Make the thread cleaning up cope with threads that
32533         call ExitThread()
32535 2002-07-08  Radek Doulik  <rodo@ximian.com>
32537         * reflection.c (method_encode_code): use non-translated values to
32538         compute finally_start, this fixes exception handling on ppc, yay!
32540         * decimal.h (struct signscale): fix endianess
32542 2002-07-07  Radek Doulik  <rodo@ximian.com>
32544         * reflection.c: swap box_val and not val
32546 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
32548         * reflection.c, reflection.h: handle full assembly info in type name.
32549         Handle Type arguments when loading custom attributes.
32550         * icall.c: updated to use new mono_reflection_type_from_name () method.
32552 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32554         * loader.c:
32555         (method_from_memberref): also print assembly name when method not found.
32557 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32559         * icall.c:
32560         (ves_icall_TypeGetProperties): fixed bug #27473. 
32562 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32564         * reflection.c: display image name and token when cannot find the
32565         .ctor for an attribute.
32567 2002-07-05  Martin Baulig  <martin@gnome.org>
32569         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
32571 2002-07-04  Dick Porter  <dick@ximian.com>
32573         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
32574         compile on mingw.  This will cause mingw builds to not wait for
32575         subthreads to terminate after the main thread does.  I've lodged a
32576         bug with the mingw developers for them to wrap OpenThread().
32578 2002-07-03  Dick Porter  <dick@ximian.com>
32580         * threads.c: Store thread IDs instead of handles, because
32581         GetCurrentThread() returns a pseudohandle and therefore stores
32582         useless values.  mono_thread_cleanup() continues checking the
32583         array of threads until it is empty, to cope with subthreads
32584         spawning new threads after the main thread has finished.
32586         * profiler.h:
32587         * profiler.c:
32588         * profiler-private.h: Pass the thread ID to thread profiler
32589         functions, instead of a handle
32591 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32593         * verify.c: fixes to make it more usable.
32594         * pedump.c: added --verify code to verify IL code in an assembly.
32596 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32598         * reflection.c: turn errors into warnings to allow compiling corlib.
32600 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
32602         * reflection.c: add special cases to compile corlib.
32604 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32606         * reflection.c: handle properties with only a set method.
32608 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32610         * opcodes.h: add enum with opcodes in opval order.
32612 2002-07-01  Dick Porter  <dick@ximian.com>
32613         
32614         * object.h:
32615         * object.c (mono_runtime_run_main): Removed unneeded argument
32617 2002-06-28  Martin Baulig  <martin@gnome.org>
32619         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
32621 2002-06-27  Dick Porter  <dick@ximian.com>
32623         * threads.c: Store the handle in both the parent thread and in the
32624         subthread, to minimise the time between starting a new thread and
32625         storing its ID.
32627 2002-06-26  Dick Porter  <dick@ximian.com>
32629         * appdomain.c (mono_runtime_cleanup): Close the socket library
32630         after all the threads have finished, not before
32632 2002-06-26  Martin Baulig  <martin@gnome.org>
32634         * debug-symfile.c (mono_debug_find_source_location): Added
32635         `guint32 *line_number' argument.  If it's not NULL, store the line number
32636         there and return the file name without the line number.
32638 2002-06-25  Dick Porter  <dick@ximian.com>
32640         * icall.c:
32641         * process.h:
32642         * process.c: Process forking and other support functions
32644 2002-06-25  Dick Porter  <dick@ximian.com>
32646         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
32647         things dont happen when the image is closed.
32648         (mono_image_lookup_resource): Walk the resource section looking
32649         for a particular entry
32651         * cil-coff.h: PE resource section decoding
32653 2002-06-25  Dick Porter  <dick@ximian.com>
32654         
32655         * assembly.h:
32656         * assembly.c: 
32657         (mono_assembly_foreach): Accessor functions to walk the list of
32658         loaded assemblies
32659         (mono_assembly_set_main):
32660         (mono_assembly_get_main): Process methods need to know which
32661         assembly is the "main" one
32663         * object.c (mono_runtime_run_main): Record the main assembly
32665         * debug-helpers.c: Fix typo
32667 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
32669         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
32670         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
32672 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
32674         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
32676 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
32678         * image.c (do_mono_image_open): Initialize reference count,
32679         otherwise we leak the MonoImage.
32681 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
32683         * reflection.c: small tweak to handle self-hosting.
32685 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
32687         * reflection.c: fix type name parse code.
32689 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32691         * reflection.c: break out of the loop.
32692         * image.c: special case corlib.
32694 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32696         * reflection.c: add all the custom attrs at the end to ensure the
32697         ctors have been properly initialized when the attributes are defined
32698         in the current assembly.
32700 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32702         * reflection.c: handle correctly multiple-nested types.
32704 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
32706         * row-indexes.h: fix typos.
32707         * reflection.c: adjust for typos and fix method_def_or_ref
32708         encoding in MethodImpl table.
32710 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
32712         * reflection.c: fix entry point patching (thanks Serge!).
32714 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
32716         * verify.c: add check for System.Exception
32718 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32720         * image.c, class.c: minifix for code just c&p'ed.
32721         * reflection.c: warning fix.
32722         * object.h, loader.h, domain.c: load also StringBuilder.
32724 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32726         * marshal.h, marshal.c: some support code to handle complex marshaling.
32728 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32730         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
32731         Better signatures with vtable error dump.
32733 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
32735         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
32737 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
32739         * icall.c (ves_icall_Type_GetField): impl.
32741 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32743         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
32744         to retrieve a marshal description blob for a field or param.
32746 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
32748         * reflection.h, reflection.c: change order of nested type emission
32749         to avoid table corruption. The NestedTypes table is sorted.
32750         * icall.c: change order of GetConstructor results to workaround mcs bug.
32752 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
32754         * reflection.h, reflection.c: handle field and param marshal
32755         information.
32757 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32759         * icall.c, marshal.c marshal.h: more Marshal class implementation.
32761 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32763         * reflection.c: fix call convention.
32765 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32767         * reflection.h, reflection.c: mono_image_get_memberref_token()
32768         takes a type instead of a class, now. Added
32769         mono_image_get_array_token() to create tokens for the special
32770         multi-dim array methods.
32772 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
32774         * assembly.c: handle modules (no assembly table). Split
32775         loading references in its own function.
32776         * class.c: handle moduleref resolution scope.
32777         * image.c, image.h: cache module name in image.
32779 2002-06-07  Martin Baulig  <martin@gnome.org>
32781         * reflection.c (mono_image_get_type_info): Only add a class layout entry
32782         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
32784 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
32786         * icall.c: more signature fixes that used uint instead of int.
32788 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32790         * reflection.c: fixed signature of field refs.
32792 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32794         * class.c, reflection.c: handle typerefs of nested types
32795         (both on read and when writing files).
32797 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
32799         * icall.c: fix method signatures that tried to workaround the previous
32800         typo, d'oh!
32802 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
32804         * debug-helpers.c: fix typo.
32806 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
32808         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
32809         rewrote the PE/COFF writing code (our programs are understood by the
32810         ms runtime, now).
32812 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
32814         * gc.c, gc.h, icall.c: weakreference support.
32816 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32818         * Makefile.am, mono-config.c: use $(sysconfdir).
32820 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32822         * icall.c: changed default precision of Double.ToString() to 15.
32823         Fixed memory leak. Unified with Single.ToString.
32825 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
32827         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
32829 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
32831         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
32832         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
32833         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
32834         and myself.
32836 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32838         * debug-symfile.c, sysmath.c: yet more compilation fixes.
32840 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32842         * reflection.c, socket-io.c: more compilation fixes.
32844 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32846         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
32847         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
32848         unicode.c: warning and compiler compatibility fixes.
32850 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32852         * class.h, metadata.c: fixed warnings/compilation errors.
32854 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
32856         * Makefile.am, mono-config.c, mono-config.h: configuration file
32857         support routines.
32858         * loader.c, loader.h: make Dll mapping configurable at runtime in the
32859         config file. Export methods to insert and lookup mappings.
32861 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32863         * reflection.c: handle types and boxed objects in custom attr
32864         constructors.
32866 2002-05-30  Martin Baulig  <martin@gnome.org>
32868         * debug-symfile.c
32869         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
32871 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
32873         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
32874         to lookup the implmap row for a P/Invoke method.
32875         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
32876         P/Invoke method from the runtime on an as needed basis.
32878 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
32880         * metadata.c (mono_metadata_parse_signature): impl.
32882 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32884         * class.c: handle .pack directive.
32886 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
32888         * object.c: initialize static fields with RVA data.
32890 2002-05-25  Martin Baulig  <martin@gnome.org>
32892         * debug-symfile.c
32893         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
32895 2002-05-24  Martin Baulig  <martin@gnome.org>
32897         * debug-symfile.c
32898         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
32899         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
32900         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
32902 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32904         * object.c: special case string ctros in invoke.
32905         * gc.c: silly whitespace changes.
32907 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
32909         * threadpool.[ch]: impl. a threadpool that can
32910         be used by mint and mono.
32912 2002-05-22  Martin Baulig  <martin@gnome.org>
32914         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
32915         The first argument is now a `MonoReflectionModuleBuilder *', the return
32916         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
32917         `methods' field to get the method builder.  The `token' argument is the
32918         unfixed token.
32920         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
32921         invalid characters instead of g_assert_not_reached()ing.  This seems
32922         to be the behaviour of mscorlib.
32924 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
32926         * object.c (mono_runtime_invoke_array): applied patch from Rachel
32927         Hestilow to fix bug #25104
32929 2002-05-21  Martin Baulig  <martin@gnome.org>
32931         * debug-symfile.c (mono_debug_find_source_location): New function.
32932         Looks up an IL offset in the line number table and returns the source
32933         location as a string.
32935 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32937         * icall.c:
32938         (mono_double_ToStringImpl): changed %f by %g until we have something
32939         better.
32941 2002-05-21  Nick Drochak  <ndrochak@gol.com>
32943         * icall.c : Use different name for Math.Pow's icall.  Needed to check
32944         parameters first in C#.
32946 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32948         * icall.c, reflection.h: added icall to get info about an event.
32950 2002-05-20  Radek Doulik  <rodo@ximian.com>
32952         * object.c (mono_value_box): don't use memcpy for boxing on BIG
32953         endian
32954         (mono_value_box): don't use memcpy for small sizes on
32955         architectures with unaligned access
32957 2002-05-20  Martin Baulig  <martin@gnome.org>
32959         * reflection.c (mono_reflection_setup_internal_class): Don't crash
32960         if `tb->parent == NULL'.
32961         (mono_reflection_create_internal_class): New function.  This is
32962         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
32963         for enum types.
32965         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
32966         New interncall.
32968 2002-05-19  Martin Baulig  <martin@gnome.org>
32970         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
32971         argument to get the length, don't default to the array length.
32973 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
32975         * assembly.c (mono_assembly_setrootdir): New function used to
32976         override the MONO_ASSEMBLIES directory.
32978 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32980         * icall.c: ValueType_GetHashCode() initialize local var.
32982 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32984         * reflection.c: sort custom attributes table.
32986 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
32988         * reflection.c: support named args in custom attributes (write support).
32990 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
32992         * reflection.c: fix finally position calculation.
32994 2002-05-15  Radek Doulik  <rodo@ximian.com>
32996         * reflection.c: fixed endianess at many places
32998         * icall.c (ves_icall_InitializeArray): comment out debug msg
33000 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
33002         * object.c (mono_unhandled_exception): new function to handle
33003         unhandled exceptions.
33004         (mono_unhandled_exception): call the UnhandledException event.
33005         (mono_runtime_delegate_invoke): impl.
33007 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
33009         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
33010         returns the RVA, not the direct pointer to the data. Handle the case
33011         when the class size is fixed.
33013 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33015         * reflection.c: fix some endianess issues.
33017 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
33019         * object.c (mono_runtime_invoke): is now able to catch exceptions.
33021         * threads.c (mono_thread_init): added a callback which is invoked
33022         at thread start.
33024 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
33025         
33026         * icall.c: make GetHashCode return non-negative values.
33028 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
33030         * object.c, icall.c, gc.c: revert to address-based hashcode.
33032 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
33034         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
33036 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33038         * icall.c, class.c: special case <Module>.
33040 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
33042         * icall.c: fix bug in GetNow().
33044 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
33046         * object.c (mono_runtime_class_init): make sure that we call all
33047         static class constructors.
33049 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33051         * reflection.c: sort methodsemantics table.
33053 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33055         * reflection.h, reflection.c: honour init locals setting.
33057 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
33059         * icall.c: copied Double ToStringImpl for Single ToStringImpl
33061 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33063         * reflection.c: support ContructorBuilders in attribute blob creation.
33065 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33067         * reflection.c: some changes to build a binary that can be run
33068         directly in windows.
33070 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
33072         * loader.c: print a big message when an icall can't be found.
33074 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33076         * string-icalls.c: fix bug 24248.
33078 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
33080         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
33081         icall.c, reflection.h: separate assembly loading by pathname and by
33082         assembly name. Use the MONO_PATH env var to search for assemblies.
33084 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33086         * assembly.c, image.h: add some support for assemblies
33087         with multiple modules.
33088         * class.c, class.h: export mono_class_from_typeref().
33089         * loader.c: remove duplicated code and use mono_class_from_typeref(),
33090         instead.
33092 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33094         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
33095         documentation says (the ECMA one is correct).
33097 2002-05-02  Dick Porter  <dick@ximian.com>
33099         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
33100         Don't name the synchronisation mutex.
33102 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
33104         * rand.c
33105         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
33106         Make the prototypes match.
33107         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
33108         Same.
33110         * icall.c
33111         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
33112         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
33113         all systems have tm.tm_zone, so use strftime() with %Z to print
33114         the timezone abreviation into a temp string.
33116         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
33117         rather than mono_array_addr() on a MonoString on Big Endian
33118         machines.
33120 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
33122         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
33123         fix bug 24041
33125 2002-04-30  Dick Porter  <dick@ximian.com>
33127         * socket-io.c: Cope with SOCKET being an integer rather than a
33128         pointer now.
33130         * threads.c: Added Thread_free_internal, to deal with thread
33131         handle cleanup.  Moved calls to handle_store() and handle_remove()
33132         to start_wrapper(), so each can only be called once.  Allocate
33133         synchronisation blocks with GC_malloc(), and use GC finalisation
33134         to close the handles.
33136         * icall.c: added System.Threading.Thread::Thread_free_internal
33138 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33140         * icall.c: support Environment.Exit, CommandLineArgs().
33142 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33144         * object.c, object.h: added mono_runtime_run_main () and
33145         mono_runtime_get_main_args () for use in System.Environment.
33147 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33149         * gc.c: fix thinko, enable actual finalization since the jit is now
33150         fixed.
33152 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33154         * gc.c, object.c: take into account that an object may be offset wrt the address
33155         returned by GC_malloc().
33157 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
33159         * image.c: handle files without entries in the assembly table (modules).
33161 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
33163         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
33164         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
33165         allowed to be null when it's System.Object class setup.
33167 2002-04-27  Martin Baulig  <martin@gnome.org>
33169         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
33170         if `tb->parent == NULL' rather than crashing.
33172 2002-04-28  Nick Drochak  <ndrochak@gol.com>
33174         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
33175         calling acos() where asin() should have been called.
33177 2002-04-26  Martin Baulig  <martin@gnome.org>
33179         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
33180         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
33181         there's a subdirectory called `System', but we don't want to read that
33182         subdirectory as an assembly.
33184 2002-04-25  Martin Baulig  <martin@gnome.org>
33186         * debug-symfile.c: Reflect latest MonoString changes.
33188 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33190         * rand.c, rand.h: instance method icalls need to have an explicit
33191         this pointer as first argument in the C implementation.
33193 2002-04-25  Nick Drochak <ndrochak@gol.com>
33195         * icall.c: Fix typo in map for GetNonZeroBytes
33197 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33199         * string-icalls.c : String does now passes unit tests without any 
33200         errors, the following changes has been made:
33201         
33202         Implemented replace methods.
33203         Renaming of methods to (try) follow the standard.
33204         Fixed compare ordinal
33205         Made all memory allocated directly to function instead of via icall function.
33206         Small performance fix in is_in_array function
33207                         
33208  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
33210         c (mono_string_Internal_ctor_charp_int_int):
33211         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
33212         sindex < 0, throw ArgumentOutOfRangeException instead of
33213         ArgumentNullException.
33215         Added new check for length == 0, however
33216         I need to make it return String.Empty from the C code.
33217         
33218         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
33219         that calculate the length for us here.
33220         
33221         (mono_string_Internal_ctor_sbytep_int_int): Replaced
33222         mono_string_new_utf16 with mono_string_new, since value is utf8.
33224 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33226         * object.c: register the object for finalization if needed.
33227         Allocate one more char in the string for the terminating 0 char.
33229 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33231         * class.c, class.h, image.c: check if a type implemenst a destructor.
33232         Use the proper key for array class lookups.
33233         * icall.c: register the icalls in the System.GC class.
33234         * gc.c, gc.h: GC-related functions and icalls.
33236 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33238         * icall.c:
33239         * socket-io.c:
33240         * unicode.c: free some strings gotten from mono_string_to_utf8 and
33241         changed a couple of free () by g_free ().
33243         * decimal.c: one-liner in the comments for decimal2string ().
33245 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33247         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
33249 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33251         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
33252         * object.c (mono_runtime_invoke_array) : handle null in params
33254 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33256         * string-icalls.c: fixed bug in split (one off bug)
33258 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33260         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
33261         * icalls.c: added String::Equals as internal method
33263 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33265         * threads.c: fixed bug in the double interlocked functions
33267 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
33269         * threads.c: implemented all of the new interlocked icalls.
33270         * string-icalls.c: fix a bug in insert.
33271         * icalls.c: added the icalls for interlocked, removed old string functions.
33272         
33273 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33275         * loader.c: fix off-by-one error when reading argument names.
33277 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33279         * profiler.c: win32 counter implementation (untested).
33280         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
33281         (the latter needs testing and more complete impl. from win32 folks).
33283 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
33285         * object.c: mono_array_new_full workaround mono_array_class_get
33286         problem.
33288 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33290         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
33291         * object.h (mono_string_chars): Changed casting type.
33293 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33295         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
33296                            method signatures to use gunichar2 instead of gint16.
33298 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
33300         * object.h, object.c: domain-specific versions of mono_object_new and
33301         mono_array_new.
33303 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
33305         * object.c: changed String layout
33307         * string-icalls.c (mono_string_Internal_ctor_chara): added
33308         internal string constructors.
33310 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
33312         * threads.c: pass 'this' to the thread start routine.
33314 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33316         * string-icalls.c: fix IndexOf and LastIndexOf. Now
33317         InternalCompareStr don't call twice mono_string_cmp_char for the last
33318         character. Improved performance in mono_string_cmp_char.
33320 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33322         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
33323         code into its own library: libmonoruntime.
33325 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
33327         * object.h, object.c: changed array format so that szarrays do not
33328         require a bounds structure.
33329         * icall.c, appdomain.c: support for new szarray format.
33331 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
33333         * metadata.c: compare also the retuns type when comparing signatures:
33334         we didn't do this as an optimization since really overloaded methods
33335         must differ also in the arguments, but this doesn't work with
33336         low-level IL code (or when using explicit conversion operators: see
33337         bug#23498 for an example).
33339 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33341         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
33343 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33345         * icall.c: make MonoType::GetElementType its own icall.
33347 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33349         * icall.c: remove MonoMethod_get_Name().
33350         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
33351         object.
33353 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33355         * string-icalls.c: optimized a few methods.
33357 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33359         * icall.c: added all new string internal calls
33360         * string-icalls.c: added, new string internal call implementation.
33361         * object.c: added mono_string_new_size for allocating a string a size
33363 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
33365         * object.c (mono_object_isinst): use the same code as in the
33366         optimized x86 version.
33368 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33370         * profiler.c: TSC-based timer code (faster and more accurate).
33371         Not hooked up in configure, yet (set USE_X86TSC to 1).
33373 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
33375         * profiler.c, profiler.h: track time spent compiling methods.
33376         * threads.c: track thread creation/destruction.
33378 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
33380         * profiler.c, profiler.h, profiler-private.h: profiling interface
33381         and sample implementation. Moved here so that it can be used also by
33382         the jit.
33384 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
33386         * reflection.c, reflection.h: keep types and other handles separate in
33387         the hash tables for referred tokens. Add guid for modules.
33389 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
33391         * assembly.c: fix bugs found with valgrind.
33392         * metadata.h, metadata.c: added mono_metadata_guid_heap().
33394 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
33396         * threads: added icall support for getting current domain for
33397                    the thread.
33399 2002-04-13  Martin Baulig  <martin@gnome.org>
33401         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
33402         (MonoDebugVarInfo): Added `index' field for register based addresses.
33403         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
33404         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
33405         `MonoDebugVarInfo *params' and `guint32 this_offset' with
33406         `MonoDebugVarInfo *this_var'.
33408         * debug-symfile.c (relocate_variable): New static function to write
33409         a location description for a local variable or method parameter.
33411 2002-04-12  Martin Baulig  <martin@gnome.org>
33413         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
33414         stack offset and begin/end scope address of a local variable.
33415         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
33416         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
33417         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
33419         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
33420         Added new relocation types for start/end scope of a local variable.
33422 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33424         * object.h: add mono_object_domain() macro.
33425         * reflection.c: handle typespecs.
33426         * icall.c: MonoMethod::get_Name() implementation.
33428 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33430         * icall.c: String::GetHashCode() icall implementation.
33432 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33434         * icall.c: String::IndexOfAny icall.
33435         * object.c, object.h: make array->max_length more useful.
33436         Intrduced mono_object_class() and mono_string_length() macros.
33438 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33440         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
33441         instead of g_unichar_isdigit.
33443 2002-04-11  Nick Drochak  <ndrochak@gol.com>
33445         * icall.c: Implement a simple Double.ToString().
33447 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33449         * appdomain.h: only io-layer.h is supposed to be included.
33450         * icall.c: explicitly import environ. Fix warning.
33452 2002-04-10  Nick Drochak  <ndrochak@gol.com>
33454         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
33455                 return true even if it's not Daylight Savings time.
33456                 Only return false for the case where the function isn't
33457                 implemented for a plaform (read Windows).
33459 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33461         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
33462         data with a mutex.
33464 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
33466         * mempool.c (mono_mempool_alloc): only use g_malloc when
33467         absolutely necessary.
33469 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
33471         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
33473         * class.c (mono_class_vtable): use domain mempool to allocate vtable
33474         (mono_class_proxy_vtable): use domain mempool
33476 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
33478         * appdomain.h, appdomain.c: split initialization that requires the
33479         execution engine support into mono_runtime_init().
33481 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
33483         * class.c (mono_class_init): don't include vtable inside MonoClass
33484         to save some memory, gather some statistics.
33485         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
33487 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33489         * icall.c: internalcall implementation for ValueType.Equals().
33491 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
33493         * object.c (mono_message_init): moved 
33494         (mono_runtime_exec_main): new arch. independent impl.
33495         (mono_runtime_invoke_array): new method - like
33496         mono_runtime_invoke, but you can pass an array of objects.
33497         (mono_remoting_invoke): new arch. independent impl.
33498         (mono_message_invoke): new arch. independent impl.
33499         (mono_runtime_class_init): new arch. independent impl.
33500         (mono_runtime_object_init): new arch. independent impl.
33502 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33504         * metadata.c, object.c, reflection.c: documented the exported
33505         functions.
33507 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
33509         * icall.c: simpler code to pass the assembly builder data to corlib.
33510         Implement GetNestedTypes() internalcall.
33512 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33514         * class.c: warn if a type can't be loaded.
33516 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
33518         * image.h: typedef MonoImageOpenStatus
33519         * types.h: removed unused file
33520         
33521 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
33523         * icall.c: Enum_ToObject accepts enum value arguments.
33525 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
33527         * class.c: move initialization of properties, events and nested
33528         classes, so that they happen for interfaces, too.
33530 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33532         * icall.c: cleanup some ugly casts in Array_SetValue*.
33534 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33536         * icall.c: the values array fro enums is of the correct type, now.
33537         Implement (correctly) getFullName instead of assQualifiedName for
33538         MonoType.
33539         * reflection.h, reflection.c: added mono_type_get_name ().
33541 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33543         * assembly.c, image.h: for each MonoImage, record from wich assembly
33544         it was loaded.
33545         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
33546         Make Type.Assembly work.
33548 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
33550         * debug-symfile.h: use char* instead of gpointer to avoid
33551         unnecessary casts.
33553         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
33555         * icall.c (ves_icall_InternalExecute): impl. FielSetter
33556         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
33558 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
33560         * icall.c (mono_message_init): impl. (code cleanup)
33561         (ves_icall_InternalExecute): impl. FieldGetter
33563         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
33564         defined we call all (non-static)methods through the vtable. 
33566 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
33568         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
33569         finalizer even though the memory is still referenced (and the chunk of
33570         memory is not freed).
33572 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
33574         * assembly.c: fix brokeness.
33576 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
33578         * class.c: kill some warnings. Check explicit interface method
33579         implementation also without considering the namespace.
33580         Load also literal strings in static class data.
33582 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
33584         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
33585         (default_assembly_name_resolver): Make the resolver take the
33586         "base" directory where the assembly was originally defined, so we
33587         can load DLLs that are in the same directory as the assembly that
33588         is being referenced.
33590 2002-03-28  Dick Porter  <dick@ximian.com>
33592         * file-io.h: 
33593         * file-io.c:
33594         * socket-io.c: 
33595         * unicode.h: 
33596         * unicode.c: Warning cleanups
33598 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
33600         * object.h, reflection.h: use the correct type instead of MonoObject.
33602 2002-03-28  Martin Baulig  <martin@gnome.org>
33604         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
33605         (mono_debug_update_symbol_file): Initialize classes if necessary.
33607 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
33609         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
33610         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
33612 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
33614         * assembly.h: fix function prototype.
33615         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
33616         * mono-endian.h: use const cast.
33618 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
33620         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
33622 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
33624         * loader.c: don't assert when a typeref can't be loaded, give
33625         a chance to the runtime to trow an exception instead.
33626         * loader.h: fix warning.
33628 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
33630         * class.c (mono_class_proxy_vtable): added proxy support
33632 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
33634         * icall.c: removed last of PAL calls, added System.Environment
33635         * file-io.h, file-io.c: MonoIO implementation
33636         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
33638 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
33640         * appdomain.c: do not use the byte marker in ldstr table lookup.
33641         * debug-helpers.c: allow two ':' to separate class and method name.
33642         * object.c: allocate arrays bounds with the GC, too.
33643         * verify: add a few more checks.
33645 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
33647         * reflection.c: output also literal strings. Allocate parameter data
33648         with GC_malloc() (thanks, Martin, for catching this!).
33650 2002-03-26  Martin Baulig  <martin@gnome.org>
33652         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
33653         include the `this' offset in the `param_offsets'.
33655 2002-03-25  Martin Baulig  <martin@gnome.org>
33657         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
33658         mono_debug_get_class() function to get the classes. Added new
33659         relocation types for arrays and strings.
33660         (mono_debug_get_class): New static function to search in all
33661         referenced assemblies for a metadata token.
33663         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
33665 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
33667         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
33668         hold gc-allocated objects. Make the string heap a stream like the
33669         others. Removed duplicated code when writing stream info.
33670         Added asserts to catch possible buffer overflows. Set the sorted map
33671         for tables that need sorting. Added some documentation.
33673 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
33675         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
33676         for interned strings and vtables.
33678 2002-03-24  Martin Baulig  <martin@gnome.org>
33680         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
33681         it in the array since it was created with g_slist_prepend().
33683 2002-03-24  Martin Baulig  <martin@gnome.org>
33685         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
33686         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
33687         (mono_debug_method_from_token): Renamed to
33688         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
33689         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
33691         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
33692         relocation types.
33694         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
33696 2002-03-24  Martin Baulig  <martin@gnome.org>
33698         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
33699         (mono_debug_method_from_token): New func.
33701         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
33702         New interncall, calls mono_debug_local_type_from_signature().
33703         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
33704         calls mono_debug_method_from_token().
33706 2002-03-23  Martin Baulig  <martin@gnome.org>
33708         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
33709         specifies the number of bytes to be converted, not the array size.
33710         Return the number of chars, not the number of bytes.
33711         (ves_icall_iconv_get_chars): The `byteCount' argument
33712         specifies the number of bytes to be converted, not the array size.
33714 2002-03-23  Martin Baulig  <martin@gnome.org>
33716         * reflection.h (MonoReflectionSigHelper): New type.
33718         * reflection.c (mono_reflection_sighelper_get_signature_local),
33719         (mono_reflection_sighelper_get_signature_local): New functions.
33721         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
33722         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
33723         interncalls.
33725 2002-03-23  Martin Baulig  <martin@gnome.org>
33727         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
33728         is_writeable is set.
33729         (mono_raw_buffer_update): New function to write the modified map
33730         back to disk.
33732         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
33734         * debug-symfile.c (mono_debug_update_symbol_file): Call
33735         mono_raw_buffer_update() when done writing.
33737 2002-03-23  Martin Baulig  <martin@gnome.org>
33739         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
33741         * debug-symfile.c: Added support for arguments and local variables.
33743 2002-03-23  Dick Porter  <dick@ximian.com>
33745         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
33746         protected by ifdefs, hence breaking the w32 build.
33748 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33750         * object.c: implement is_interned() the right way.
33752 2002-03-21  Martin Baulig  <martin@gnome.org>
33754         * debug-symfile.[ch]: New files to handle debugging information
33755         files. There's also support to dynamically update these symbol
33756         files to include machine dependent information.
33758 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
33760         * threads.c (mono_thread_create): new function to create thread
33761         from C
33763 2002-03-20  Martin Baulig  <martin@gnome.org>
33765         * icall.c (ves_icall_InternalInvoke): Create a new object if the
33766         method is a constructor.
33767         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
33768         points to ves_icall_InternalInvoke().
33770 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
33772         * file-io.c: Flush shouldn't throw exceptions.
33774 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
33776         * file-io.c: FileStream flush support; FileSetLength now
33777         restores file pointer.
33779 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
33781         * class.c: set image for pointer classes.
33783 2002/03/19  Nick Drochak <ndrochak@gol.com>
33785         * sysmath.c: Forgot one.
33787 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
33789         * sysmath.c: Avoid redefining existing names.
33791 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
33793         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
33794         handled by runtime as icall rather than dllimport from libm.so
33795         * file-io.c, file-io.h: fixed handle argument type.
33797 2002-03-18  Dick Porter  <dick@ximian.com>
33799         * reflection.c (mono_image_get_type_info): rename interface to
33800         iface, because of "#define interface struct" on windows.
33802 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
33804         * class.c, class.h: rename and export mono_ptr_class_get().
33805         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
33806         * reflection.c, reflection.h, icall.c: better/saner type name
33807         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
33808         method signatures.
33810 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
33812         * class.c (mono_class_init): removed hardcoded GHC_SLOT
33814         * icall.c (ves_icall_InternalInvoke): impl.
33816 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
33818         * reflection.c: output the interface map table, too.
33820 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
33822         * class.c (class_compute_field_layout): separate computation of 
33823         static field layout
33825 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
33827         * icall.c: added System.Buffer support.
33828         * file-io.c: moved file icalls from PAL to FileStream.
33830 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
33832         * icall.c (ves_icall_System_Object_GetHashCode): impl.
33834 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
33836         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
33838 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
33840         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
33842 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
33844         * debug-helpers.{c,h}: moved here from monograph some useful functions
33845         to locate a method by name/signature in a class or image. Included
33846         also a small and flexible IL disassembler.
33848 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
33850         * reflection.c: fixup tokens in methods with small header size, too.
33852 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
33854         * object.c (mono_string_to_utf8): remove assert(!error), instead
33855         print a warning. 
33857 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
33859         * icall.c: update to the new mono_Array_class_get interface.
33861 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
33863         * appdomain.c, object.c: Boehm-GC enable.
33864         * icall.c: make get_data_chunk() support split data requests.
33865         Ensure a class is initialized in more cases. Return only the first
33866         property found in GetProperties() or the compiler gets confused. 
33867         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
33868         * reflection.h, reflection.c: add fixup mechanism for field and method
33869         tokens. Initialize assembly->typeref in a single place. Output
33870         properties after events. Support custom attributes for events, too.
33871         Typo fix for paramter custom attrs.
33873 2002-03-07  Martin Baulig  <martin@gnome.org>
33875         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
33877 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
33879         * class.c (mono_array_class_get): fix. for multi. dim. arrays
33881 2002-03-06  Martin Baulig  <martin@gnome.org>
33883         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
33884         non-zero lower bounds. See testcases #F10-#F13.
33886 2002-03-05  Martin Baulig  <martin@gnome.org>
33888         * exception.c (mono_get_exception_argument_out_of_range): New exception.
33890         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
33891         ves_icall_System_Array_GetValue(), only calculate the absolute array position
33892         here.
33893         (ves_icall_System_Array_SetValue): Likewise.
33894         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
33895         as argument and does the actual work. This function is used when copying a
33896         multi-dimensional array.
33897         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
33898         now do all the widening conversions of value types.
33899         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
33901 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33903         * class.c: remove some magic numbers and use the smbolic names,
33904         instead. Added init_events() to load event info at class init time.
33905         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
33906         and mono_metadata_methods_from_event().
33907         * reflection.h, reflection.c: added support for writing out the evnets
33908         related information.
33910 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
33912         * reflection.h, icall.c: use a different method (GetInterfaces)
33913         to gather interface info and add isbyref, isprimitive and
33914         ispointer to the ves_icall_get_type_info() return value.
33916 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
33918         * class.h: stared adding support for events.
33919         * icall.c: split find_members implementation. Added debug icall to get
33920         the address of an object.
33921         * reflection.c: handle TypeBuilders in mono_type_get_object().
33923 2002-03-01  Martin Baulig  <martin@gnome.org>
33925         * icall.c (ves_icall_System_Array_GetLength): This must throw an
33926         ArgumentOutOfRangeException(), not an ArgumentException().
33927         (ves_icall_System_Array_GetLowerBound): Likewise.
33928         (ves_icall_System_Array_GetValue): Improved argument checking.
33929         (ves_icall_System_Array_SetValue): Improved argument checking.
33931 2002-03-01  Martin Baulig  <martin@gnome.org>
33933         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
33934         called with invalid arguments rather than just dying with g_assert().
33935         (ves_icall_System_Array_SetValue): Likewise.
33936         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
33937         raise a NotImplementedException instead.
33938         (ves_icall_System_Array_GetLength): Added argument checking.
33939         (ves_icall_System_Array_GetLowerBound): Added argument checking.
33941 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
33943         * object.h (mono_assert): new macros mono_assert and
33944         mono_assert_not_reached
33946 2002-02-28  Martin Baulig  <martin@gnome.org>
33948         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
33949         and "System::String::IsInterned" to "System::String::_IsInterned".
33951 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
33953         * icall.c: remove hacks for typebuilder. Added icall to create a
33954         modified type from a tybebuilder.
33955         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
33956         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
33957         to create a backing MonoClass for a TypeBuilder.
33959 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
33961         * class.c, class.h: more refactoring of class init.
33962         Export mono_class_setup_mono_type() and mono_class_setup_parent().
33964 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
33966         * marshal.c, marshal.h: start of marshaling interface.
33968 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
33970         * icall.c: fix order in assembly qualified name icall.
33972 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
33974         * class.c: do not free str, since we store it in the hash table.
33975         * reflection.h: add label field to MonoILExceptionInfo.
33976         * reflection.c: handle references to more than one assembly. Handle
33977         case when there isn't a module created in the assembly.
33979 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
33981         * class.c: Fix typo. Start refactoring of class init code.
33983 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
33985         * appdomain.c: exit with 1 on error.
33986         * class.c: we already have the name in MonoClassField.
33987         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
33988         MonoStreamHeader instead of an offset of image->raw_metadata.
33990 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
33992         * appdomain.c (mono_init): Be even more descriptive about the error.
33994 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
33996         * appdomain.c: give the user an informative message when corlib can't
33997         be loaded.
33999 2002-02-26  Martin Baulig  <martin@gnome.org>
34001         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
34002         New icall to get the time zone data.
34004 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
34006         * reflection.c: set virtual and raw size of section correctly.
34007         * threads.c: transfer domain information to newly created threads.
34009 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
34011         * class.c: when instancing a class in a domain, load the default
34012         vaules for static fields from the constant table. Fix System.Enum to
34013         not be an enum.
34014         * icall.c: implement Object::GetType() internalcall. Implemented
34015         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
34016         Fixed checking of binding flags in find_members().
34017         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
34018         * reflection.c: handle enumerations when writing to the constant
34019         table. Use a different object cache for types.
34022 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
34024         * object.c (mono_object_isinst): fix for arrays
34026         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
34028 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
34030         * object.c: don't use mprotect ()  and fix intern pool hash table
34031         lookup for big endian systems.
34033 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
34035         * icall.c: change type_is_subtype_of () signature.
34037 2002-02-21  Mark Crichton  <crichton@gimp.org>
34039         * rand.c, rand.h: Added random number generator for
34040         System.Security.Cryptography classes.
34042         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
34044         * icall.c: Added System.Security.Cryptography calls.
34046 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
34048         * class.c, icall.c, metadata.c: better support for pointer types.
34049         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
34050         * reflection.c: Add support for getting custom attrs for properties
34051         and simplify some code.
34053 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
34055         * icall.c: change getToken () and add custom attribute GetBlob()helper
34056         method.
34057         * reflection.h: add custom attrs array to the reflection builder structures.
34058         * reflection.c: encode and emit custom attributes for all the relevant
34059         reflection objects. Cache fieldref and methodref tokens. Change
34060         mono_image_create_token() interface to take a MonoDynamicAssembly.
34061         More complete custom attributes decoder. Load custom attributes for
34062         Assembly, Field, Method and Constructor objects, too. Make the
34063         returned array an Attribute[] one, not object[]. Added
34064         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
34065         custom attribute constructor.
34067 2002-02-20  Dick Porter  <dick@ximian.com>
34069         * icall.c:
34070         * rawbuffer.c:
34071         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
34072         problem code out for now).
34074 2002-02-19  Radek Doulik  <rodo@ximian.com>
34076         * object.c (mono_ldstr): use hash table to avoid multiple swapping
34078 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
34080         * icall.c: register the GetCustomAttributes method.
34081         * object.c, object.h: add mono_string_new_len ().
34082         * reflection.h, reflection.c: added mono_runtime_invoke(),
34083         mono_install_runtime_invoke(). Added
34084         mono_reflection_get_custom_attrs () to load custom attributes and
34085         create the attribute objects.
34087 2002-02-19  Dick Porter  <dick@ximian.com>
34088         * threads-dummy-types.c:
34089         * threads-dummy-types.h:
34090         * threads-dummy.c:
34091         * threads-dummy.h:
34092         * threads-pthread-types.c:
34093         * threads-pthread-types.h:
34094         * threads-pthread.c:
34095         * threads-pthread.h:  Deleted obsolete files
34097 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
34099         * class.c (mono_class_vtable): runtime init the class when we
34100         allocate static class data.
34102         * icall.c (ves_icall_System_Array_SetValue): check for null values.
34104         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
34105         and String - but we will need generic marshalling support in the
34106         future. 
34107         (mono_init): set the domain name in a ms compatible way
34109         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
34110         String[].
34112 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
34114         * object.c (mono_array_clone): use alloca() instead of g_malloc  
34115         for sizes
34117         * appdomain.c (mono_domain_unload): impl.
34119 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
34121         * appdomain.c, object.c: fix intern pool implementation.
34122         * class.c: fix alignment code.
34124 2002-02-16  Radek Doulik  <rodo@ximian.com>
34126         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
34127         and s2 > s1, just copy lower bytes to be compatible with little
34128         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
34129         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
34131         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
34132         force big_endian to be 1 for big endian machines 
34133         (ves_icall_iconv_new_decoder): ditto
34135 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
34137         * socket-io.c (convert_sockopt_level_and_name): If the system
34138         doesn't define SOL_IP or SOL_TCP, get them by hand using
34139         getprotobyname() and caching the values (because this could be a
34140         slow operation).
34141         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
34142         Use the appropriate struct when the system does support it. Ie,
34143         not all systems have struct ip_mreqn so use struct ip_mreq when
34144         appropriate.
34146 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
34148         * reflection.c: handle finally clauses.
34150 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
34152         * socket-io.c: use g_snprintf() instead of snprintf.
34154 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
34156         * reflection.c (mono_param_get_objects): Cast second argument to
34157         mono_method_get_param_names to a const char** to silence the
34158         compiler warning.
34160         * appdomain.c (mono_domain_assembly_open): Put parens around the
34161         truth statement in the for-loop.
34163         * unicode.c (iconv_convert): Got rid of a compiler warning about
34164         int i being unused when the system has a new iconv.
34165         (iconv_get_length): Same.
34167         * image.c (load_class_names): Cast the second argument to
34168         g_hash_table_insert() to char* to hush compiler warnings about the
34169         arg being a const.
34170         (mono_image_open): Same here.
34172         * socket-io.c: Don't conditionally include sys/filio.h or
34173         sys/sockio.h here anymore since we now get them from
34174         io-layer/io-layer.h
34175         (inet_pton): If the system doesn't support inet_aton, implement
34176         using inet_addr and also #define INADDR_NONE if it isn't defined
34177         by the system.
34179 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
34181         * metadata.c, metadata.h: added function to get packing and size info
34182         of a typedef.
34183         * reflection.h, reflection.c: handle field RVA data. Save info about
34184         the table layout if needed. Assign typedef indexes to all the types
34185         before dumping the info about them to avoid forward reference problems.
34187 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
34189         * socket-io.c (convert_sockopt_level_and_name): ifdef
34190         SO_ACCEPTCONN because it is not defined on my system (old debian)
34192 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
34194         * opcode.c: use stddef.h to get NULL.
34196 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
34198         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
34199         for FIONBIO, FIONREAD and SIOCATMARK.
34200         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
34201         define INADDR_NONE and besides, inet_addr() is deprecated and
34202         should not be used. Use inet_pton() instead - it also has the
34203         added bonus that it can easily handle IPv6 addresses as well.
34204         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
34206 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
34208         * decimal.c: remove _MSC_VER conditional.
34210 2002-02-13  Dick Porter  <dick@ximian.com>
34212         * socket-io.c: 
34213         * icall.c: Internal calls for Blocking, Select, Shutdown,
34214         GetSocketOption and SetSocketOption
34216 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34218         * assembly.cs: better resolver: use it instead of some kludgy
34219         code.
34221 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
34223         * reflection.c: the best way to speed-up the compiler is to avoid
34224         infinite loops.
34226 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
34228         * class.c (mono_class_vtable): changed the object layout
34229         (obj->vtable->class). 
34230         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
34232 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34234         * assembly.c: look for assemblies in the assembly dir, too.
34236 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
34238         * class.c: fix thinko in mono_class_from_type().
34240 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
34242         * exception.h, exception.c: added TypeLoadException.
34243         * object.h, object.c: added mono_array_clone ().
34244         * icall.c: handle throwOnError in AssemblyGetType().
34245         Added Array.Clone().
34246         * opcode.h, opcode.c: use a single value for the opcode val.
34247         Compile fix for non-gcc compilers.
34249 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
34251         * opcodes.c, opcodes.h: export interesting info about opcodes.
34253 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
34255         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
34256         icalls. 
34258         * class.c (class_compute_field_layout): set element_class for enums
34259         (mono_class_create_from_typedef): set element_class for normal classes
34261         * icall.c (ves_icall_System_Enum_get_value): impl.
34263         * class.c (mono_class_create_from_typedef): do not set valuetype
34264         flag for System.ValueType and System.Enum
34266 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
34268         * unicode.c (iconv_convert): fix big endian problem.
34270 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
34272         * class.c: add asserts if we are ever going to scribble over memory.
34273         * socket-io.c: not all systems have AF_IRDA defined.
34275 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
34277         * class.c (class_compute_field_layout): do not consider static
34278         fields to compute alignment
34280 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
34282         * appdomain.c (mono_appdomain_get): impl.
34283         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
34285 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
34287         * icall.c: ignore "file://" prefix when loading an assembly.
34289 2002-01-23  Dick Porter  <dick@ximian.com>
34291         * socket-io.c:
34292         * icall.c:
34293         * Makefile.am: Added socket support
34295 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
34297         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
34298         code back.  This should return the assemblies that are loaded by
34299         the runtime on behalf of an application domain. 
34301         The current implementation is still broken, it just returns every
34302         assembly loaded, but until we get real applications domain this
34303         will do.
34305 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
34307         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
34308         AppDomain object.
34310 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
34312         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
34313         the mono_class_from_name lookup.
34314         (ves_icall_get_parameter_info): ditto.
34315         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
34316         method.
34317         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
34319 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
34321         * class.c: load also nested classes on class init.
34322         System.ValueType instance methods gets passed boxed
34323         values, unless methods in derived classed that get a pointer to the
34324         data.
34325         * icall.c: use better name parsing code in GetType().
34326         * image.c, image.h: add mono_image_loaded ().
34327         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
34328         * reflection.c, reflection.h: added mono_reflection_parse_type().
34330 2002-01-22  Veronica De Santis <veron78@interfree.it>
34332         * icall.c : Added mapping of internal calls for Manual and Auto reset events
34333         * threads.c : Added the implementation of internal calls for events
34334         * threads.h : Added prototypes of internal calls for events
34335         
34336 2002-01-21  Radek Doulik  <rodo@ximian.com>
34338         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
34340 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
34342         * class.c (mono_class_init): set min_align to 1 (instead of 0)
34343         (mono_class_value_size): use min_align
34345 2002-01-20  Dick Porter  <dick@ximian.com>
34347         * threads.h:
34348         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
34349         so it compiles on w32.
34351 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
34353         * metadata.c (mono_type_stack_size): impl.
34355         * class.c (mono_class_get_field): impl. memberref token
34357 2002-01-16 Veronica De Santis <veron78@@interfree.it>
34359         * icall.h : Added the internal calls mapping for CreateMutex_internal
34360                     and ReleaseMutex_internal.
34361         * threads.h : Added the prototype of mutexes internal calls.
34362         * threads.c : Added the implementations of mutexes internal calls.
34364 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
34366         * metaparse.h: removed unused file.
34367         * reflection.c, reflection.h: added stream_data_align () function 
34368         to align data in streams and keep stream aligned. Add support for
34369         exception support in method headers.
34371 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
34373         * unicode.c: make iconv_convert () return the number of bytess written
34374         in the output buffer.
34376 2002-01-15  Dick Porter  <dick@ximian.com>
34377         * threads.c: Make the runtime's idea of infinite timeouts coincide
34378         with the class library's
34380         Fix a particularly egregious bug in mono_thread_cleanup(). That
34381         code was so utterly bogus it must have been written on a Monday.
34383 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
34385         * reflection.h: add subtypes field to TypeBuilder.
34386         * reflection.c: encode constants for literal fields.
34387         Handle subtypes. Fix user string token (and add a zero byte)
34388         at the end.
34389         
34390 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
34392         * class.c (mono_class_init): bug fix: assign slot numbers for
34393         abstract methods.
34395 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
34397         * reflection.c: don't try to output a code RVA for abstract methods.
34398         Small fixes for method header format. Output parameter info to the
34399         ParamDef table. Save method overriding info to MethodImpl table.
34400         Fix property support. Allow typedef.extends to be a type in the
34401         building assembly.
34402         * verify.c: fix off-by-one error.
34404 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
34406         * class.c: fix mono_class_from_mono_type () for szarray types.
34407         Remove unused cache check in mono_class_from_type_spec().
34408         * icall.c: *type_from_name () functions handle simple arrays and byref.
34409         * reflection.c: handle byref and szarray types. Handle methods without
34410         body (gets P/Invoke compilation working). Handle types and fields in
34411         get_token ().
34412         * reflection.h: add rank to MonoTypeInfo.
34414 2002-01-10  Dick Porter  <dick@ximian.com>
34416         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
34417         internal calls
34419 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
34421         * icall.c: initialize class in type_from_handle ().
34422         Loop also in parent classes for get_method ().
34423         * reflection.c: properly encode class and valuetype types.
34424         Start on encoding TypeBuilder types. Handle fieldrefs.
34425         Use correct length when registering a user string.
34426         Handle ConstructorBuilder and MonoMethod in get_token ().
34427         Make mono_type_get_object () aware of cached types.
34428         * object.c: back out change to mono_string_new ().
34430 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
34431         * object.c: mono_string_new should return a NULL when the string 
34432         passed in is NULL -- not try to deference it.
34433         
34434 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
34436         * icall.c: hack to make IsSubType work for TypeBuilders.
34437         * reflection.c: emit constructors before methods.
34438         Retrieve param names in mono_param_get_objects().
34440 2002/01/05  Nick Drochak  <ndrochak@gol.com>
34442         * Makefile.am: fix list of headers and sources so automake 1.5
34443         doesn't complain. Removed \# at end of list.
34445 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
34447         * reflection.c: get token for a method ref. Set return type of
34448         constructor to void.
34449         * loader.c: debug message.
34450         * class.c: typo fix.
34452 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
34454         * icall.c: fix array init with rank > 1. FindMembers
34455         loops in parent class as well.
34456         * image.c: do not insert nested types in name cache.
34457         * reflection.c: warning fix.
34458         * reflection.h: add override method (for interface impl).
34460 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
34462         * metadata.c: fix customattr decoding.
34464 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
34466         * rawbuffer.cs: Added native Win32 implementation, avoids using
34467         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
34469 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
34471         * class.c: make the low-level routines handle the cache.
34473 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
34475         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
34477 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
34479         * class.c: fix mono_array_element_size() for objects.
34480         * class.h, class.c: add properties to MonoClass and load them
34481         at init time.
34482         * icall.c: check with isinst() when assigning a value to an array
34483         instead of requiring the classes to match exactly.
34484         Implemented icall for System.Type::GetType().
34485         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
34486         enums. Handle bindingflags when looking for methods and fields.
34487         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
34488         and mono_metadata_methods_from_property().
34489         * reflection.h, reflection.c: added structures for propreties,
34490         parameters and enums. Implemented mono_property_get_object() and
34491         mono_param_get_objects().
34493 2001-12-18  Dick Porter  <dick@ximian.com>
34495         * file-io.c: Use mono_string_to_utf16() instead of
34496         mono_string_chars()
34498         * object.c: Added mono_string_to_utf16(), which copies the non
34499         NULL-terminated MonoString into a new double-null-terminated
34500         buffer.
34502 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
34504         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
34506 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
34508         * file-io.c: raise exceptions if handle is invalid.
34510 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
34512         * assembly.c: yet another check for mscorlib.
34513         * class.c, class.h: load nesting info for classes.
34514         * icall.c: many new functions to support the Reflection classes.
34515         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
34516         * reflection.h, reflection.c: mono_image_create_token(),
34517         mono_assembly_get_object(), mono_type_get_object(),
34518         mono_method_get_object(), mono_field_get_object(): methods to return
34519         objects that parallel the C representation of assemblies, types,
34520         methods, fields.
34522 2001-12-11  Dick Porter  <dick@ximian.com>
34524         * icall.c:
34525         * file-io.c: Internal calls for file IO.
34527 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
34529         * tabledefs.h: missing FileAttributes.
34530         * verify.h, verify.c: use is_valid_string () to simplify and check for
34531         valid strings more correctly. Fix warnings and speeling.
34532         Check more tables: Filed, File, ModuleRef, StandAloneSig.
34533         Check code: branches, maxstack, method calls.
34535 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
34537         * object.c (mono_object_allocate): removed static, so that the jit
34538         can allocate value types.
34540         * icall.c (ves_icall_System_DateTime_GetNow): impl.
34542 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34544         * class.c: init enum types right away and register the
34545         token->MonoClass map in mono_class_create_from_typedef ().
34546         * verify.h, verify.c: first cut of the verifier.
34547         * pedump.c: add --verify switch to verify metadata tables.
34548         * tabledefs.h: add some missing enums.
34550 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
34552         * class.c (mono_install_runtime_class_init): impl.
34553         (mono_class_init): renamed mono_class_metadata_init to
34554         mono_class_init, also removed the metadata_inited flag
34556         * object.c (mono_object_isinst): use faster algorithm
34558 2001-11-30  Radek Doulik  <rodo@ximian.com>
34560         * mono-endian.h: reverted last change
34561         added function prototypes
34563         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
34564         add mono-endian.c back
34566         * mono-endian.c: returned back, as Paolo pointed out, it's needed
34567         for unaligned access, I've mistaked it with endianess. I am
34568         sorry.
34569         (mono_read16): fix reverted endianess
34570         (mono_read64): ditto
34571         (mono_read32): ditto
34573 2001-11-30  Dick Porter  <dick@ximian.com>
34575         * exception.c: Implement mono_exception_from_name()
34577 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
34579         * metadata.h, metadata.c: remove params_size and locals_size and their
34580         calculation from the metadata code: they are only usefult to the
34581         interp.
34583 2001-11-29  Radek Doulik  <rodo@ximian.com>
34585         * object.c (mono_ldstr): swap bytes here, it's probably not the
34586         best place, but works for me now, I'll redo it once I know mono
34587         better, also note that I add PROT_WRITE and don't reset back, also
34588         note that it's only affects big endians, so x86 should be OK
34590         * mono-endian.h (read16): use just glib macros for both endians
34592         * mono-endian.c: removed as glib macros are used in in
34593         mono-endian.h so we don't need to care about endianess for read
34594         macros as glib does that for us already
34596 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
34598         * class.h, class.h: take minimum alignment into consideration so
34599         that the fields of a class remain aligned also when in an array.
34601 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34603         * loader.h, loader.c: add mono_method_get_param_names().
34604         * class.c: 0-init class fields.
34606 2001-11-26  Dick Porter  <dick@ximian.com>
34608         * icall.c:
34609         * threads-types.h:
34610         * threads.c: New file that handles System.Threading on all platforms
34612         * object.c: 
34613         * object.h: Remove the synchronisation struct from MonoObject,
34614         replace it with a pointer that gets initialised on demand
34616         * Makefile.am: Replace all the system-specific threading code with
34617         a single file that uses the new wrapper library
34619 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
34621         * class.c, class.h: add mono_install_trampoline() so that the runtime
34622         can register a function to create a trampoline: removes the ugly
34623         requirement that a runtime needed to export arch_create_jit_trampoline.
34624         * object.h, object.c: added mono_install_handler() so that the runtime
34625         can install an handler for exceptions generated in C code (with
34626         mono_raise_exception()). Added C struct for System.Delegate.
34627         * pedump.c: removed arch_create_jit_trampoline.
34628         * reflection.c: some cleanups to allow registering user strings and
34629         later getting a token for methodrefs and fieldrefs before the assembly
34630         is built.
34631         * row-indexes.h: updates and fixes from the new ECMA specs.
34633 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
34635         * class.h, class.c: add enum_basetype field to MonoClass.
34636         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
34637         to get index in the constant table reated to a field, param or
34638         property.
34639         * reflection.h, reflection.c: handle constructors. Set public-key and
34640         version number of the built assembly to 0.
34641         * row-indexes.h: update from new ECMA spec.
34643 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
34645         * class.h, class.c: add a max_interface_id to MonoClass.
34646         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
34647         since it's used to do that. Added mono_type_type_from_obj().
34648         Make GetType() return NULL instead of segfaulting if the type was not
34649         found. Handle simple arrays in assQualifiedName.
34650         * object.h: add a struct to represent an Exception.
34651         * reflection.c: output call convention in method signature.
34652         Add code to support P/Invoke methods and fixed offsets for fields.
34654 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
34656         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
34657         the value.
34658         * icall.c: use mono_array_addr instead of array->vector: fixes the
34659         reflection image writing.
34660         * reflection.c: init call convention byte to 0 in method signature.
34661         Encode the property signature. Don't output property-related methods
34662         twice. Really process the properties for a type (don't cast a field to
34663         a property, my mom always told me that).
34664         Fix 64 bit issues in pointer alignment in a different and more
34665         readable way.
34667 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
34669         * loader.h: Removed type class from MonoDefaults, added monotype
34671         * loader.c: Loaded MonoType, removed loading of Type
34673         * icall.c (my_mono_new_object): Now returns a System.MonoType,
34674         and fills in System.Type._impl with a RuntimeTypeHandle rather
34675         than the actual MonoClass *
34677         (ves_icall_type_from_handle): change from type_class to
34678         monotype_class
34680         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
34681         implemented
34683         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
34684         implemented
34686         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
34688         (ves_icall_System_Reflection_Assembly_GetType): implemented
34690         (ves_icall_System_MonoType_assQualifiedName): implemented
34692         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
34694 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
34696         * assembly.c (mono_assembly_open): Implement a cache for the
34697         assemblies. 
34699         (mono_assembly_close): only destroy the assembly when the last
34700         reference is gone.
34701         
34702 2001-11-09  Dick Porter  <dick@ximian.com>
34704         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
34706 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
34708         * class.c (mono_class_metadata_init): bug fix: compute the right slot
34710 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
34712         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
34713         from Martin Weindel.
34714         * object.h: add mono_string_chars ().
34716 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
34718         * reflection.c (build_compressed_metadata): Eliminates warnings
34719         and uses 64-bit clean code.
34721         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
34722         (mono_type_equal): Change signature to eliminate warnings.
34724 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34726         * icall.c, loader.c: remove the internalcall array constructors.
34727         Changes to match the new MonoArray structure.
34728         * object.h, object.c: an array object doesn't allocate an extra
34729         vector. Add mono_array_new_full () to create jagged arrays easily.
34731 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
34733         * metadata.h, metadata.c: add mono_metadata_field_info () to
34734         retreive all the info about a field from vairous tables.
34735         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
34736         * class.h, class.c: augment MonoClassField with more info.
34737         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
34738         policy and load a field's RVA if needed.
34740 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
34742         * class.c (mono_class_metadata_init): create a trampoline for all
34743         virtual functions instead of actually compiling them.
34745 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
34747         * class.h, class.c: include name in MonoClassField.
34748         * class.c: fix fundamental type of System.Object and System.String.
34749         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
34750         tokens in ldtoken.
34751         * icall.c: remove internalcalls for the Reflection stuff that is now
34752         done in C# code.
34753         * loader.c: mono_field_from_memberref () implementation.
34754         * mono-endian.c: thinko (s/struct/union/g).
34755         * object.c, object.h: make the mono_string_* prototypes actually use
34756         MonoString instead of MonoObject.
34757         * reflection.c, reflection.h: updates for changes in the reflection
34758         code in corlib: we use C structures that map to the actual C# classes.
34759         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
34760         fat method header if needed and use the info from the ILGenerator for
34761         methods. Handle fields in types. Misc fixes.
34763 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
34765         * class.c (mono_class_metadata_init): bug fix: always allocate
34766         space for static class data
34768 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
34770         * class.c (mono_compute_relative_numbering): use relative
34771         numbering to support fast runtime type checks.
34773 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
34775         * class.c (mono_class_create_from_typeref): added debugging output
34776         to print class name when MonoDummy is returned instead of real class
34778 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
34780         * class.c (mono_class_metadata_init): interface offset table now
34781         contains pointers into the vtable - this is more efficient for the jit
34783 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
34785         * class.c (mono_class_metadata_init): use a temporary vtable (the
34786         old algorithm only worked for the interpreter, but not for the jit)
34788 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
34790         * loader.c (method_from_memberref): use mono_class_get to get the
34791         class of an array instead of using System.Array directly.
34792         (mono_get_method): also add MEMBERREF methods to the method cache
34793         which usefull for arrays.
34795 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
34797         * pedump.c (arch_compile_method): added to compute vtable entry
34799         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
34800         number of interfaces.
34801         
34802         * class.h: merged MonoArrayClass into MonoClass
34804         * class.c (mono_class_create_from_typedef): compute the vtable size and
34805         allocate space to include the vtable inside MonoClass
34806         (mono_class_metadata_init): initialize the vtable
34808 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
34810         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
34811         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
34812         * image.c: endian fixes by Laurent Rioux.
34813         * object.h, object.c: rename MonoStringObject to MonoString and
34814         MonoArrayObject to MonoArray. Change some function names to conform to
34815         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
34816         guint16* as first argument, so don't use char*.
34817         Provide macros to do the interesting things on arrays in a portable way.
34818         * threads-pthread.c: updates for the API changes and #include <sched.h>
34819         (required for sched_yield()).
34820         * icall.c: updates for the API changes above.
34821         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
34822         platforms that need them.
34824 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
34826         * class.c: set the correct type for all the fundamental
34827         type when loading the class.
34829 2001-10-05  Dick Porter  <dick@ximian.com>
34831         * threads-pthread.c (pthread_mutex_timedlock): Simple
34832         compatibility version for C libraries that lack this call.
34834 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
34836         * class.c: MonoTypes stored in MonoClass are stored as
34837         fundamental MonoTypes when the class represents a
34838         fundamental type (System.Int32, ...).
34839         The TypeHandle return by ldtoken is a MonoType*.
34840         * icall.c: ves_icall_get_data_chunk () write out all the
34841         PE/COFF stuff. Implement ves_icall_define_method (),
34842         ves_icall_set_method_body (), ves_icall_type_from_handle ().
34843         * image.c: properly skip unknown streams.
34844         * loader.h, loader.c: add type_class to mono_defaults.
34845         * metadata.c, metadata.h: export compute_size () as
34846         mono_metadata_compute_size () with a better interface.
34847         Typo and C&P fixes.
34848         * pedump.c: don't try to print the entry point RVA if there is no entry point.
34849         * reflection.c, reflection.h: many cleanups, fixes, output method
34850         signatures and headers, typedef and typeref info, compress the metadata
34851         tables, output all the heap streams, cli header etc.
34852         * row-indexes.h: typo fixes.
34854 2001-10-04  Dick Porter  <dick@ximian.com>
34856         * object.h: Add a synchronisation mutex struct to MonoObject
34858         * object.c (mono_new_object): Initialise the object
34859         synchronisation mutexes
34861         * icall.c: System.Threading.Monitor internal calls
34862         
34863         * threads-pthread.h:
34864         * threads-pthread.c: System.Threading.Monitor internal calls
34866         * threads-types.h: New file, includes the system-specific thread
34867         structures
34868         
34869         * threads-pthread-types.h:
34870         * threads-pthread-types.c: New files, handle pthread-specific
34871         synchronisation types
34873         * threads-dummy-types.h: 
34874         * threads-dummy-types.c: New files of dummy support for
34875         thread-specific types
34877         * metadata.c:
34878         * image.c:
34879         * pedump.c: include mono-endian.h not endian.h
34880         
34881         * Makefile.am: More threads files.
34882         Name mono-endian.h not endian.h
34884 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
34886         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
34887         stuff and implement a few more bits.
34888         * icall.c: a field needs to be dereferenced twice. Do not use the same
34889         name for two variables in the same scope.
34890         * image.c, image.h: cleanups.
34892 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
34894         * class.c (mono_class_metadata_init): bug fix: compute the right size
34896 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
34898         * icall.c: implemented some of the Reflection internalcalls.
34899         * image.c, image.h: start writing out the PE/COFF image.
34900         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
34901         that does the reverse than decode_blob_size ().
34902         * object.c: use mono_metadata_encode_value (). Move here
34903         temporary implementation of mono_string_to_utf8 ().
34904         * rawbuffer.c: make malloc_map static.
34906 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
34908         * metadata.c: fix type comparison for arrays.
34909         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
34910         Added a couple of new classes to monodefaults.
34911         * icall.c: added a couple of Reflection-related internalcalls.
34912         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
34913         Added a byval_arg MonoType to MonoClass.
34915 2001-09-28  Dick Porter  <dick@ximian.com>
34917         * icall.c:
34918         * threads-pthread.h: 
34919         * threads-pthread.c: Implemented internal calls for
34920         LocalDataStoreSlot operations.  Applied mutexes around all shared
34921         data.  Reworked the thread creation and Start() operations to
34922         avoid a race condition.
34923         
34924         * threads-dummy.h:
34925         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
34927 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
34929         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
34931 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
34933         * class.c, loader.c: warn and return NULL instead of erroring out.
34934         * icall.c: added System.AppDomain::getCurDomain().
34935         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
34937 2001-09-25  Dick Porter  <dick@ximian.com>
34939         * threads-pthread.h:
34940         * threads-pthread.c: Implemented timed thread joining and added
34941         System.Threading.Thread::Join_internal internal call
34943         * icall.c: Added System.Threading.Thread::Join_internal internal call
34945         * threads-dummy.h:
34946         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
34948 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
34950         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
34951         mono_string_intern () to implement the semantics of the ldstr opcode
34952         and the interning of System.Strings.
34953         * icall.c: provide hooks to make String::IsIntern and String::Intern
34954         internalcalls.
34956 2001-09-23  Dick Porter  <dick@ximian.com>
34958         * threads-dummy.c: 
34959         * threads-dummy.h: New files of dummy threading routines
34961         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
34962         support code based on system specifics
34964         Rename PTHREAD_LIBS to THREAD_LIBS
34965         
34966 2001-09-23  Dick Porter  <dick@ximian.com>
34968         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
34969         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
34970         internal calls.
34971         (mono_thread_init): Set up a Thread object instance to return when
34972         the main thread calls Thread.CurrentThread
34973         (mono_thread_cleanup): Wait for all subthreads to exit
34975         * icall.c: New internal calls for System.Threading.Thread::Sleep
34976         (including Schedule) and CurrentThread
34978         * threads.h: New file, to insulate thread-specific stuff from the
34979         rest of the code
34981 2001-09-21  Dick Porter  <dick@ximian.com>
34983         * threads-pthread.h: 
34984         * threads-pthread.c: New file, for handling pthreads-style
34985         threading support.  Start() now starts a new thread and executes
34986         the ThreadStart delegate instance.
34988         * icall.c: Added the internalcall for
34989         System.Threading.Thread::Start_internal
34991         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
34993 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
34995         * loader.c: work around the different signatures for delegates
34996         constructors csc generates in compiled code vs the ones compiled in mscorlib.
34998 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
35000         * class.h, class.c: add mono_class_get_field_from_name ().
35001         * *: Fix C comments and other ANSI C issues.
35003 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
35005         * endian.h, assembly.c: fix some endianness issues.
35007 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
35009         * loader.h, load.c: add delegate_class to mono_defaults.
35010         Handle runtime provided methods in mono_get_method ().
35012 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
35014         * loader.c (mono_get_method): use pinvoke for internal call
35016         * icall.c: use pinvoke for internal call
35018         * loader.c (method_from_memberref): set the method name
35020 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
35022         * metadata.c: help the compiler generate better code for
35023         mono_class_from_mono_type ().
35025 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
35027         * class.c (mono_class_metadata_init): delayed computing of the
35028         class size to mono_class_metadata_init ()
35030 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
35032         * class.c, class.h: add an interfaces member to MonoClass.
35033         * image.c, image.h: add assembly_name field to MonoImage
35034         from the assembly table.
35035         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
35037 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
35039         * class.c: Handle Array in mono_class_from_mono_type ().
35040         * metadata.c, pedump.c: some endian fixes.
35042 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
35044         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
35045         * metadata.c: fix small problem introduced with the latest commit.
35047 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
35049         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
35050         We don't need a MonoMetadata pointer anymore to compare signatures in
35051         mono_metadata_signature_equal (), update callers.
35052         Reduced memory usage an number of allocations for MonoMethodHeader and
35053         MonoMethodSignature.
35055 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
35057         * metadata.c: added compare for szarray.
35059 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
35061         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
35062         and add a couple more types to it and mono_defaults. Give an hint on
35063         classes that need implementing in our corlib and are referenced
35064         in mscorlib.
35066 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
35068         * class.h, class.c: keep track if a class is also an Enum.
35069         * loader.c: Implement a couple more types for use in libffi
35070         marshalling. Gives better diagnostics when failing to dlopen
35071         a library. Set method->klass for P/Invoke methods, too.
35073 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
35075         * class.c, class.h: add a MonoType this_arg to MonoClass that
35076         represents a pointer to an object of the class' type that
35077         can be used by the interpreter and later the type cache.
35078         Add best guess alignment info for valuetype objects.
35080 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
35082         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
35083         into MonoType: one less level of indirection and allocation and
35084         simplifies quite a bit of code. Added cache for MonoTypes that are
35085         used frequently, so that we don't need to allocate them all the time.
35087 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
35089         * class.c (mono_class_create_from_typedef): System.Enum is also a
35090         value type, although it does not derive from System.ValueType
35091         (maybe a bug in the ms compiler?)
35093         * metadata.c (mono_type_size): return the right size for value types
35095         * loader.c (mono_get_method): only initialize method header if not abstract
35097         * class.c (mono_class_from_mono_type): use mono_default values. 
35099 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
35101         * *: use MonoClass pointers instead of <type_tokens>
35102         
35103         * class.h: new flag: metadata_inited.
35105         * class.c (mono_class_metadata_init): impl.
35106         (mono_class_instance_size): impl.
35107         (mono_class_data_size): impl.
35109 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
35111         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
35112         MonoClass now has the name and name_space fields. 
35113         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
35114         mono_get_method () takes and optional MonoClass as argument.
35115         Removed mono_typedef_from_name() and added mono_class_token_from_name()
35116         instead that takes advantage of a map from class names to typedef
35117         tokens in MonoImage.
35119 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
35121         * metadata.c: zero is not a valid alignment boundary.
35122         Merge MONO_TYPE_VOID in default decoding code.
35124 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
35126         * image.h: merged MonoMetadata into MonoImage
35128         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
35129         identify the type of elements.
35131 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
35133         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
35134         * cil-coff.h: split MonoMSDOSHeader and add size info.
35135         * image.c: add some consistency checks.
35136         * metadata.c: fix row size computation: one programmer
35137         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
35138         add explanation for the locator routine.
35139         Fix decoding of size in method header.
35140         
35141 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
35143         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
35144         (g_concat_dir_and_file): Bring g_concat_dir_and_file
35145         function from gnome-libs.  This uses the right path separator
35146         based on the OS, and also works around a bug in some systems where
35147         a double slash is not allowed. 
35148         (default_assembly_name_resolver): Use g_concat_dir_and_file
35149         (mono_assembly_open): ditto.
35151 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
35153         * metadata.c (mono_metadata_signature_equal): impl.
35155         * *: void is now a realy MonoType (instead of using NULL)
35156         
35157         * metadata.c (do_mono_metadata_parse_type): use
35158         mono_metadata_parse_type to parse void value.
35160 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
35162         * metadata.c, metadata.h: in the signature and method header store
35163         only the space required for holding the loca vars and incoming arguments.
35165 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
35167         * metadata.c (do_mono_metadata_parse_type): treat void like any
35168         other type (instead of assigning NULL);
35170 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
35172         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
35174 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
35176         * image.c (do_mono_image_open): added a cache for arrays.
35178 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
35180         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
35181         decode a single column from a row in a metadata table and changes
35182         to take advantage of it in the typedef locator (gives a nice speed up).
35183         Store offset info for function params.
35185 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
35187         * image.h (MONO_IMAGE_IS_CORLIB): removed 
35189 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
35191         * assembly.c: how could mono_assembly_close () had ever worked?
35192         * metadata.c, metadata.h: provide offset info for local vars.
35193         Implement mono_type_size () to take care of alignment as well
35194         as size (it was mono_field_type_size in cli/class.c before).
35196 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
35198         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
35200         * assembly.h (CORLIB_NAME): set to corlib.dll
35202         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
35204 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
35206         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
35207         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
35208         tokentype.h: massive namespace cleanup.
35210 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
35212         * metadata.h, metadata.c: decode exception clauses when parsing method header.
35214 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
35216         * metadata.c (mono_metadata_free_type): added check for type !=
35217         NULL (void) before calling mono_metadata_free_type()
35219 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
35221         * metadata.h, row_indexes.h: added header with enumerations to use
35222         to index in the columns from tables in metadata and to decode coded
35223         tokens: we should start using this instead of embedding magic numbers
35224         all over the code.
35226 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
35228         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
35229         Move metadata_t info from cli_image_info_t to MonoImage, where
35230         it's easily accessible. Changed all the uses accordingly.
35231         Added the method and class caches to MonoImage.
35232         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
35233         and mono_metadata_decode_value () signature to be more consistent
35234         with the other parse functions (and simplify code). Taken advantage
35235         of zero-length array allocation with GCC. Removed reduntant (and
35236         wrong) MonoFieldType struct and use MonoParam instead. Changed
35237         mono_metadata_parse_field_type () to use common code for parsing.
35238         Added mono_metadata_typedef_from_field () and
35239         mono_metadata_typedef_from_method () to lookup a typedef index from a
35240         field or method token.
35241         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
35243 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
35245         * metadata.c (mono_metadata_parse_field_type): Implement. 
35246         (do_mono_metadata_parse_type): Split engine from
35247         mono_metadata_parse_type, so that we can create smaller structures
35248         for things that just have one pointer to the MonoType (look at
35249         the MonoFieldType)
35251 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
35253         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
35254         as Jan Gray found out, it is incorrect. 
35256 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
35258         * assembly.c: Implement asssembly loading.  This loads an image
35259         and loads all the referenced assemblies.  Come to think of it, we
35260         could always do lazy loading of the assemblies. 
35262         * image.c (mono_image_open): Keep loaded images in a hashtable.
35264         * image.h (MonoImage): Add reference count.
35266 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
35268         * assembly.c (mono_assembly_open): Keep track of the file name in
35269         case the assembly has no ASSEMBLY table.
35271         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
35272         from get.c here.
35274 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
35276         * metadata.c, metadata.h: decode local vars in method header
35277         parse function. Change callers accordingly.
35279 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
35281         * metadata.h, cil-coff.h: protect against multiple inclusion.
35282         Added some new structures to hold information decoded from metadata:
35283         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
35284         and relevant decoding/free functions.
35285         * metadata.c: implement decoding functions. Add warning for out of bounds
35286         index in mono_metadata_locate(). Implement mono_get_method () to retreive
35287         all the info about a method signature and invocation. Remove check on
35288         uninitialized local var in parse_mh() and fix memory leak.
35290 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
35292         * metadata.h: More macros.
35294         * tokentype.h: New file.
35296 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
35298         * assembly.c: added a consistency check and initialize
35299         some structures with g_new0().
35300         * metadata.c: fixed a couple more bugs in table size computation
35301         and add other checks for out-of bound access to metadata.
35303 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
35305         * metatada.c: fix bugs computing table sizes. Spew a
35306         warning when index in string heap is out of bounds.
35308 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
35310         * metadata.h: Add a couple of macros to manipulate tokens. 
35312 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
35314         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
35315         cli_section_tables).
35317 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
35319         * metadata.c (mono_metadata_user_string): New function, provides
35320         access to the UserString heap. 
35322 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
35324         * metadata.c: Add inline documentation.
35326 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
35328         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
35329         files. 
35331 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
35333         * typeattr.h: New file, TypeAttribute flags. 
35335 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
35337         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
35338         mono_assembly_ensure_section): Section loading code.
35339         (load_section_tables): Load the sections.
35341         * mono/metadata/metadata.c (mono_metadata_locate_token,
35342         mono_metadata_locate): Functions to locate the information
35343         definition given a token or a table and an index.
35344         (mono_metadata_compute_table_bases): New.
35345         (compute_size): New function to compute the sizes of the various
35346         tables.
35348         * mono/metadata/metadata.h: Finish listing the different index
35349         types. 
35351         * mono/metadata/pedump.c: Improve to dump new information.
35353 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
35355         * mono/metadata/metadata.c: Entered all the tables matching
35356         Beta2. 
35358         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2