2010-01-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / metadata / ChangeLog
blobad118fb031db427f19afbd9b893006ce98d7f061
1 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
3         * object.c (mono_object_get_virtual_method): Handle generic interfaces with variant
4         arguments.
6 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
8         * icall.c (ves_icall_Remoting_RemotingServices_GetVirtualMethod): This
9         function is generics variance aware.
11 2010-01-19  Sebastien Pouliot  <sebastien@ximian.com>
13         * security-core-clr.c (mono_security_core_clr_can_access_internals):
14         Handle the case where 'basedir' can be NULL (e.g. SRE assemblies)
16 2010-01-19  Sylvain Dupont <duposyl@gmail.com>
18         * cominterop.c marshal.c: Added support for marshalling in, in/byref,
19           in/out, in/out/byref parameters of type SAFEARRAY[VARIANT].
21         Code is contributed under MIT/X11 license.
23 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
25         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Handle inflated generic methods
26         on a GTD.
28 2010-01-19  Zoltan Varga  <vargaz@gmail.com>
30         * marshal.c (mono_marshal_wrapper_info_from_wrapper): New helper function to
31         return a point to a wrapper specific info structure describing the wrapper.
32         (mono_marshal_get_array_address): Store the rank+elem_size in the wrapper info.
34 2010-01-18  Zoltan Varga  <vargaz@gmail.com>
36         * sgen-gc.c (mono_gc_base_init): Add 'conservative_stack_mark' option to turn
37         off precise marking if it is available.
38         (mono_gc_get_bitmap_for_descr): Fix the handling of run length descriptors.
40 2010-01-17  Zoltan Varga  <vargaz@gmail.com>
42         * sgen-gc.c (mono_gc_conservatively_scan_area): Resurrect this.
44         * sgen-pinning.c (evacuate_pin_staging_area): Don't assert if there are no
45         pinned objects.
47         * sgen-gc.c (create_allocator): Add the missing n > MONO_ARRAY_MAX_INDEX check
48         to the array allocator.
50 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
52         * generic-sharing.c (instantiate_other_info): Don't create ftnptr's from the
53         result of mono_compile_method (), it already includes an ftnptr.
55 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
57         * metadata.c (get_image_set): Remove an assert which can happen in normal use.
59 2010-01-15  Zoltan Varga  <vargaz@gmail.com>
61         * metadata.c (mono_metadata_str_hash): New helper function to compute a stable
62         hash value which doesn't depend on glib/eglib versions.
63         (mono_metadata_type_hash): Use it.
65         * object.c (mono_method_get_imt_slot): Ditto.
67 2010-01-14  Rodrigo Kumpera  <rkumpera@novell.com>
69         * class.c (mono_type_has_exceptions): Check the generic instance. It can fail
70         independently of the GTD.
72         * class.c (mono_class_setup_fields): Fail if field has negative offset.
74         * class.c (mono_class_setup_fields): Fail if valuetype has zero size. Add sizeof(MonoObject)
75         to the upper limit since instance_size includes this amount.
77         * class.c (mono_class_layout_fields): Check if the types of the static fields have failed.
79         Fixes #569544.
81 2010-01-14  Zoltan Varga  <vargaz@gmail.com>
83         * object.c (build_imt_slots): Compute the vtable slot correctly for interfaces
84         with static methods.
86         * object.c (build_imt_slots): Avoid asserting when static methods are
87         encountered in an interface.
89 2010-01-13  Mark Probst  <mark.probst@gmail.com>
91         * sgen-gc.c (to_space_expand): Fix assertion.
93 Wed Jan 13 15:42:28 CET 2010 Paolo Molaro <lupus@ximian.com>
95         * string-icalls.c: missing declaration fixes.
96         * sgen-gc.c: portability fixes.
98 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
100         * class.c (mono_class_get_implemented_interfaces): Now take a MonoError argument.
102         * class.c:
103         * cominterop.c:
104         * icall.c:
105         * object.c: 
106         * class-internals.h: Adjust for new signature of mono_class_get_implemented_interfaces.
108 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
110         * class.c (mono_class_setup_interfaces): Now take a MonoError argument and
111         it can fail loading the type.
113         * class.c: Add mono_class_inflate_generic_class_checked.
115         * class.c:
116         * verify.c:
117         * class-internals.h: Adjust for new signature of mono_class_setup_interfaces.
119 2010-01-11  Zoltan Varga  <vargaz@gmail.com>
121         * loader.c (mono_method_signature_checked): New internal function taking an
122         MonoError argument.
124         * socket-io.c (AI_ADDRCONFIG): Applied patch from John Lightsey (jd@cpanel.net).
125         Fixes build on rh 7.3.
127 2010-01-10  Aaron Bockover  <abockover@novell.com>
129         * assembly.c (mono_set_rootdir): Support finding the mono paths on OS X
130         at runtime in the same way as on Windows, which yields a relocatable
131         Mono. Uses dyld's _NSGetExecutablePath and realpath to resolve the path
132         of the running mono process.
134         On TARGET_ARM, fallback () will always be executed.
136 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
138         * icall.c (ves_icall_Type_GetInterfaceMapData): This function is generics variance aware.
140 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
142         * class.c (mono_class_is_assignable_from_slow): Support variant
143         generic delegates.
145         * class.c (mono_class_implement_interface_slow): Support types with
146         variant generic arguments.
148 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
150         * verify.c: Remove some code duplication.
152 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
154         * object.c: Update docs.
156 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
158         * object.c (add_imt_builder_entry): Improve DEBUG_IMT spew.
160         * object.c (build_imt_slots): Interfaces with variant generic arguments use the
161         fallback trampoline as well.
163         * class.c (mono_class_interface_offset_with_variance): Add new non_exact_match
164         out argument that is set to TRUE if the match was direct. 
166         * class.c (mono_class_is_assignable_from): Delegates require variance testing as well.
168         * class-internal.h: Update prototype of mono_class_interface_offset_with_variance.
170 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
172         * class.c: Add mono_class_interface_offset_with_variance function that does same
173         as mono_class_interface_offset but takes variance into account.
175         * class-internal.h: Export mono_class_interface_offset_with_variance.
177         * object.c: Fix and improve DEBUG_IMT. Added an assert for IMT thunk building.
179 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
181         * object.c:
182         * icall.c:
183         * class.c: Add some FIXME for due to variant generic arguments.
185         object.c (mono_object_isinst_mbyref): Interfaces with variant generic arguments
186         can't use the simple bitfield check, so call mono_class_is_assignable_from if
187         the bitfield check fails.
189 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
191         * class.c (mono_class_is_assignable_from): Rework the generics variance code
192         to be easier to read and fix bugs in the case a non generic type implements a variant
193         interface.
195         * class.c (mono_class_has_variant_generic_params): Make non static.
197         * class-internals.h: Export mono_class_has_variant_generic_params as part of
198         the private API.
200 2010-01-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
202         * assembly.c: fix MONO_PATH debug output.
204 2010-01-06  Atsushi Enomoto  <atsushi@ximian.com>
206         * culture-info-table.h : regenerated.
208 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
210         * verify.c (mono_verifier_verify_class): Properly check for broken parent. Ignore
211         types that are meant to not have a parent.
213 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
215         * marshal.c (mono_marshal_get_runtime_invoke): Make a copy of the signature
216         from the image mempool, so it is not leaked.
218 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
220         * metadata-internals.h (_MonoImage): Remove unused generic_class_cache field.
222 2010-01-04  Sebastien Pouliot  <sebastien@ximian.com>
224         * verify.c (verify_valuetype_layout_with_target): Fix case
225         that can lead to infinite recursion. Fix bug #567861
227 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
229         * pedump.c: Run code verifier even if image verification fails
230         due to a failed type we. This allows more errors to be shown.
232 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
234         * class.c (count_virtual_methods): Remove the assert and now
235         fail properly.
236         
237         * class.c (setup_interface_offsets): This can fail now.
239         * class.c (mono_class_setup_vtable_general): Check for parent vtable
240         errors. Check setup_interface_offsets errors.
242         * class.c (setup_interface_offsets): Simplify the return error logic
243         and remove class_init_ok.
245         Fixes #560327.
247 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
249         * class.c (mono_class_init): Do class verification at the beginning. Add
250         some asserts to avoid tripping into invalid memory.
252         * object.c (compute_class_bitmap): Replace a g_assert_not_reached with a
253         g_error and a decent message.
255         * verify.c (mono_verifier_verify_class): Verify for invalid super type.
257         Fixes #567548.
259 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
261         * mempool-internals.h (g_list_prepend_mempool): Define this and related functions
262         as inline functions instead of defining them in mempool.c.
264         * metadata-internals.h (MonoImageSet): New structure representing a set of
265         MonoImages, which own a collection of generic instances.
267         * metadata.c: Get rid of the global generic caches, instead assign each generic
268         instance to the image set which consists of all the images referenced by the
269         instance. This greatly speeds up mono_metadata_clean_for_image (), and allows
270         the memory used by generic instances to be allocated from a per image-set mempool
271         later.
273 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
275         * marshal.c (mono_marshal_get_runtime_invoke): Fix a memory leak.
277 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
279         * appdomain.c (zero_static_data): Fix a warning.
281         * locales.c (construct_culture_from_specific_name): Applied patch from
282         José Antonio Sánchez Lázaro <jasl@darcysoft.es>. Fix a crash if a culture was
283         not found. Fixes #567900.
285 2009-12-31  Sebastien Pouliot  <sebastien@ximian.com>
287         * loader.c (mono_method_get_signature_full): Remove two asserts.
288         Return NULL instead so that the verifier can handle both cases 
289         gracefully.
291 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
293         * class.c (mono_class_setup_methods): Use checked version of mono_class_inflate_generic_method_full
294         so we can properly fail types instead of crashing.
296         Fixes #567676.
298 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
300         * reflection.c (reflection_methodbuilder_to_mono_method): Assert in case of a broken
301         generic method.
303 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
305         * marshal.c (mono_mb_emit_restore_result): Properly handle generic enums.
307 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
309         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait): Don't close the
310         wait handle if the wait is interrupted, since it is still in mon->wait_list, and
311         we can't remove it from it since we don't hold the lock.
312         (mon_new): Free the orphaned events here when a mon structure is added to the
313         freelist. Fixes #561239. Thanks to Mike Rieker <wmrieker@nii.net> for tracking
314         this down.
316 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
318         * verify.c (init_stack_with_value_at_exception_boundary): Do stack overflow checking here
319         as max stack might be zero.
321         Fixes #562320.
323 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
325         Rework all uses of mono_class_setup_methods to accept that it can fail now.
327         * class.c (mono_class_setup_methods): This function now can fail the class. Do so for generic
328         instances if the GTD did.
330         * class.c (mono_class_setup_properties): Ditto.
332         * class.c (mono_class_setup_events): Ditto.
334         * class.c (mono_class_setup_vtable): Fail early if the type is already broken.
336         * class.c (mono_class_setup_vtable_general): Add a few more missing broken type checks. Sanitize
337         error setting.
339         * class.c (mono_class_init): Fail if GTD did.
341         * cominterop.c:
342         * generic-sharing.c:
343         * icall.c:
344         * loader.c:
345         * object.c:
346         * verify.c: Properly handle failure of mono_class_setup_methods.
348 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
350         * class-internals.c: Add mono_class_inflate_generic_method_full_checked and make
351         mono_class_inflate_generic_method_full internal.
353         * class.c (inflate_generic_context): Now takes a MonoError argument.
355         * class.c (mono_class_inflate_generic_method_full): Now calls the _checked and abort on
356         errors.
358 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
360         * generic-sharing.c (instantiate_other_info): Avoid creating jump trampolines since
361         they cannot be patched. Partly fixes #564408.
363 2009-12-24  Mark Probst  <mark.probst@gmail.com>
365         * metadata-internals.h, reflection.c: Use the
366         MonoDynamicImage.handleref hash table only with unmanaged keys,
367         and add a managed hash table handleref_managed for managed keys.
369 2009-12-24  Mark Probst  <mark.probst@gmail.com>
371         * sgen-gc.c: Unset to-space bumper between collections.  It might
372         become invalid due to degraded allocations.
374 2009-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
376         * loader.c (mono_method_get_signature_full): Check if the returned signature is compatible
377         with the one from the original method.
379         * metadata-verify.c (mono_verifier_is_sig_compatible): New function to verify signature
380         compatibility.
382         * verify-internals.h: Add new function to the internal API.
384 2009-12-18  Dimitar Dobrev  <dpldobrev@yahoo.com>
386         * culture-info-tables.h: regenerated it to include the Georgian culture.
388 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
390         * sgen-gc.c: Include mono/utils/memcheck.h.
392         * reflection.c (mono_reflection_get_type_internal_dynamic): Use assembly->domain
393         instead of the current domain, since the two might not match if this is called
394         from the debugger.
396         * metadata-internals.h (MonoDynamicAssembly): Add a 'domain' field to specify the
397         domain which created this assembly.
399 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
401         * debug-helpers.c (dis_one): Avoid a glib assert on empty strings.
403 2009-12-17  Mark Probst  <mark.probst@gmail.com>
405         * sgen-gc.c: Managed implementation of the specialized generic
406         store write barrier.
408 2009-12-17  Rodrigo Kumpera  <rkumpera@novell.com>
410         * icall.c (ves_icall_Type_GetMethodsByName): Don't pin virtual methods if they are newslot.
411         A private virtual newslot method is used to implement an interface method without exposing
412         it to users. When querying for public instance methods, such method would hide a public one
413         on a parent type.
415         Fixes #564379.
417 2009-12-17  Zoltan Varga  <vargaz@gmail.com>
419         * reflection.c (resolve_object): Fix the encoding of unmanaged calling
420         conventions.
422 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
424         * reflection.c (mono_type_get_object): Guard against NULL generic param owner.
426 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
428         * class-internals.h (MonoDynamicGenericClass): Kill property and event related fields
429         as they are no longer used.
430         
431          * metadata.c (free_generic_class_dependents): Remove reference to previous fields
433         * reflection.c (mono_reflection_generic_class_initialize): Ditto.
435 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
437         * reflection.c (mono_type_get_object): If the type is VAR or MVAR check
438         if the owner class has not been finished before returning reflection_info.      
440         Fixes #565127.
442 2009-12-16  Zoltan Varga  <vargaz@gmail.com>
444         * reflection.c (mono_custom_attrs_from_param): Avoid a crash if a dynamic
445         param doesn't have custom attributes. Fixes #565117.
447         * class.c (mono_bounded_array_class_get): Make these classes PUBLIC. Fixes
448         #565120.
450 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
452         * class.c (mono_class_setup_fields): Fail valuetypes that are bigger than 1Mb.
454 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
456         * pedump.c: Add partial-md mode that doesn't perform full metadata verification. It does the
457         same amount done by a core-clr enabled runtime.
459 2009-12-15  Marek Habersack  <mhabersack@novell.com>
461         * appdomain.c (mono_make_shadow_copy): make sure access mode of
462         the target files is reset to writable by owner and readable by
463         everyone else to prevent problems when updating shadow copies of
464         files whose source is read-only. Fixes bug #556884
466 2009-12-15  Mark Probst  <mark.probst@gmail.com>
468         * class.c (mono_generic_class_get_class): Allocate the generic
469         class via malloc again, so that it can be freed when any one of
470         the images of its constituent types is closed.
472         * metadata.c: When closing an image, don't free generic insts and
473         generic classes right away, but put them into a list for later
474         freeing.
476         * image.c, metadata-internals.h: Store the free list and in the
477         second pass of closing an image, free it.
479 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
481         * reflection.c (mono_generic_class_get_object): Assert if this is ever called.
483         * reflection.c (mono_reflection_register_with_runtime): Only register dynamic
484         types in type_hash.
486         * reflection.c (resolve_object): Call ensure_complete_type on the inflated field.
488 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
490         * reflection.c (mono_reflection_type_get_handle): Properly fail in case of a broken
491         user type.
493         * reflection.c (mono_reflection_register_with_runtime): Throws in case a bad user type
494         is used.
496 2009-12-14  Miguel de Icaza  <miguel@novell.com>
498         * verify.c (mono_method_verify): The Unused opcodes produce an
499         InvalidProgramException on .NET
501 2009-12-14  Sebastien Pouliot  <sebastien@ximian.com>
503         * loader.c (mono_method_get_header): Move assert after the verifier
504         has been called on the method header.
506 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
508         * object-internals.h: Remove useless field from MonoReflectionGenericClass.
510         * appdomain.c: Bump corlib version.
512 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
514         To properly support user types, MonoGenericClass has to be used for regular, non SRE,
515         types as well since otherwise generic instances would not return UT as arguments but
516         their undelying system type.
518         * object-internals.h: Change field types of MonoGenericClass and *OnTypeBuilderInst
519         to reflect the fact that they can have now multiple different types.
521         * reflection.c (mono_image_get_field_on_inst_token): Handle MonoField.
523         * reflection.c (mono_image_get_ctor_on_inst_token): Handle MonoCMethod.
525         * reflection.c (mono_image_get_method_on_inst_token): Handle MonoMethod.
527         * reflection.c (mono_reflection_register_with_runtime): Init super types
528         if the image is not dynamic.
530         * reflection.c (mono_reflection_bind_generic_parameters): In case of a MonoGenericClass,
531         check if the generic type definition is a TypeBuilder.
533         * reflection.c (mono_reflection_generic_class_initialize): If the generic type definition
534         doesn't belong to a dynamic image, skip initialization.
536         * reflection.c (resolve_object): Properly handle *OnTypeBuilderInst types where their
537         base definition is not a dynamic type.
539 2009-12-11  Marek Habersack  <mhabersack@novell.com>
541         * object.c (mono_ldstr, mono_ldstr_metadata_sig): added calls to
542         mono_profiler_string_allocation
544         * string-icalls.c (ves_icall_System_String_InternalAllocateStr):
545         if string profiling is enabled, call
546         mono_profiler_string_allocation
548         * profiler.h: added two MonoProfileFlags -
549         MONO_PROFILE_IOMAP_EVENTS and MONO_PROFILE_STRING_ALLOC as well as
550         installation functions for the hooks below.
552         * profiler-private.h, profiler.c: added two hooks:
553         mono_profiler_string_allocation called whenever a string is
554         allocated by InternalAllocateStr and mono_profiler_iomap called
555         whenever IOMAP code performs an adjustement on a file path.
557 Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <lupus@ximian.com>
559         * boehm-gc.c: fixed race condition while getting the target of a
560         disappearing link (bug #522233).
562 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
564         * class.c (mono_type_get_full): Produce warning instead of simply swallowing
565         the error.
567 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
569         * reflection.c: Add mono_reflection_register_with_runtime icall to
570         allow a MonoGenericClass to register itself as the managed mirror of
571         a given generic instance.
572         This is a temporary workaround until all MGC instantiation happens in
573         managed code.
575         * object-internals.h: Ditto.
577         * icall-def.h: Ditto.
579 2009-12-10  Mark Probst  <mark.probst@gmail.com>
581         * sgen-gc.c (find_in_remsets): Also search the generic store
582         remsets.
584 2009-12-10  Mark Probst  <mark.probst@gmail.com>
586         * sgen-gc.c: Don't access class names in debugging code when
587         unloading a domain, because they might not be valid anymore.
589 2009-12-10  Mark Probst  <mark.probst@gmail.com>
591         * domain.c, domain-internals.h: New function mono_domain_unset().
593         * appdomain.c (unload_thread_main): Detach the thread again at the
594         end.
596         * threads.c: When a thread exists or is detached, unset its domain
597         so that it's NULL when, for example, a pthread destructor runs.
599         * sgen-gc.c: Assert that there is no domain set after a thread is
600         done.
602 2009-12-10  Mark Probst  <mark.probst@gmail.com>
604         * class.c (mono_generic_class_get_class),
605         metadata.c (free_generic_class): Allocate generic MonoClass's from
606         the image mempool, not via malloc.  The problem with malloc is
607         that when unloading a domain those classes are freed before
608         clearing the heap and SGen needs the classes.  Rewriting the
609         unloading code to do the free later would be more work and there's
610         no point in using malloc anyway.
612 2009-12-09  Sebastien Pouliot  <sebastien@ximian.com>
614         * loader.c (mono_method_signature): Always call mono_loader_unlock 
615         before returning.
617 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
619         * metadata-verify.c: Add mono_verifier_verify_string_signature to check
620         user string blobs.
622         * verify-internals.h: Add new function to the internal API.
624         * verify.c (do_ldstr): Call into mono_verifier_verify_string_signature to
625         check if it's a valid string.
627         * object.c (mono_ldstr): Ditto.
629         Fixes #561943.
631 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
633         * icall.c (ves_icall_GetCurrentMethod): Drop all generic arguments
634         from a method before returning it. This is the expected behavior.
636 2009-12-08  Rodrigo Kumpera  <rkumpera@novell.com>
638         * reflection.c (inflate_method): Handle the case of a regular system type.
640 2009-12-08  Mark Probst  <mark.probst@gmail.com>
642         * sgen-gc.c, sgen-pinning-stats.c, sgen-gray.c: More statistics
643         gathering code.
645         * mempool.c, mempool-internals.h: New function
646         mono_mempool_get_bytes_allocated().
648         * Makefile.am: sgen-pinning-stats.c added.
650 2009-12-08  Mark Probst  <mark.probst@gmail.com>
652         * sgen-gc.c (create_allocator): Only use the fast path if the
653         object size is within the small object size limit.
655 2009-12-07  Mark Probst  <mark.probst@gmail.com>
657         * sgen-gc.c: Make sure section->data is aligned to 8 bytes by
658         possibly adding padding to sizeof (GCMemSection).
660 2009-12-07  Mark Probst  <mark.probst@gmail.com>
662         * sgen-gc.c (mono_gc_wbarrier_nostore): Skip the remset if the
663         reference is not in the nursery.
665 2009-12-07  Rodrigo Kumpera  <rkumpera@novell.com>
667         * class.c (mono_class_from_typeref): Bounds check idx against the 
668         assemblyref table.
670 2009-12-07  Mark Probst  <mark.probst@gmail.com>
672         * sgen-gc.c, sgen-pinning.c: When pinning, make only one pass
673         through the potential roots, then sort the results and find the
674         pinned objects from there.
676         * Makefile.am: sgen-pinning.c added.
678 2009-12-07  Mark Probst  <mark.probst@gmail.com>
680         * sgen-gc.c: Record generic stores in specialized remset buffers.
682 2009-12-06  Mark Probst  <mark.probst@gmail.com>
684         * sgen-gc.c: Make pinned chunks the same size as major heap
685         sections, and align them as well, so that we can check whether an
686         object is in a pinned chunk or a major section in constant time.
688 2009-12-06  Mark Probst  <mark.probst@gmail.com>
690         * sgen-gc.c (build_nursery_fragments): Don't leak fragments.
692 2009-12-06  Mark Probst  <mark.probst@gmail.com>
694         * sgen-gc.c: Make all major heap sections the same size (currently
695         128k) and allocate them on aligned addresses.  Small heap sections
696         give us better granularity with pinned objects - we can free up
697         much more memory.
699 2009-12-06  Mark Probst  <mark.probst@gmail.com>
701         * string-icalls.c (ves_icall_System_String_GetLOSLimit): Debug
702         output removed.
704 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
706         Applied patch from Laurent Etiemble (laurent.etiemble@gmail.com).
708         * mono/metadata/assembly.c: When opening an assembly image, pass the real
709         names in addition to the runtime generated one.
711         * mono/metadata/image.h: Add a function to take the real name of the assembly
712         image.
714         * mono/metadata/image.c: If a real name has been passed to load an assembly,
715         use it instead of the runtime generated one.
717         Code is contributed under MIT/X11 license.
719 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
721         * marshal.c (emit_marshal_vtype): Do the klass == date_time_class checks
722         before the other checks to prevent problems if the DateTime class is blittable.
723         Hopefully fixes #559600.
725 2009-12-05  Mark Probst  <mark.probst@gmail.com>
727         * string-icalls.c, string-icalls.h, icall-def.h: New icall that
728         returns the largest string length that will not be put into the
729         LOS.
731         * sgen-gc.c, gc-internal.h: New function that returns the largest
732         object size that will not be put into the LOS.
734         * appdomain.c: Bump corlib version.
736 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
738         * class-internals.h: Add MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
740         * generic-sharing.c: Handle MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
742 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
744         * reflection.c (inflate_method): Fix signature.
746         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Reflect change
747         in managed code.
749 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
751         * reflection.c (inflate_method): Make this method work with TypeBuilder as well.
753 2009-12-03  Mark Probst  <mark.probst@gmail.com>
755         * sgen-gc.c: Abstract to-space handling.
757 2009-12-03  Rodrigo Kumpera  <rkumpera@novell.com>
759         * loader.c (find_method_in_class): Ignore methods with broken signatures.
761         Fixes #559906.
763 2009-12-03  Mark Probst  <mark.probst@gmail.com>
765         * sgen-gc.c: Only add references from outside the nursery to
766         within the nursery to the global remset list.
768 2009-12-03  Mark Probst  <mark.probst@gmail.com>
770         * appdomain.c (create_exceptions): Set the domain temporarily if
771         necessary to avoid cross-domain references.
773 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
775         * verify.c (get_stack_type): Return that the type is invalid instead of
776         asserting.
778         * verify.c (mono_method_verify): Verify that all locals and arguments
779         have valid stack types.
781         Fixes #559913.
783 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
785         * verify.c (mono_method_verify): Bounds check the filter offset. Make all
786         bounds checking overflow aware.
788         Fixes #559910.
790 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
792         * verify.c (do_invoke_method): Check for invalid method signatures.
794         Fixes #553450.
796 2009-12-02  Jb Evain  <jbevain@novell.com>
798         * appdomain.c (MONO_CORLIB_VERSION): bump.
799         * icall-def.h (get_base_definition): renamed to get_base_method
800         and add a boolean argument indicating we want the original
801         method definition, or the immediate base method.
802         * icall.c: apply the get_base_definition to get_base_method change.
804 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
806         * class.c (mono_class_setup_fields): Fail an enum without an instance field.
808         Fixes #558042.
810 Wed Dec 2 16:35:49 CET 2009 Paolo Molaro <lupus@ximian.com>
812         * class.c: remove asserts for invalid type token in
813         mono_class_name_from_token(), mono_assembly_name_from_token() and
814         mono_class_create_from_typedef () (fixes bug #553318).
816 Wed Dec 2 15:48:19 CET 2009 Paolo Molaro <lupus@ximian.com>
818         * metadata.c, class.c, loader.c: remove assert after bsearch() for
819         incorrect assemblies (bug #553322).
821 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
823         * metadata.c (mono_metadata_inflate_generic_inst): Add MonoError parameter.
825         * metadata-internals.h: Change signature of mono_metadata_inflate_generic_inst. 
827         * class.c (inflate_generic_type): Use new version of mono_metadata_inflate_generic_inst.
829         * class.c (inflate_generic_context): Ditto.
831         * loader.c (method_from_methodspec): Ditto.
833         Fixes #558230.
835 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
837         * class.c (mono_type_retrieve_from_typespec): Use MonoError machinery to report errors.
839         * class.c (mono_class_create_from_typespec): Ditto.
841         * class.c (mono_class_get_full): Fix for change on the above 2 functions.
843         * class.c (mono_type_get_full): Fix for change on the above 2 functions.
845         Fixes #558184.
847 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
849         * verify.c (mono_class_has_default_constructor): Check fror broken signatures.
851         * verify.c (verify_delegate_compatibility): Ditto.
853         * verify.c (do_newobj): Ditto.
855         Fixes #558046.
857 2009-12-02  Mark Probst  <mark.probst@gmail.com>
859         * sgen-gc.c: Use a gray queue instead of requiring that gray
860         objects are in a contiguous region.
862         * sgen-gray.c: The gray queue implementation.
864         * Makefile.am: sgen-gray.c added.
866 2009-12-02  Mark Probst  <mark.probst@gmail.com>
868         * appdomain.c: When unloading a domain, zero its static data and
869         perform a minor collection when using SGen.  That will get rid of
870         all the remsets pointing into that domain's static data.
872         * sgen-gc.c: Allow remsets into static data.  By doing this we
873         need less checks so we're more efficient.
875 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
877         * verify.c (mono_method_verify): Check for catch clauses with broken
878         types.
880         Fixes #558465.
882 2009-12-01  Jb Evain  <jbevain@novell.com>
884         * class.c (make_generic_param_class): set the namespace of
885         the generic parameter class from its owner, if available.
887 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
889         * verify.c (code_bounds_check): Do proper overflow checking.
891         * verify.c (mono_method_verify): The number of switch entries is
892         an unsigned int. Properly bounds check it.
894         Fixes #558594.
896 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
898         * metadata.c: Kill mono_metadata_get_param_attrs_checked. Add
899         mono_metadata_method_has_param_attrs which only checks if a given param
900         list has a non zero flags entry.
902         * metadata.c (mono_metadata_get_param_attrs): Add param_count parameter
903         to inform how many params should we expect to decode.
905         * loader.c (mono_method_signature): Use mono_metadata_method_has_param_attrs
906         as it's faster than mono_metadata_get_param_attrs.
908         * metadata-internals.h: Fix mono_metadata_get_param_attrs signature and
909         add mono_metadata_method_has_param_attrs.
911 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
913         * class.c (mono_class_setup_vtable_general): Check for mono_method_get_vtable_slot
914         failures.
916         * class.c (mono_method_get_vtable_slot): Don't assert if the computed method slot
917         is -1 but its class is broken.
919         Fixes #558522.
921 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
923         * metadata.c: Introduce mono_metadata_get_param_attrs_checked which checks
924         for parameter overflow.
926         * metadata.c (mono_metadata_parse_method_signature_full): Use checked version
927         of mono_metadata_get_param_attrs.
929         * metadata-internals.h: Add mono_metadata_get_param_attrs_checked to the internal
930         API.
932         * loader.c (mono_method_signature): Use checked version of mono_metadata_get_param_attrs.
934 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
936         * class.c (mono_class_setup_fields): Check for fields with broken types.
938         Fixes #558741.
940 2009-11-28  Rodrigo Kumpera  <rkumpera@novell.com>
942         * reflection.c (ensure_generic_class_runtime_vtable): Split this function in 2
943         so we can avoid calling ensure_runtime_vtable multiple times for the GTD during
944         its TypeBuilder::CreateType ().
946         * reflection.c (ensure_generic_class_runtime_vtable): Avoid initializing interfaces
947         if not needed.
949         * reflection.c: Every time we change the interface array, set interfaces_packed to NULL
950         to make setup_interface_offsets happy.
952         * reflection.c (remove_instantiations_of_and_ensure_contents): Fix instances again as corlib
953         compilation now works.
955 2009-11-28  Zoltan Varga  <vargaz@gmail.com>
957         * appdomain.c (create_exceptions): New helper function extracted from
958         mono_runtime_init () to precreate objects used during exception handling.
959         (mono_runtime_init): Call it.
960         (mono_domain_create_appdomain_internal): Ditto. Fixes #555264.
962 2009-11-27  Rodrigo Kumpera  <rkumpera@novell.com>
964         * reflection.c (remove_instantiations_of_and_ensure_contents): Temp hack to fix corlib
965         compilation until the proper one is found.
967 2009-11-27  Zoltan Varga  <vargaz@gmail.com>
969         * class.c (mono_class_setup_vtable_general): Cache the result of
970         get_virtual_methods () since it can be slow because of the metadata
971         optimization.
973         * metadata-internals.h (_MonoImage): Change 'method_cache' to a GHashTable
974         from a MonoValueHashTable for now, since the later is based on an earlier
975         version of hpj's internal probing code and seems to have serious collision
976         issues.
978         * loader.c (mono_get_method_full): Update after the change above.
980 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
982         * class-internals.h (MonoCachedClassInfo): Add 'is_generic_container' field.
984 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
986         * reflection.c (get_field_on_inst_generic_type): Try to fallback using the field from
987         the GTD instead of the DGC instead of crashing.
989         * reflection.c (ensure_generic_class_runtime_vtable): Only reinflate stuff that is
990         required. Inflate fields if needed.
992         * reflection.c (remove_instantiations_of): Ensure generic instances are properly
993         finished. Renamed.
995 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
997         * class.c (check_interface_method_override): Check for NULL signatures and fail
998         the type.
1000         * debug-helpers.c (mono_signature_get_desc): Return a fixed string for NULL signatures.
1002         Fixes #553428.
1004 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
1006         * class.c (mono_class_get_virtual_methods): Call decode_row_col to obtain
1007         the MONO_METHOD_FLAGS column instead of decoding the whole row.
1009 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
1011         * loader.c (field_from_memberref): Resolve the class first then the field
1012         signature. Remove a lot of duplicated code and make sure we don't pass valid
1013         values to mono_loader_set_error_field_load.
1015         Fixes #553306.
1017 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
1019         * class.c (inflate_generic_type): Change code to use new signature of
1020         mono_error_set_bad_image.
1022         Fixes #558124.
1024 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com> 
1026         * verify.c (mono_method_verify): Don't free ctx.params items if 
1027         we aborted while inflating the ctx.locals. Complete previous fix
1029 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com>
1031         * verify.c (mono_method_verify): Use the uninflated type name, 
1032         when the inflated is null, to report errors. Also take care when
1033         freeing, not to free everything since, in case of an error, some
1034         stuff would be copies (i.e. not allocated by the function itself)
1035         Fix bug #558145
1037 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
1039         * verify.c (stack_push, stack_pop, stack_pop_safe): Assert if we underflow
1040         or overflow. The caller must have done this check explicitly. This guard us
1041         from accessing invalid memory.
1043         * verify.c (do_push_static_field): Check for stack overflow.
1045         Fixes #553333.
1047 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
1049         * loader.c (find_method_in_class): Don't crash if the signature cannot
1050         be resolved.
1052         * metadata.c (mono_metadata_parse_generic_param): Return NULL instead
1053         of asserting for the case of invalid params.
1055         Fixes #553304.
1057 2009-11-24  Sebastien Pouliot  <sebastien@ximian.com>
1059         * image.c (mono_image_load_module): Fix crash when a bad assembly
1060         has no module at all (fix bug #553412) and also replace the 
1061         g_assert with a return NULL (documented return value for failure)
1063 2009-11-23  Zoltan Varga  <vargaz@gmail.com>
1065         * debug-helpers.c (mono_type_get_desc): Handle typedbyref.
1067 2009-11-23  Miguel de Icaza  <miguel@novell.com>
1069         * file-io.c: Change FindFirst/FindNext/FindClose API to return the
1070         file attribute to managed code and avoid doing the mask/attribute
1071         checks here. 
1073 2009-11-22  Miguel de Icaza  <miguel@novell.com>
1075         * file-io.c: Surface a smart FindFirst/FindNext/FindClose API to
1076         the managed world.
1078         * icall-def.h: New entry points.
1079         
1080 2009-11-19  Mark Probst  <mark.probst@gmail.com>
1082         * process.c: Don't put references to managed objects into a
1083         g_ptr_array.
1085 2009-11-18  Sebastien Pouliot  <sebastien@ximian.com>
1087         * class.c (can_access_internals): Allow CoreCLR to participate in
1088         allowing (or not) [InternalsVisibleTo] between assemblies.
1089         * security-core-clr.c|h: Make sure that only trusted code (a 
1090         superset of platform code) can access the internals of platform
1091         code.
1093 Mon Nov 16 16:28:11 CET 2009 Paolo Molaro <lupus@ximian.com>
1095         * reflection.c: use the correct base class to get the virtual method
1096         "get_UnderlyingSystemType" and speed up the icall. Fixes bug #555013.
1098 2009-11-16  Sebastien Pouliot  <sebastien@ximian.com>
1100         * security-core-clr.c (get_caller_no_reflection_related): 
1101         [Mono]Type.InvokeMember is outside System.Reflection[.Emit] but
1102         it's still reflection and must be filtered correctly.
1104 2009-11-16  Mark Probst  <mark.probst@gmail.com>
1106         * object.c (compute_class_bitmap): Fix for large bitmaps.
1108 2009-11-15  Zoltan Varga  <vargaz@gmail.com>
1110         (mono_gc_get_suspend_signal): Fix the build with a system libgc.
1112         * boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
1113         koush@koushikdutta.com). Disable GC_no_dls on android.
1115 2009-11-12  Mark Probst  <mark.probst@gmail.com>
1117         * sgen-gc.c (find_tlab_next_from_address): Handle the case where
1118         tlab_next points outside the TLAB because the allocator was
1119         interrupted.
1121 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1123         * reflection.c (mono_image_module_basic_init): Handle exceptions correctly.
1125 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1127         * object-internals.h: Change signature for mono_string_to_utf8_image.
1129         * object.c (mono_string_to_utf8_image): Change signature to take a MonoError
1130         argument.
1132         * reflection.c: Take care of mono_string_to_utf8_image change and avoid raising
1133         exceptions due to mono_string_to_utf8.
1135 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1137         * object-internals.h: Change signature for mono_string_to_utf8_mp.
1139         * object.c (mono_remote_class): Make sure all resources are released before
1140         raising an exception.
1142         * object.c (mono_print_unhandled_exception): Avoid raising an exception.
1144 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1146         * mono-perfcounters.c (network_get_impl): Change variable initialization
1147         ordering to fix potential memory leak in case of exceptions.
1149         * mono-perfcounters.c (mono_perfcounter_create): Properly handle badly
1150         encoded strings.
1151         
1152 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1154         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): Change
1155         variable initialization ordering to fix potential memory leak in case
1156         of exceptions.
1158 2009-11-09  Zoltan Varga  <vargaz@gmail.com>
1160         * icall.c (mono_ArgIterator_Setup): Remove the MONO_ARCH_REGPARMS stuff, its not
1161         needed.
1163 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
1165         * appdomain.c: Fix shadow path code to better deal with exceptions.
1167 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
1169         * appdomain.c: Use checked version of mono_string_to_utf8 to avoid raising an
1170         exception in the middle of the runtime code.
1172 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
1174         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): Don't
1175         leak memory with broken envvar value.
1177 2009-11-06  Mark Probst  <mark.probst@gmail.com>
1179         * reflection.c (mono_reflection_setup_internal_class): Because
1180         nested classes are not added to the name cache, we must put them
1181         in the reflection_info_unregister_classes list.
1183 2009-11-05  Sebastien Pouliot  <sebastien@ximian.com>
1185         * class.c: When CoreCLR is enabled don't call mono_init_com_types
1186         if MONO_CLASS_IS_IMPORT return true unless the type reside in 
1187         platform (trusted) code. Instead we return a TypeLoadException to
1188         be thrown later. This is the exception thrown by Silverlight 2 if
1189         a type, inside application (user) code is marked with [ComImport]
1191 2009-11-05  Zoltan Varga  <vargaz@gmail.com>
1193         * icall.c (ves_icall_System_Diagnostics_Debugger_IsAttached_internal): Call
1194         mono_is_debugger_attached () too.
1196         * mono-debug.c (mono_is_debugger_attached): New helper function.
1197         (mono_set_is_debugger_attached): Ditto.
1199 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
1201         * object-internals.h: Add mono_string_to_utf8_checked.
1203         * object.c: Implement mono_string_to_utf8_checked.
1205 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
1207         * class.c: Add missing check for load errors after every
1208         call to mono_class_setup_fields
1210         Fixes #552282.
1212 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
1214         metadata-verify.c (verify_tables_schema): Fix the error message.
1216 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
1218         * metadata.c: Change event table schema to use TDOR for event type
1219         as this is what it's meant to be.
1221         * metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
1222         to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
1223         entry.
1225         * metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
1226         longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
1227         rows in MONO_TABLE_GENERICPARAM.
1229         Fixes #552289.
1231 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
1233         * class.c (mono_image_add_to_name_cache): Assert on duplicate
1234         insertion.
1236         * reflection.c (mono_reflection_setup_internal_class): Avoid
1237         registering a gc root the same MonoClass multiple times.
1238         Don't register nested types on the global scope as they should
1239         not be available there.
1241 2009-11-05  Rolf Bjarne Kvinge  <RKvinge@novell.com>
1243         * culture-info-tables.h: regenerated.
1245 2009-11-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
1247         * debug-helpers.c: avoid g_strdup() in mono_type_full_name().
1249 2009-11-04  Sebastien Pouliot  <sebastien@ximian.com>
1251         * string-icalls.c|h: Remove string internal calls that are not 
1252         used anymore by the class libraries.
1253         * icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
1254         which is not used in the class librairies.
1255         * icall-def.h: Update tables.
1257 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
1259         * class.h: Move mono_class_inflate_generic_type_checked...
1261         * class-internals.h: to here and make it internal. We don't want to
1262         further expose MonoGenericContext. 
1264 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
1266         * verify.c (mono_method_verify): Improve error message.
1268 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
1270         * reflection.c (fieldref_encode_signature): If field_image is NULL then
1271         the token is already properly encoded. Fixs 4.0 build.
1273 2009-11-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>
1275         * locales.c (construct_number_format): Check if the number index is
1276         valid before trying to use it, if not, just return.
1277         
1278 2009-11-04  Zoltan Varga  <vargaz@gmail.com>
1280         * marshal.c (mono_marshal_get_runtime_invoke): Don't reset abort exceptions,
1281         since that loses the abort state. Fixes #539394.
1283 2009-11-03  Zoltan Varga  <vargaz@gmail.com>
1285         * marshal.c (mono_marshal_get_native_wrapper): For icall wrappers, add an
1286         explicit this argument to the call signature.
1287         (mono_marshal_get_icall_wrapper): Ditto.
1289 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
1291         * reflection.c (fieldref_encode_signature): Add new field_image parameter
1292         to indicate which assembly to use when resolving a custom-mod.
1294         Fixes handling of volatile fields used across assemblies as reported in #551513.
1296 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
1298         * loader.c: Improve error messages.
1300 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
1302         * class.c (mono_class_setup_methods): Only give a slot for virtual methods
1303         of interfaces. Fixes IKVM.
1305         * class.c (mono_class_setup_vtable_general): Improve debug spew.
1307 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
1309         * verify.c (verifier_inflate_type): Return the inflated type on success.
1311 2009-11-02  Zoltan Varga  <vargaz@gmail.com>
1313         * debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.
1315         * threads.c (mono_thread_attach): Call the profiler thread start callback.
1317         * object-internals.h (_MonoThreadInternal): Add a 'flags' field.
1319         * threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
1320         flag set.
1322         * profiler.c: Add new profiler callbacks for runtime invoke.
1324         * object.c (mono_runtime_invoke): Call the runtime invoke callbacks.
1326 2009-11-01  Mark Probst  <mark.probst@gmail.com>
1328         * sgen-gc.c: Keep track of the reason for a major collection and
1329         write it to the heap-dump file.
1331 2009-10-31  Miguel de Icaza  <miguel@novell.com>
1333         * threads.c: refactor the code that initializes the
1334         thread_start_args into a reusable function and use this in the two
1335         methods that start up threads.
1337 2009-10-31  Zoltan Varga  <vargaz@gmail.com>
1339         * appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
1340         Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
1342 2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
1344         * mono-perfcounters.c: add the "_Total" instance for CPU counters.
1345         Until now, we only had the per-cpu(core) counters.
1347 2009-10-28  Mark Probst  <mark.probst@gmail.com>
1349         * gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
1350         mono_gc_get_suspend_signal(), which returns the suspend signal
1351         number used by the GC.
1353 2009-10-25  Zoltan Varga  <vargaz@gmail.com>
1355         * threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.
1357         * threads.c (start_wrapper): Call mono_profiler_thread_start () later after
1358         signalling start_notify.
1360 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
1362         * appdomain.c: do not test the st_mode field for shadow-copies.
1363         Fixes bug #545276.
1365 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
1367         * threadpool.[ch]: added hooks for thread start/finish and item
1368         processing begin/end. For monotouch use only.
1370 2009-10-24  Zoltan Varga  <vargaz@gmail.com>
1372         * threads.c (mono_thread_get_name): New helper function.
1374         * reflection.c (resolve_object): Set handle_class for strings too.
1375         (mono_reflection_create_custom_attr_data_args): New helper function to decode
1376         a cattr blob into a set of arrays and structures without creating the custom
1377         attributes themselves.
1378         (create_custom_attr_data): Simplify using create_custom_attr_data_args.
1380         * mono-debug.c (mono_debug_il_offset_from_address): New helper function.
1382         * debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
1383         function.
1385 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1387         * verify.c: Replace calls to mono_class_inflate_generic_type with
1388         mono_class_inflate_generic_type_checked. Fixes #480005.
1390 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1392         * class.c (mono_class_inflate_generic_type_with_mempool): Clear the error
1393         object since not all paths lead to callees initing it.
1395 2009-10-23  Alp Toker  <alp@nuanti.com>
1397         Fix embedding API breakage from r144688. mono-compiler.h is an internal
1398         header and should not be shipped:
1400         * class.h: Back out MONO_DEPRECATED change. Currently depends on config.h
1401         which is specific to the mono build. Not going to work.
1403 2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
1405         * security-manager.c: Report if core-clr is active from
1406         ves_icall_System_Security_SecurityManager_get_SecurityEnabled
1407         to allow Moonlight BCL to behave appropriately (both in browser
1408         and outside, e.g. smcs)
1410 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
1412         * mono-config.c: ignore UTF-8 BOM and report parser errors.
1413         Fixes bug #549108.
1415 2009-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1417         * class.c: fix typo.
1419 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
1421         * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
1422         a MonoError parameter.
1424         * class.h: Mark mono_class_inflate_generic_type deprecated, add new mono_class_inflate_generic_type_checked
1425         version that can does proper error handling.
1427         * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
1429         * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
1431         * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.
1433 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
1435         * debug-helpers.c (dis_one): Fix the disassembly of empty strings when
1436         NO_UNALIGNED_ACCESS is defined.
1438 2009-10-22  Zoltan Varga  <vargaz@gmail.com>
1440         * marshal.c (mono_string_builder_to_utf16): Applied patch from
1441         Hib Eris  <hib@hiberis.nl>. Return empty string for empty string builders.
1442         Fixes #549173.
1444 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1446         * sgen-gc.c: Shorten sections whenever possible.
1448 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1450         * sgen-gc.c: Use our portable semaphore #defines.
1452 2009-10-22  Mark Probst  <mark.probst@gmail.com>
1454         * sgen-gc.c: A debug option for dumping the heap layout to a file
1455         after each collection.
1457 2009-10-21  Mark Probst  <mark.probst@gmail.com>
1459         * sgen-gc.c: Make managed write barriers atomic via
1460         thread-restarts.
1462 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
1464         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
1465         methods. Fixes #543021.
1467 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
1469         * socket-io.[ch]: fix VS build.
1471 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
1473         * icall-def.h:
1474         * socket-io.[ch]: implemented SendFile.
1476 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
1478         * class.c (mono_class_create_from_typedef): Initialize class->element_class
1479         before the interfaces to avoid crashes later if class initialization fails.
1480         Fixes #548417.
1482         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
1483         Fixes #548276.
1485 2009-10-20  Marek Safar  <marek.safar@gmail.com>
1487         * domain.c: Bump 4.0 version.
1489 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
1491         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
1492         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
1493         check since 'pubkey' can't be NULL at this stage
1494         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
1495         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
1496         initialization of 'iter'
1498 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
1500         * cominterop.c : Search the interface parts of vtable to find 
1501           method matches.  Fixes 547030.
1503         Code is contributed under MIT/X11 license.
1505 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
1507         * marshal.c: BeginInvoke cannot be called on multicast delegates with
1508         multiple targets. Fixes bug #574426.
1510 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
1512         * profiler.h: Put here the definition of
1513         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
1514         (and fix the build...).
1516 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
1518         * profiler.c, profiler.h, profiler-private.h:
1519         Added support for different ways of getting call chains in stat mode.
1521 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1523         * object.c, object-internals.h: New function for computing the
1524         size of an array, factored out of mono_array_new_full().  Use
1525         SGen's functions for allocating arrays and vectors.
1527         * sgen-gc.c, gc-internal.h: Special functions for allocating
1528         arrays and vectors without race conditions.  A managed array
1529         allocator method.
1531         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
1533 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1535         * object.c, object.h, icall.c: Write barriers do the copying now,
1536         as well, so no need for an additional memcpy.
1538         * sgen-gc.c: Lock when storing remsets.  Do the memory
1539         copying/moving in the write barriers.
1541         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
1543         * reflection.c: Added an assert.
1545 2009-10-12  Mark Probst  <mark.probst@gmail.com>
1547         * threads.c, process.c: A few missing write barriers.
1549 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
1551         * mono-perfcounters.c, mono-perfcounters-def.h: Add
1552         network performance counters for bytes sent per second, bytes
1553         received per second, and bytes total per second.
1555         Code is contributed under MIT/X11 license.
1557 2009-10-09  Mark Probst  <mark.probst@gmail.com>
1559         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
1560         Fix warning.
1562 2009-10-09  Mark Probst  <mark.probst@gmail.com>
1564         * threads.c, object-internals.h, object.c: Move code for
1565         transferring an object to a different domain (via
1566         serialization/remoting) to object.c.
1568         * object.c (call_unhandled_exception_delegate): If the exception
1569         is in a different domain than the delegate, transfer the exception
1570         to that domain.
1572 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
1574         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
1575         Fixes #322934.
1577 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
1579         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
1581 2009-10-06  Mark Probst  <mark.probst@gmail.com>
1583         * object.c (mono_method_return_message_restore): Handle the case
1584         where the argument is an instance of a generic type.  Fixes
1585         #544446.
1587 2009-10-06  Mark Probst  <mark.probst@gmail.com>
1589         * object.c (set_value): Write barrier fix - we must pass the
1590         count, not the size.
1592 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
1594         * domain.c (mono_init_internal): Print a useful error message when encountering
1595         an old mscorlib, instead of crashing. Fixes #544307.
1597 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
1599         * appdomain.c (copy_app_domain_setup): Fix a warning.
1601         * debug-helpers.c (dis_one): Ditto.
1603 2009-10-04  Mark Probst  <mark.probst@gmail.com>
1605         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
1606         into the new domain, instead of referencing the original one.
1608         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
1609         non-static.
1611         * appdomain.c: Corlib version bump.
1613 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1615         * threadpool.c: one more...
1617 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1619         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
1620         threads to die because we're shutting down. delgate5.exe works again.
1622 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
1624         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
1625           ccw_interface_hash table when a ccw is finalized.
1627         Code is contributed under MIT/X11 license.
1629 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1631         * assembly.c, domain.c, image.c, metadata-internals.h: Split
1632         domain and image unloading into two steps.  We must do this
1633         because clearing the domain in SGen requires the class metadata to
1634         be intact, but we need to free the mono_g_hash_tables in case a
1635         collection occurs during domain unloading and the roots would trip
1636         up the GC.
1638 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1640         * object-internals.h: Remove serialized culture fields from
1641         MonoInternalThread.
1643         * icall-def.h, thread-types.h, threads.c: Remove serialized
1644         culture icalls.
1646         * appdomain.c: Corlib version bump.
1648 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
1650         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
1651         Fixes #543133.
1653 2009-09-30  Mark Probst  <mark.probst@gmail.com>
1655         * sgen-gc.c: Try to shorten the new section after a major
1656         allocation to avoid ever-growing sections.
1658 2009-10-13  Martin Baulig  <martin@ximian.com>
1660         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
1661         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
1662         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
1663         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
1665         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
1667 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
1669         * threadpool.c: fixed the order in which 'completed' and the wait
1670         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
1671         No need to use the wait_handle field of ASyncCall. Make sure the
1672         threadpool is active when adding a job or queueing an idle thread.
1674 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
1676         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
1678         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
1679         when using --compile-all.
1681 2009-09-27  Mark Probst  <mark.probst@gmail.com>
1683         * metadata.c (free_generic_class): Unregister the field_objects
1684         roots if we're using SGen.
1686 2009-09-27  Mark Probst  <mark.probst@gmail.com>
1688         * reflection.c (mono_dynamic_image_free): Deregister the GC root
1689         for GenericParamTableEntry.gparam.
1691 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
1693         * marshal.c: don't create the handle when calling. It is created later
1694         if needed.
1696 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1698         * sgen-gc.c: Warning fixes.
1700 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1702         * sgen-gc.c: New debug option "xdomain-checks", which scans the
1703         whole heap for cross-domain references before each collection.
1705         * sgen-scan-object.h: The scan action can now use SCAN to scan the
1706         object.
1708         * threadpool-internals.h, threadpool.c: New function
1709         mono_thread_pool_is_queue_array() for checking whether a given
1710         array is used as a (cross-domain) queue by the thread pool code.
1712 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1714         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
1715         searches the whole heap for objects containing a specific
1716         reference.  Only for debugging.
1718 2009-09-26  Mark Probst  <mark.probst@gmail.com>
1720         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
1722         * icall-def.h, threads.c, threads-types.h: New icalls for copying
1723         byte arrays between domains.
1725 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1727         * threadpool.c:
1728         * class-internals.h:
1729         * mono-perfcounters-def.h:
1730         * mono-perfcounters.c:
1731         -There is a list of idle threads
1732         -Each of those idle threads wait on their own WaitHandle instead
1733         of all of them using the same semaphore. When a new work item is
1734         added, the job is assigned directly to an idle thread or a newly
1735         created one if possible and then the handle for that thread is
1736         signaled. Compare that to the current approach where all the
1737         threads in the pool compete to dequeue a job from the same
1738         queue.
1739         -New struct ThreadPool that brings together the bunch of static
1740         variable for each threadpool (IO and regular).
1741         -New performance counters: # of items added and its rate per
1742         threadpool. The rate will be used later, perhaps together with
1743         other perf. counters, to decide when idle threads should exit.
1745 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
1747         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
1748         Fix typo on Windows build.      
1749         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
1750         
1751         Code is contributed under MIT/X11 license.
1753 2009-09-25  Mark Probst  <mark.probst@gmail.com>
1755         * object-internals.h: The Thread class is split up into Thread and
1756         InternalThread now.  We have exactly one InternalThread per
1757         thread, and at most one Thread per appdomain per thread.  Most
1758         data is stored in InternalThread.  All InternalThread objects live
1759         in the root domain.
1761         * class-internals.h: Add internal_thread_class to MonoDefaults.
1763         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
1764         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
1765         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
1766         resulting from the split of the Thread class.
1768         * gc-internal.h: Prototype for new function for checking whether a
1769         thread is the finalizer thread.
1771         * appdomain.c: Corlib version bump.
1773 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
1775         * appdomain.c|h: Add a mono_domain_try_unload method which is
1776         equivalent to mono_domain_unload, except that it returns an exception
1777         instead of throwing it. Make mono_domain_unload use the
1778         mono_domain_try_unload method to avoid code-duplication.
1780 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
1782         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
1783         a problem.
1785 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
1787         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
1788         aborting when a conversion is not implemented.
1790 2009-09-23  Miguel de Icaza  <miguel@novell.com>
1792         * verify.c: when comparing culture strings, use g_ascii_strcmp
1794         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
1795         when comparing public key tokens to use memcmp on 16 bytes.   I do
1796         not believe this ever worked as advertised in the past.
1798         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
1799         which would have always failed earlier.
1801 2009-06-25  Miguel de Icaza  <miguel@novell.com>
1803         * gc.c: Raise a NullArgumentException if the object passed is
1804         null.
1806 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
1808         * image.c (mono_image_close): Atomically decrement the reference count and
1809         remove the image from the hash tables, to prevent another thread from seeing a
1810         dying MonoImage. Fixes #541194.
1812 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1814         * threadpool.c: actually use the minimum number of 'completion ports'
1815         (for us is just a potential worker thread).
1817 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1819         * threadpool.c: remove ares_htable. It does not make sense any more
1820         since the same objects are now stored in GC-tracked arrays while they are
1821         in the queue.
1823 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1825         * threadpool.c: increase the minimum length of the queues to 128.
1826         Remove warning.
1828 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
1830         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
1831         return the modified signature used by string ctors.
1833 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
1835         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
1836         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
1837         method, to be used by full-aot.
1839 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
1841         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
1842         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
1843         be known to be good.
1845         * class.c (mono_class_init): Fail array types if their element type fails initialization
1846         as well.
1848         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
1849         initialization, additionally we request the element_type vtable to be initialized as well.
1851         This is fine and should not increase the working set in any meaningful way since it's reasonable
1852         to assume       that most code will create an array and eventually populate it, which will require the
1853         type's vtable to be initialized.
1855         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
1857 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
1859         * normalization-tables.h : regenerated.
1861 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
1863         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
1864         a leb128 encoding can take up to 5 bytes.
1866 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
1868         * class.c (verify_class_overrides): Remove useless argument.
1870         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
1871         before interface enumeration as this is no longer required.
1873 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
1875         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
1876         used under mono_class_init context. This functions avoid any code path that
1877         calls mono_class_init, which leads it to be slow as some things like the interface
1878         bitmap are not available.
1880         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
1881         of it's own broken version. Fixes the verifier part of #538588.
1883         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
1884         API.
1886 2009-09-15  Mark Probst  <mark.probst@gmail.com>
1888         * class.c (mono_class_init): Always set an exception in a class if
1889         vtable setup fails.  Fixes #538577.
1891         * generic-sharing.c: Raise an exception if mono_class_vtable()
1892         returns NULL.
1894 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
1896         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
1897         methods of vtypes, as they could be incorrectly shared with static methods
1898         taking an IntPtr argument.
1900 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
1902         * domain.c:
1903         * object.c:
1904         * class-internals.h: renamed waithandle_class to
1905         manualresetevent_class.
1906         * marshal.c: propagate the exception if a remoting BeginInvoke call
1907         fails.
1909 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1911         * object.c: Properly handle vtable failures.
1913 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1915         * socket-io.c: Assert on vtable failure.
1917         * mono-mlist.c: Assert on vtable failure.
1919 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1921         * marshal.c: Assert on vtable failure.
1923 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1925         * icall.c: Properly handle vtable failures.
1927 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1929         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
1931 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1933         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
1935         * console-unix.c (do_console_cancel_event): Same.
1937 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1939         * class-internals.h: Add mono_class_vtable_full function that allows control
1940         if an exception should be raised or not.
1942         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
1943         to do what its documentation say, that is to return NULL and set exception_type on
1944         failure.
1946         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
1947         and change the code to honor it.
1949 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
1951         * verify.c: Fix typo in error message.
1953 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
1955         * security-core-clr.c: Fix default_platform_check so it can run
1956         the runtime coreclr tests (without an infinite recursion when
1957         throwing an exception).
1959 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1961         object.c (mono_delegate_ctor_with_method): Guard against null method.
1963 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1965         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
1966         that should be replaced with error handling later.
1968 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1970         * marshal.c (mono_delegate_end_invoke): Fix warning.
1972 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1974         * loader.c (mono_field_from_token): Properly handle invalid
1975         dynamic tokens.
1977 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1979         * pedump.c (verify_image_file): Skip types that can't be
1980         decoded.
1982 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1984         * verify.c: Look for recursive valuetypes only against the
1985         type been initialized as this is a lot simpler and works.
1987 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
1989         * verify.c: Ensure that fields are properly loaded before
1990         checking them.
1992 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
1994         * object.c (mono_object_get_virtual_method) : Call 
1995           mono_cominterop_get_invoke if the object is a COM object.
1997         Code is contributed under MIT/X11 license.
1999 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
2001         * verify.c: Check for recursive valuetype definitions.
2003 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
2005         Use inheritance-aware interface offsets. Inherited types use the same offsets
2006         of their parents. This reduce offset duplication in case more than one type in
2007         the inheritance tree explicitly implements the same interface.
2009         This also removes a source of vtable bubbles found in #532409. An abstract type
2010         isn't required to provide abstract methods to all interfaces it implements, which
2011         resulted in a bubble with the previous scheme as the child would get a non-full
2012         vtable from its parent. We fail all concrete types with vtable bubbles, so this
2013         should be fixed.
2015         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
2016         it's expected to not cause any significant increase beyond that.
2018         * class.c (setup_interface_offsets): Compute super class iface offsets
2019         first to force sharing.
2021         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
2022         dumping only the relevant ones.
2024         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
2025         methods a new slot regardless if they belong to an interface or not. This allows
2026         an inherited type to override the iface method separately from the class one.
2028 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
2030         * threadpool.c: make the Sleep() alertable to prevent delays exiting
2031         applications that take less than 2s to execute.
2032         Bug #524984 fixed.
2034 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
2036         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
2038         * object.c (mono_get_runtime_callbacks): New helper function to return
2039         the runtime callbacks.
2041         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
2042         mono_get_runtime_build_info () as the display name.
2043         
2044 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
2046         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
2047         argument, since NEWARR expects a native int. Fixes #481559.
2049 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
2051         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
2052         against broken SRE methods.
2054 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
2056         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
2057         a NULL variable. Abort early on failure.
2059 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
2061         * class.c (can_access_type): Fail visibility test for non nested
2062         types with nested visibility.
2064 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
2066         * assembly.c (parse_public_key): Avoid allocating (and not 
2067         freeing) the public key array when it's not requested by the 
2068         caller.
2069         * threads.c (mono_thread_manage, mono_thread_create_internal, 
2070         ves_icall_System_Threading_Thread_Thread_internal): Free 
2071         allocated memory on error.
2073 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
2075         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
2077 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
2079         * class.c (mono_class_setup_fields): Remove duplicated local variable
2080         named gklass.
2081         Rename gklass to gtd to reflect the fact that it points to the generic
2082         type definition.
2083         Remove the duplicated call to mono_class_setup_fields on gtd and move
2084         the error check to the beginning.
2086 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
2088         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
2089         Remove cruft of the previous patch.
2091 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2093         * metadata-verify.c (verify_method_table): Check for abstract + final.
2094         Fixes #534175.
2096 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2098         * verify.c (verify_class_fields): Check for duplicate fields.
2100 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2102         * metadata-verify.c: Verify the typeref table for duplicates.
2104 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2106         This reverts r140936 and properly handles interfaces with static methods. The
2107         right fix is to ensure vtables without bubles which is an easier to verify
2108         constraint. We should avoid such special cases as of the reverted patch as those
2109         only make the runtime more brittle.
2111         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
2112         static methods on interfaces.
2114         * class.c (setup_interface_offsets): Use the number of virtual methods when
2115         calculating interface offsets instead of the number of methods. This way we
2116         avoid bubles on the layout.
2118 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
2120         * metadata-verify.c (verify_metadata_header): Some very smart
2121         obfuscators like to add extra stream headers. Ignore them.
2123 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
2125         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
2126         methods correctly.
2128 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
2130         * metadata-verify.c: Verify for duplicated types.
2132 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
2134         * metadata-verify.c (verify_typedef_table): Verify for nested types
2135         without an entry on the nested class table.
2137 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
2139         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
2140         <tom_hindle@sil.org>. Add locking around hash table accesses.
2142 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
2144         * verify.c (mono_verifier_verify_class): Verify all interface if
2145         really are interfaces. Fixes #534184.
2147 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
2149         * pedump.c: Initialize all types during metadata validation so we report
2150         errors only detected as part of class initialization.
2152 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
2154         * metadata-verify.c (verify_method_table): PInvoke requires method to
2155         be static. Fixes #534189
2157 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
2159         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
2160         being NULL.
2162 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
2164         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
2165         for holes or bad methods. Fixes #525314.
2167 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
2169         * class.c (setup_interface_offsets): Don't allocate slot
2170         for the same interface multiple times. This creates bubbles
2171         that waster space and make vtable verification harder.
2173         The same interface get a slot multiple times since we need
2174         to get the closure of all implemented interfaces, which means
2175         the same interface is reported multiple times.
2177 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
2179         * verify.c (mono_verifier_verify_class): Don't check the fields
2180         of generic instances since the context on which they got expanded
2181         might lead to false positives.
2183         Such thing happens when a generic type is inflated in the context
2184         of a generic method and the inflated type of a field turns into a
2185         generic method argument, which causes the checking code to think
2186         it's an invalid class when it's not.
2188 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
2190         * verify.c (mono_type_is_valid_in_context): Verify if type
2191         is NULL and remove duplicate test.
2193 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
2195         * verify.c (mono_verifier_verify_class): Check fields for
2196         invalid generic arguments.
2198 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
2200         * class.c (verify_class_overrides): Verify if for static
2201         and non virtual methods.
2203 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
2205         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
2206         Check for errors after retrieving the vtable.
2208 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
2210         * class.c (mono_class_setup_vtable_general): Verify
2211         if method overrides are valid before processing them.
2213 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
2215         * marshal.c (mono_array_to_lparray): Fix minimal build with
2216         cominterop disabled.
2218         * marshal.c (mono_free_lparray): Same.
2220 2009-08-21  Mark Probst  <mark.probst@gmail.com>
2222         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
2223         the hash function for the ares_htable.
2225 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
2227         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
2228         bit for assembly flags. MS is ok with it but there is no spec anywhere
2229         on its mean
2231 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
2233         * class.c (mono_class_create_from_typedef): Emit profiler events
2234         in all cases.
2236 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
2238         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
2239         Release memory on failure.
2241 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
2243         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
2244         to the internal API.
2246         * metadata.c (get_constraints): Use a single-linked table as we don't
2247         traverse it backward. Fail and return FALSE if only of the contraint types
2248         is not found.
2250         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
2251         to mono_metadata_load_generic_param_constraints except for having a return value.
2252         This has to be done since the later is part of the public API.
2254         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
2255         and fail the type.
2257         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
2258         and fail the method.
2260 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
2262         * metadata-verify.c (is_valid_method_header): Add work-around to deal
2263         with MS broken behavior of emmitting EH section sizes without the
2264         header size added.
2266 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
2268         * metadata.c (mono_type_create_from_typespec): Don't allocate image
2269         memory until we're sure that we'll need it. This avoids leaking for
2270         broken types or duplicated instantiation.
2272 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
2274         * metadata-verify.c (is_valid_method_header): Fix stupid formating
2275         mistake.
2277 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
2279         * metadata-verify.c (is_valid_method_header): Fix number of clauses
2280         and expected size calculation.
2282 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
2284         * class.c (mono_class_get_field_idx): Add fixme for broken
2285         behavior for types with multiple fields with the same name.
2286         I would rather fix it, but have no idea on how to generate
2287         such artifact for testing.
2289 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
2291         * verify.c (verifier_load_field): We should allow references to
2292         fields to be made using the generic type definition. It's up to
2293         the loader system to fail invalid ops.
2295         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
2296         are invalid.
2298 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
2300         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
2302         * metadata-internals.h: Fix declaration of 
2303         mono_metadata_interfaces_from_typedef_full.
2305         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
2306         heap_alloc_result parameter that controls if the result should be
2307         g_malloc'd.
2309         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
2310         array be g_malloc'd and properly document this public API function.
2312 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
2314         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
2315         remove METHOD_HEADER_TINY_FORMAT1.
2317         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
2319         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
2321         Both spec and MS uses only 2 bits to enumerate the kind of header.
2322         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
2323         is superfluous, only used for tiny headers with odd code lengths.
2325         This change also make sure that mono doesn't wronly interpret bit 2
2326         of fat header flags, which is currently reserved.
2328 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
2330         * metadata.c (do_mono_metadata_parse_type): Do error
2331         checking for element types. Don't abort if presented
2332         with a broken type kind.
2334 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
2336         * metadata.c (mono_metadata_parse_method_signature_full):
2337         Gracefully fail bad vararg signatures.
2339 2009-08-18  Christian Hergert  <chris@dronelabs.com>
2341         * profiler.c:
2342         * class.c: Fix warnings for uninitialized variables.
2344 2009-08-18  Christian Hergert  <chris@dronelabs.com>
2346         * icall.c: Fix _NSGetEnviron method declaration warning.
2348 2009-08-18  Christian Hergert  <chris@dronelabs.com>
2350         * icall.c:
2351         * reflection.c: Make bitwise checks explicit.
2353 2009-08-18  Christian Hergert  <chris@dronelabs.com>
2355         * debug-helpers.c:
2356         * marshal.c: Fix printf warnings.
2358 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
2360         * reflection.c (encode_cattr_value): Fix a warning.
2362 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2364         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
2365         of array bounds.
2367 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2369         * loader.c (mono_method_signature): Don't assert on broken
2370         signature. Print a more useful error message.
2372 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2374         * loader.c (mono_method_get_marshal_info): Assert if
2375         signature is invalid. Bounds check stores to the
2376         mspecs array;
2378 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2380         * loader.c (field_from_memberref): Fix warning.
2382 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2384         * loader.c (mono_method_get_param_names): Check if signature
2385         is null. Don't store beyond the size of the name array.
2387 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2389         * loader.c (mono_get_method_constrained): Check if signature
2390         is null.
2392 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2394         * loader.c (mono_loader_set_error_bad_image): Improve
2395         error messages.
2397 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2399         * loader.c (mono_get_method_full): Convert an assertion
2400         into a loader error.
2402 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
2404         * class-internals.h, class.c: Better naming and documentation.
2406 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
2408         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
2409         obj is NULL.
2411 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2413         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
2414         parsing fails.
2416 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2418         * loader.c (mono_loader_error_prepare_exception): Handle missing field
2419         errors with no class set.
2421         * loader.c (field_from_memberref): If the field signature is of the wrong
2422         type fail with a MissingFieldException instead of a BadImageException as
2423         this is the behavior observed on MS. 
2425 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2427         * loader.c (field_from_memberref): Don't crash if either the field
2428         signature or the typespec class are invalid.
2430 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2432         * verify.c (verifier_load_field): Don't allow field related
2433         ops to reference fields on generic type definition.
2435 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2437         * metadata-verify.c: Add new warning level for errors specified
2438         by ECMA 335 but that MS ignores.
2440         * metadata-verify.c (verify_method_table): Make compiler controled
2441         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
2442         this check is safe because the end result will only be some visibility
2443         exceptions been thrown.
2445 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
2447         * verify.c (get_boxable_mono_type): Don't allow the
2448         use of the generic type definition on boxed type positions.
2450         Fixes #531237.
2452 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2454         * threadpool.c: Make sure no cross-domain references remain in
2455         ares_htable or the arrays that are thrown away when resizing.
2457 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2459         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
2460         list of classes for which we have to unregister reflection_info
2461         with the GC and which are not in the namespace cache.
2463         * reflection.c (mono_reflection_initialize_generic_parameter): Add
2464         the class to the list.
2466 2009-08-14  Mark Probst  <mark.probst@gmail.com>
2468         * domain.c (mono_domain_free): Unregister the GC roots in
2469         MonoDomain.
2471 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
2473         * reflection.c (mono_reflection_type_get_handle): Fix typo.
2475 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
2477         * class.c: Add mono_class_get_field_from_name_full which does
2478         the same as mono_class_get_field_from_name but does check field
2479         signature as well.
2481         * class-internals.h: Export mono_class_get_field_from_name_full as
2482         part of the internal API.
2484         * loader.c (field_from_memberref): Search fields by name and signature
2485         as it's valid to have two fields with same name but different types.
2487         Fixes #528055.
2489 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
2491         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
2493         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
2495         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
2496         System.Type.
2498 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
2500         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
2502         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
2504 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2506         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
2507         to sgen-scan-object.h, which can be included and parameterized via
2508         macros.
2510         * Makefile.am: sgen-scan-object.h added.
2512 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2514         * gc.c: #define GC_dont_gc if we're compiling with SGen.
2516 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2518         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
2519         before clearing a domain in the GC.
2521 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2523         * exception.c (mono_exception_from_name_domain): Actually create
2524         the exception in the specified domain.
2526         * appdomain.c (mono_domain_create_appdomain_internal): Create the
2527         OutOfMemoryException a bit later so that the domain is inialized
2528         "enough" that it works.
2530 2009-08-12  Mark Probst  <mark.probst@gmail.com>
2532         * threads.c (thread_cleanup): Clean up the cached_culture_info
2533         array to prevent cross-domain references.
2535 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
2537         * metadata.c: more documentation for MonoType accessors.
2539 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
2541         Fix incorrect size definitions where the tail array isn't a list
2542         of pointers
2543         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
2544         define size.
2545         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
2546         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
2547         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
2549 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2551         * reflection.h:
2552         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
2554 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2556         * metadata.c:
2557         * loader.c:
2558         * metadata-internals.h:
2559         * method-builder.c:
2560         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
2562 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2564         * cominterop.c:
2565         * metadata.c:
2566         * metadata.h:
2567         * loader.c:
2568         * marshal.c:
2569         * reflection.c: #define for sizeof in MonoType and
2570         MonoMethodSignature.
2572 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2574         * domain.c:
2575         * domain-internals.h: add and use #define's instead of sizeof()
2576         for MonoJitInfo and MonoJitInfoTable.
2578 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
2580         * object.c:
2581         * class.h: use #define instead of sizeof() for MonoRemoteClass.
2583 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
2585         * metadata.c:
2586         * metadata.h:
2587         * object.c:
2588         * class-internals.h:
2589         * generic-sharing.c:
2590         * marshal.c: use a #define instead of sizeof() for a few
2591         structures that use a zero-length array.
2593 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
2595         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
2596         to handle inflated generic methods.
2598         * appdomain.c: Bump corlib version.
2600         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
2601         instances.
2603         * reflection.c (fixup_method): Same
2605         * reflection.c (resolve_object): Same.
2607         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
2608         g_error and a decent message.
2610 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
2612         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
2613         from the object because it could not yet be available globally
2614         (it happens if the profiler tries to create a gchandle on the
2615         MonoThread object of a thread that is still registering itself
2616         with the runtime).
2618 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
2620         * reflection.c (mono_generic_class_get_object): Initialized the
2621         managed type arguments array.
2623         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
2625         * appdomain.c: Bump corlib version.
2627 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
2629         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
2630         #527902.
2632 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
2634         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
2635         Avoid a crash if synch_cs is not set.
2636         
2637         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
2638         Handle the case when the handle is 0.
2640         * appdomain.c: Bump corlib version.
2642 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
2644         * reflection.c (mono_type_get_object): Fix a warning.
2646 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2648         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
2649         descriptor here.  We assume it's already been computed.
2651         * generic-sharing.c (instantiate_other_info): Compute the GC
2652         descriptor for info type MONO_RGCTX_INFO_KLASS.
2654 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2656         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
2657         type, so don't use MONO_OBJECT_SETREF to set a field.
2659 2009-08-01  Mark Probst  <mark.probst@gmail.com>
2661         * gc.c: We were missing one case where invoking a finalizer would
2662         not reset the domain.  Also, in the finalizer thread loop, assert
2663         that we're in the root domain.
2665 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2667         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
2668         if the type is not an array.
2670 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2672         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
2673         method bound to the declaring type of the method. Raise an exception
2674         if the type is not a generic param.
2676 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
2678         * class.c (print_unimplemented_interface_method_info): Print the
2679         full type name.
2681         * class.c (mono_class_setup_vtable_general): When dealing with a
2682         generic instance first check if the generic type definition is
2683         not broken.
2685 2009-02-11 Tom Hindke <tom_hindle@sil.org>
2687         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
2689         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
2691         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
2693         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
2695         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
2697         Code is contributed under MIT/X11 license
2699 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
2701         * verify.c: Fix naming of stelem and ldelem.
2703 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2705         * generic-sharing.c: Replace the templates lock with the loader
2706         lock because of very hard to resolve deadlock issues.
2708 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
2710         * icall.c (ves_icall_Type_GetMethodsByName): Use 
2711         mono_class_get_vtable_size () instead of accessing klass->vtable_size
2712         directly. Fixes #525338.
2714         * class.c (mono_class_get_vtable_size): New helper function.
2716         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
2717         the field belongs to the type. Fixes #525733.
2719 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2721         * sgen-gc.c: When we stop a thread and its stack top is not within
2722         its allocated stack (because it's in an altstack signal handler),
2723         restart it and stop it again, until it is.
2725 2009-07-30  Mark Probst  <mark.probst@gmail.com>
2727         * sgen-gc.c: Take a thread's stack top and registers from the
2728         sigcontext in the suspend signal handler.
2730         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
2731         stuff to sgen-archdep.h.
2733         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
2734         caller, because have code in sgen-archdep.h to acquire that data.
2736 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
2738         * profiler.c, profiler.h, profiler-private.h:
2739         Added support for keeping track of code chunks and buffers.
2741 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
2743         * metadata-verify.c: Fix endianness problems on decoding functions.
2744         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
2746 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2748         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
2749         schema for vectors and one dimension SZARRAY.
2751 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2753         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
2754         schema for vectors and one dimension SZARRAY.
2756 2009-07-27  Mark Probst  <mark.probst@gmail.com>
2758         * icall-def.h, thread-types.h, threads.c: New separate icalls for
2759         Interlocked.(Compare)Exchange with object arguments, which invoke
2760         write barriers.
2762 2009-07-26  Miguel de Icaza  <miguel@novell.com>
2764         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
2765         passed invalid arguments.   Fixes another crasher in the
2766         Silverlight test suite.
2768         * class.c (mono_class_array_element_size): Return 0 for the size
2769         of the class;  This fixes the crasher exposed by :
2771         typeof (void).MakeArrayType ();
2773         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
2774         if there is no method to dereference.    Put all the code that
2775         depends on this inside the if (method) block.
2777         This fixes the crasher exposed by Microsoft's Silvelright CLR test
2778         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
2780         With this change, we pass the test.
2781         
2782         * reflection.c (mono_reflection_sighelper_get_signature_local):
2783         Only dereference the assembly if it has been set.    Fixes a
2784         crasher exposed by #525328
2786 2009-07-25  Mark Probst  <mark.probst@gmail.com>
2788         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
2789         don't perform the store in mono_gc_wbarrier_generic_nostore().
2790         Remove the second argument (value), which is not needed.
2792 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
2794         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
2795         the build.
2797         * boehm-gc.c: Ditto.
2798         
2799 2009-07-24  Mark Probst  <mark.probst@gmail.com>
2801         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
2802         not perform the store itself.  Introduce
2803         mono_gc_wbarrier_generic_nostore(), which is the same as
2804         mono_gc_wbarrier_generic_store(), except it doesn't perform the
2805         store.
2807 2009-07-24  Mark Probst  <mark.probst@gmail.com>
2809         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
2810         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
2811         we still need the memcpy().
2813 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2815         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
2816         so that big arrays are handled correctly.  Always use
2817         safe_object_get_size() to calculate array object sizes, which
2818         takes bounds into account.
2820 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2822         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
2823         GC descriptor is computed before we use it.
2825 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2827         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
2828         write barrier if necessary.
2830 2009-07-22  Mark Probst  <mark.probst@gmail.com>
2832         * icall-def.h, icall.c, thread-types.h: New separate icall for
2833         VolatileWrite(object&,object) that uses a write barrier.
2835         * console-unix.c, file-io.c, icall.c, threads.c: Use write
2836         barriers in icalls which write to "ref" or "out" arguments.
2838 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
2840         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
2841         handler in a separate icall, to reduce the size of the wrappers.
2843 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2845         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
2847 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2849         * metadata-verify.c (parse_field): Allow byref field.
2851         * metadata-verify.c (parse_locals_signature): Allow byref locals.
2853         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
2855 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
2857         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
2858         Fixes #522784.
2860 2009-07-20  Robert Jordan  <robertj@gmx.net>
2862         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
2863         Fix invalid IL in valuetype handling (STOBJ must push the
2864         corresponding class). Fixes bug #523149.
2866         Code is contributed under MIT/X11 license.
2868 2009-07-20  Geoff Norton  <gnorton@novell.com>
2870         * gc.c: Use proper semaphores where available on posix and darwin.
2872 2009-07-19  Geoff Norton  <gnorton@novell.com>
2874         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
2876 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
2878         * refletion.c (is_sre_usertype): Change name to is_usertype and
2879         invert it's result so it returns true if the type is an user type
2880         and not the opposite.
2882         * reflection.c (is_*_type): Change all of those to use new macro
2883         check_corlib_type_cached that cached the type lookup so we don't
2884         need to do string comparisons all the type. Changed the signature
2885         to take a MonoClass instead.
2887         * reflection.c: Change mono_image_create_token and resolve_object
2888         to use is_sre_* functions.
2890 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2892         * sgen-gc.c: Check for writes to the stack in the managed
2893         wbarrier as well.
2895 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2897         * sgen-gc.c: When a thread is unregistered, don't free its remsets
2898         but put them on a list which is processed with the other thread's
2899         remsets.
2901 2009-07-18  Mark Probst  <mark.probst@gmail.com>
2903         * sgen-gc.c: Fix and enable the internal allocator instead of
2904         using malloc/free (which causes deadlocks).
2906 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
2908         * refletion.c: Fix builds with SRE disabled by adding a minimal
2909         implementation of mono_reflection_type_get_handle.
2911 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2913         * refletion.c: Make mono_reflection_type_get_handle non static.
2915         * object-internals.h: Export mono_reflection_type_get_handle.
2917         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
2918         unmanaged handle using mono_reflection_type_get_handle.
2920 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2922         * refletion.c: Replace all reads of MonoReflectionType::type with
2923         calls to mono_reflection_type_get_handle. Only the functions that
2924         deal with constructing TypeBuilder::type have not been changed
2925         because they have to deal with NULL values.
2927         This is a first step into supporting reflection types that don't
2928         map directly into their unmanaged counterpart.
2930 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
2932         * metadata-verify.c (parse_locals_signature): Don't complain
2933         on signature with zero locals since MS generates it and doesn't
2934         bother with.
2936 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
2938         * reflection.c (mono_image_get_array_token): Resolve return
2939         type using mono_reflection_type_get_handle.
2941         * reflection.c (mono_image_get_array_token): Resolve array method
2942         parent type using mono_reflection_type_get_handle.
2944 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
2946         * reflection.c (mono_image_basic_init): Applied patch from
2947         <Dax@daxxfiles.net>. Set the public key token from the assembly
2948         builder. Fixes #518909.
2950         * appdomain.c: Bump corlib version.
2952 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
2954         * class.c (mono_class_needs_cctor_run): Make this return false if
2955         the class has no cctor.
2957 2009-07-13  Mark Probst  <mark.probst@gmail.com>
2959         * sgen-gc.c: When the minor GC needs to allocate a new section,
2960         invoke the major GC afterwards.
2962 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
2964         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
2965           Applying the window_style field to the SHELLEXECUTEINFO struct.
2967         Code is contributed under MIT/X11 license.
2969 2009-07-13  Mark Probst  <mark.probst@gmail.com>
2971         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
2972         locking earlier.  Fix it in the managed allocator by making sure
2973         that no thread is stopped there before the GC runs.  If we do stop
2974         a thread there, we restart it and let it run a but, until it stops
2975         somewhere else.
2977         * gc-internal.h, gc.c: Function for getting the IP from a signal
2978         context via a function registered by mini.
2980 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
2982         * object-internals.h (MonoIntPtr): New structure describing a boxed
2983         IntPtr.
2985         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
2986         returns. Fixes #519953.
2988         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
2990 2009-07-09  Mark Probst  <mark.probst@gmail.com>
2992         * class-internals.h, generic-sharing.c: New RGCTX info type for
2993         getting a remoting invoke with check wrapper.
2995 2009-07-07  Geoff Norton  <gnorton@novell.com>
2997         * icall-def.h: Fix the enable-minimal build.
2999 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3001         * object-internals.h: Add MonoReflectionDerivedType.
3003         * reflection.c: Implement support for PointerType.
3004         Fixed tons of warnings.
3006 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3008         * object-internals.h: Add MonoReflectionByRefType.
3010         * reflection.c: Implement support for ByRefType.
3012 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3014         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
3016         * object-internals.h: Add MonoReflectionArrayType and
3017         mono_reflection_create_unmanaged_type.
3019         * reflection.c: Implement support for ArrayType.
3021 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3023         * metadata-verify.c (is_valid_method_header): Parse EH block
3024         flags correctly.
3026 2009-07-03  Mark Probst  <mark.probst@gmail.com>
3028         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
3029         processing the disappearing links, and process disappearing links
3030         in a loop until no new objects are copied.
3032 2009-07-03  Mark Probst  <mark.probst@gmail.com>
3034         * object.c (handle_enum): Invoke the write barrier when copying
3035         value type instances.
3037         * sgen-gc.c: Register remsets for unmanaged write barriers only
3038         when the address written to is actually on the heap.  This makes
3039         set_value() in object.c work without requiring that the result be
3040         on the heap.
3042 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
3044         The runtime wrappers are all bound to a given type that must
3045         exist in the same image. For regular images we use the <Module>
3046         type, which is required to exist for all images.
3048         The <Module> type can't be used for dynamic images because it
3049         might not exist at the time the wrapper is required, so we create
3050         a synthetic type to use instead.
3052         The current code works because of the 2 stage setup of MonoClass,
3053         but once this is gone it will no longer work.
3055         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
3057         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
3059         * object-internals.h: Export mono_image_set_wrappers_type icall
3060         as part of the internal API.
3062         * marshal.c (get_wrapper_target_class): If the image is dynamic,
3063         use MonoDynamicImage::wrappers_type instead of the <Module> type.
3065         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
3066         image wrappers_type to the provided value.
3068 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
3070         * appdomain.c (deregister_reflection_info_roots): No need
3071         to use the image lock here.
3073 2009-07-02  Mark Probst  <mark.probst@gmail.com>
3075         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
3077 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
3079         * threads.c: Store the thread start argument in a hash table instead of
3080         registering it as a root, as libgc doesn't support unregistering roots
3081         under windows, leading to 'too many root sets' errors when many threads
3082         are created.
3084         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
3085         shutdown, they can still be referenced by the other dying objects.
3086         Fixes #514506.
3088 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
3090         * socket-io.c: DontLinger does not allow LingerOptions.
3092 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
3094         * metadata-verify.c: The spec doesn't mention that it's possible to add
3095         custom attribute to a generic parameter. Fixed.
3097 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
3099         * class.c (inflate_generic_type): Don't crash while trying to output a message
3100         on why we're aborting.
3102 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
3104         * socket-io.c: DontLinger can take an int or a boolean too.
3106 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
3108         * gc.c: check for a null argument to SuppressFinalize () and
3109         ReRegisterForFinalize ().
3111 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
3113         * loader.c (method_from_methodspec): Call into the verifier to check
3114         the signature.
3116         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
3118         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
3119         part of the internal API.
3121 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3123         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
3124         the signature.
3126         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
3128         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
3129         part of the internal API.
3131 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3133         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
3134         the signature.
3136         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
3137         blob verification.
3139         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
3140         part of the internal API.
3142 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3144         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
3145         when doing basic verification. 
3147         This check must be done since the runtime peeks into signatures in much
3148         more places than it does decoding so it makes sense to ensure that all
3149         pointers to blob objects are well formed.
3151 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3153         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
3154         Use proper overflow dectection. Fix usage of it.
3156 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3158         * loader.c (field_from_memberref): Call into the verifier to check
3159         the signature.
3161         * loader.c (mono_method_get_signature_full): Same.
3163         * loader.c (method_from_memberref): Same.
3165         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
3167         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
3168         part of the internal API.
3170 2009-06-25  Mark Probst  <mark.probst@gmail.com>
3172         * threadpool.c (mono_thread_pool_add): If the domain is unloading
3173         or unloaded, still return an AsyncResult, but don't add it to the
3174         threadpool.
3176 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
3178         * threads.c: fix missing colon when DEBUG is defined.
3180 2009-06-25  Mark Probst  <mark.probst@gmail.com>
3182         * threadpool.c: Don't add new calls to a threadpool if the domain
3183         of the call is unloading or unloaded.  When dequeuing a job, null
3184         the reference in the queue.
3186 2009-06-25  Mark Probst  <mark.probst@gmail.com>
3188         * sgen-gc.c (null_link_in_range): Add the dislink for the old
3189         generation if an object was moved.
3191 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
3193         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
3194           parameters of type SAFEARRAY[VARIANT].
3196         * reflection.c (encode_marshal_blob): Properly generate element type
3197           (SafeArraySubType marshal attribute option).
3199         Code is contributed under MIT/X11 license.
3201 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
3203         * reflection.c: in mono_method_clear_object () really ensure all the
3204         objects are removed.
3206 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3208         * loader.c (mono_method_signature): Call into the verifier to check
3209         the method signature.
3211         * metadata-verify.c (verify_method_table): Move signature verification
3212         to verify_method_table_full.
3214         * metadata-verify.c: Add mono_verifier_verify_method_signature.
3216         * verify-internals.h: Export mono_verifier_verify_method_signature as
3217         part of the internal API.
3219 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3221         * loader.c (mono_method_get_header): Call into the verifier to
3222         check the method header.
3224         * metadata-verify.c: Add mono_verifier_verify_method_header.
3226         * verify-internals.h: Export mono_verifier_verify_method_header as
3227         part of the internal API.
3229 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3231         * class.c (mono_class_find_enum_basetype): Call into the verifier to
3232         check the field signature. Replace an assert with an explicit check.
3234         * class.c (mono_class_setup_fields): Call into the verifier to check
3235         the field signature.
3237         * metadata-verify.c: Add mono_verifier_verify_field_signature.
3239         * verify-internals.h: Export mono_verifier_verify_field_signature as
3240         part of the internal API.
3242 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3244         * class.c (mono_class_find_enum_basetype): Simplify this function
3245         by moving code outside of the loop and not decoding static fields.
3247 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3249         * metadata-verify.c (verify_typedef_table): Check the extends
3250         token here. Move to here a flags check from verify_typedef_table_full.
3252 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
3254         * metadata-verify.c (is_valid_method_header): Fix a warning.
3256         * metadata-internals.h (MonoImage): Remove the unused 
3257         static_rgctx_invoke_wrapper_cache.
3259         * image.c marshal.c: Ditto.
3261 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
3263         * image.c (do_mono_image_load): Enable table data verification.
3265 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
3267         * metadata-verify.c (is_valid_constant): Fix nullref check.
3269 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
3271         * metadata-verify.c (is_valid_constant): Fix string bounds check.
3273 2009-06-22  Mark Probst  <mark.probst@gmail.com>
3275         * sgen-gc.c: Managed allocation with pthreads TLS.
3277         * threads.c, threads-types.h: Functions for the JIT to tell the
3278         runtime whether it supports the MONO_TLS opcode.
3280 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
3282         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
3283         without methods.
3285 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
3287         * metadata-verify.c (is_valid_constant): Fix the string length check.
3288         Use safe overflow checking. Add decent error messages.
3290 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
3292         * metadata-verify.c: Move remaininh blob checks to the offline
3293         verification path.
3295 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
3297         * metadata-verify.c: Move more blob checks to the offline verification
3298         path.
3300 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
3302         * object-internals.h : Adding interrupt_on_stop field.
3304         * threads.c (mono_thread_request_interruption) : On Windows exit the
3305           thread if interrupt_on_stop is set.
3307         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
3308          Removing old interrupt logic and setting the interrupt_on_stop for the
3309          thread when calling accept.
3311         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
3312          setting the interrupt_on_stop for the thread when calling accept.
3314         Contributed under MIT/X11 license.
3316 2009-06-20  Martin Baulig  <martin@ximian.com>
3318         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
3320 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
3322         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
3323         running in no-exec mode.
3325 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3327         * metadata-verify.c (verify_method_table): Move header
3328         checking to verify_method_table_full.
3330         * metata-verify.c (mono_verifier_verify_full_table_data):
3331         Call verify_method_table_full.
3333 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3335         * metadata-verify.c (verify_field_table): Move signature
3336         checking to verify_field_table_full.
3338         * metata-verify.c (mono_verifier_verify_full_table_data):
3339         Call verify_field_table_full.
3341 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3343         * metadata-verify.c (verify_typedef_table): Move remaining
3344         stuff to verify_typedef_table_full.
3346 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3348         * metadata-verify.c: Kill is_corlib from VerifyContext.
3349         It is only used by the offline mode.
3350         So we better remove it from the runtime path.
3352 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3354         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
3355         function that perform the offline metadata verification steps.
3357         * metadata-verify.c (verify_typedef_table): Move some checks to
3358         verify_typedef_table_full and make it been called by new function
3359         mono_verifier_verify_full_table_data.
3361         * pedump.c: Call mono_verifier_verify_full_table_data.
3363         * verify-internals.h: Export mono_verifier_verify_full_table_data as
3364         part of the internal API.
3366 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3368         * metadata-verify.c (typedef_is_system_object): Fix System.Object
3369         check.
3371         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
3372         flags bits. SupportLastError was confused as bit 7 instead of 6.
3374         * metadata-verify.c (verify_implmap_table): Fix import scope verification
3375         to check against the module ref table instead of module.
3377         * metadata-verify.c (verify_implmap_table): Fix corlib check.
3379         * pedump.c: Call mono_image_load_names.
3381 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
3383         * image.c: Extract mono_image_load_names from do_mono_image_load.
3385         * metadata-internals.h: Export mono_image_load_names as part of
3386         the internal API.
3387         
3388 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
3390         * metadata.c (mono_metadata_cleanup): Free the generic method cache
3391         first, as it could reference data in the other caches.
3393 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
3395         * metadata-verify.c: Finished with method header verification.
3397 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
3399         * metadata-verify.c: Added more header verification code.
3400         Now only EH clauses are missing.
3402 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
3404         * marshal.c (get_runtime_invoke_type): Don't share primitive types
3405         for return values.
3407 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
3409         * metadata-verify.c: Initial method header verification.
3411 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
3413         * metadata-verify.c (verify_import_table): The IAT contents
3414         might end been patched by the windows DL when running with
3415         coree enabled.
3417 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
3419         * class.c (mono_class_from_typeref): If the enclosing type is not
3420         found return null instead of crashing. Fixes #508487.
3422 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
3424         * normalization-tables.h : updated to the latest unicode charcter
3425           data.
3426         * appdomain.c : bump corlib version.
3428 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
3430         * class.c (mono_class_from_name): Fix support for assembly references
3431         in the EXPORTEDTYPE table. Fixes #511704.
3433 2009-06-13  Geoff Norton  <gnorton@novell.com>
3435         * domain.c: Ensure that mono_domain_assembly_open actually opens the
3436         assembly in the target domain.
3438 2009-06-12  Robert Jordan  <robertj@gmx.net>
3440         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
3441         because "this" of the managed signature has become an
3442         ordinary parameter in the unmanaged signature.
3444 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
3446         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
3447         field for owner-less generic containers.
3449         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
3450         image field of the owner-less generic containers created here.
3452         * metadata.c (mono_metadata_load_generic_params): Ditto, the
3453         contain is ownerless until the caller sets its owner.
3455         * metadata.c (type_in_image): Handle owner-less generic containers
3456         correctly.
3457         
3458 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
3460         * image.c (mono_image_close): Support debug_assembly_unload for
3461         dynamic images too.
3463 2009-06-11 Andrés G. Aragoneses  <aaragoneses@novell.com>
3465         * class.c: Fix some typos in comments.
3467 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
3469         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
3471         * threads.c (mono_thread_execute_interruption): Avoid creating the
3472         abort exception object while holding the synch_cs lock.
3474 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3476         * metadata-verify.c: Verify basic cattr content.
3478 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
3480         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
3481         nested types.
3482         
3483         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
3484         support for nested types. Fixes #511704.
3486 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3488         * metadata-verify.c: Verify methodspec signatures.
3490 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3492         * metadata-verify.c: Verify typespec signatures.
3494 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
3496         * metadata.c (free_inflated_method): Call 
3497         mono_marshal_free_inflated_wrappers (), which was missed earlier.
3499 2009-06-08  Miguel de Icaza  <miguel@novell.com>
3501         * mono-config.c: Small change to report the PPC64/ILP32 model.
3503 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3505         * metadata-verify.c (parse_type): Check szarray.
3507 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3509         * metadata-verify.c (parse_type): Check fnptr.
3511 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3513         * metadata-verify.c (parse_type): Check generic instances.
3515 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3517         * metadata-verify.c (parse_type): Check array shape.
3519 2009-06-05  Robert Jordan  <robertj@gmx.net>
3521         * class.c (mono_class_create_from_typedef): Check only for
3522         mscorlib's System.Array.
3524 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3526         * metadata-verify.c (parse_type): Check pointer, class/valuetype
3527         and generic params. 
3529         * metadata-verify.c (parse_field): Check the signature.
3531 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3533         * metadata-verify.c: Implement locals signature check.
3535 2009-06-04  Marek Safar  <marek.safar@gmail.com>
3537         * domain.c: Add .NET 4.0 Beta 1 version.
3539 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
3541         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
3542           For QueryInterface on CCWs consider the base class
3543           interfaces as well.
3545         Code is contributed under MIT/X11 license.
3547 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
3549         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
3551         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
3552         used.
3554         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
3555         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
3557         * generic-sharing.c (inflate_other_data): Ditto.
3558         
3559 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3561         * metadata-verify.c: Implement property signature check.
3563 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3565         * sgen-gc.h: Register saving support for PPC.
3567 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3569         * sgen-gc.c: Fixed a pthread TLS screwup.
3571 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3573         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
3574         supported.
3576 2009-06-04  Mark Probst  <mark.probst@gmail.com>
3578         * sgen-gc.c: Disable TLA and managed allocation if the __thread
3579         keyword is not supported.
3581 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
3583         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
3584         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
3585         the inflated method is freed. Fixes #508389.
3587         The code is contributed under the MIT/X11 license.
3588         
3589 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
3591         * marshal.c (get_wrapper_target_class): New helper function.
3592         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
3593         the <Module> class of the image. Fixes #509049.
3595 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3597         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
3598         Check if the thread was interrupted and proccess it straight away.
3599         Makes abortion much more responsive.
3601 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3603         * threads.c (mono_thread_execute_interruption): Use atomic cas with
3604         MonoThread::interruption_requested to match it's counterpart.
3606         Fixes a hang in abort-stress-1 on a 2 core x86.
3608         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
3609         Fix warning.
3611 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3613         Change MonoImage::name_cache to be protected by the image lock
3614         instead of the loader lock.
3616         * appdomain.c (deregister_reflection_info_roots): Protect access
3617         to name_cache.
3619         * class.c (mono_image_init_name_cache): Change from the loader lock
3620         to the image lock. Check if the cache wasn't already created.
3622         * class.c: Change from the loader to the image lock.
3624         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
3625         the code to hold the image lock while iterating over name_cache and
3626         not go into mono_array_new holding it.
3628         * metadata-internals.h: Add a comment about this change.
3630 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3632         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
3633         Under the 2.0 profile raise the loader error.
3635         Fixes #508532.
3637 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3639         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
3640         of ldind opcode for generic instances so we don't fail for direct wrappers.
3641         This only affect direct calls.
3643 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
3645         * reflection.c (create_dynamic_mono_image): Fix warnings.
3647         * generic-sharing.c (other_info_equal): Ditto.
3648         
3649 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3651         * metadata-verify.c: Implement field signature check.
3653 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3655         * metadata-verify.c: Implement standalone signature check.
3657 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3659         * metadata-verify.c: Implement methodref signature check.
3661 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
3663         * object-internals.h (MonoRuntimeCallbacks): New structure containing
3664         callbacks supplied by the runtime.
3666         * object.c (mono_install_callbacks): New internal function to install
3667         the callbacks.
3669         * object.c (mono_create_ftnptr): Move the implementation of this to
3670         mini/.
3672         * object.c (mono_get_addr_from_ftnptr): Ditto.  
3674 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3676         * metadata-verify.c (parse_return_type): Proper byref check.
3677         * metadata-verify.c (is_valid_method_signature): Check for zero arity
3678         generic signatures and method params.
3680 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3682         * metadata-verify.c (decode_signature_header): Fix bounds check.
3684         * metadata-verify.c (parse_custom_mods): Check custom mods.
3686         * metadata-verify.c (parse_type): Do initial basic verification
3687         of valid values.
3688         
3689         * metadata-verify.c (is_valid_method_signature): Parse the generic
3690         param count.
3692 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
3694         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
3695         discarded based on their most specific definition so we set the method_slots
3696         array before checking if the method is acceptable or not.
3698         Fixes #506757.
3700 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3702         * icall.c: Free the old array when resizing a mono_ptr_array.
3704 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3706         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
3707         for the hashes whose keys are managed objects.
3709 2009-05-26  Mark Probst  <mark.probst@gmail.com>
3711         * object-internals.h, threads.c: Set the execution context on
3712         thread start here, not in corlib.
3714         * appdomain.c: Bump corlib version.
3716 2009-05-27  Martin Baulig  <martin@ximian.com>
3718         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
3719         if `_mono_debug_using_mono_debugger' is set to make things work
3720         properly when embedding Mono.
3722 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
3724         * class.c (mono_class_setup_fields): Don't mark simd types as having
3725         16 bytes alignment as the whole runtime doesn't support.
3727 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
3729         * metadata-verify.c (safe_read): Use endian safe read macros.
3731 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
3733         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
3734         it is read-only when using full aot.
3736 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3738         * metadata-verify.c (is_valid_method_signature): Verify parts
3739         of the return type. Provide an error message in case of failure.
3741 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3743         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
3745 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
3747         * metadata-verify.c: Include the size prefix in the bounds check.
3749 2009-05-22  Miguel de Icaza  <miguel@novell.com>
3751         * icall.c: Remove warnings.
3753         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
3754         prevent auto-detection based on GCC defines.
3756         Add PS3
3758         * metadata-verify.c: Do not include signal.h
3760         * generic-sharing.c, marshal.c: Add returns to avoid some warning
3761         messages.  Not sure why the g_assert_not_reached is not enough to
3762         quiet the compiler.
3763         
3765         * appdomain.c: Remove code that is not used when
3766         DISABLE_SHADOW_COPY is set.
3768         * image.c: use g_getenv
3770 2009-05-21  Miguel de Icaza  <miguel@novell.com>
3772         * reflection.c: Remove code that it not used with
3773         DISABLE_REFLECTION_EMIT is defined.
3775 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
3777         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
3778         invoke wrappers.
3780 2009-05-20  Miguel de Icaza  <miguel@novell.com>
3782         * socket-io.c
3783         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
3784         the ifdef here and instead put that on io-layer
3786 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3788         * metadata-verify.c: Verify the generic param constraint table.
3790 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3792         * metadata-verify.c (verify_generic_param_table): Fix
3793         thinko on the valid flags bits for generic params.
3795 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3797         * metadata-verify.c: Verify the methodspec table.
3799 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3801         * metadata-verify.c: Verify the generic param table.
3803 2009-05-19  Mark Probst  <mark.probst@gmail.com>
3805         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
3807 2009-05-19  Mark Probst  <mark.probst@gmail.com>
3809         * sgen-gc.c: Use generation enum more consistently and use the
3810         correct generation in mono_gc_register_for_finalization().
3812 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3814         * metadata-verify.c: Verify the nested class table.
3816 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3818         * metadata-verify.c: Verify the manifest resource table.
3820 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
3822         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
3824 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
3826         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
3827         wrappers, this is now done in the JIT.
3828         
3829         * class.c (mono_set_generic_sharing_supported): New internal function.
3830         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
3832 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3834         * metadata-verify.c: Verify the exported type table.
3836 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3838         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
3840 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3842         * metadata-verify.c: Verify the file table.
3844 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3846         * metadata-verify.c (verify_assembly_table): Fix an error message.
3848         * metadata-verify.c: Verify the assemblyref table.
3850 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
3852         * metadata-verify.c (verify_assembly_table): Fix the valid
3853         bits mask for flags.
3855 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
3857         * debug-helpers.c (mono_method_full_name): Print generic parameters of
3858         generic methods as well.
3860 2009-05-15  Geoff Norton  <gnorton@novell.com>
3862         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
3863         use-case and is significantly more performant than the wapi layer.
3865 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3867         * metadata-verify.c: Verify the assembly table.
3869 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3871         * metadata-verify.c: Fix rows limit check.
3873 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3875         * metadata-verify.c: Verify the fieldrva table.
3877 2009-05-13  Mark Probst  <mark.probst@gmail.com>
3879         * sgen.c: Speed up weak links and finalizers by grouping them by
3880         generation.
3882 2009-05-13  Mark Probst  <mark.probst@gmail.com>
3884         * marshal.c (delegate_hash_table_add): When overwriting an entry,
3885         free the old GCHandle (only applies to SGen).
3887 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
3889         * loader.c (mono_get_method_from_token): Avoid the expensive call to
3890         mono_metadata_load_generic_params () for non-generic methods.
3892 2009-05-12  Mark Probst  <mark.probst@gmail.com>
3894         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
3895         New function for returning a monitor's weak link if it has one.
3897         * sgen-gc.c: Remove an object's monitor's weak link (if it has
3898         one) when clearing a domain.  These can still be around because
3899         the object might not have been collected.
3901 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
3903         * gc.c: Fix a warning.
3905 2009-05-12  Kornél Pál  <kornelpal@gmail.com>
3907         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
3908         prevous wait that resulted in a deadlock on Windows when initializing
3909         the runtime form DllMain. Also results in improved startup time.
3910         (finalizer_thread): Get rid of thread_started_event.
3911         * threads.c, threads-types.h (mono_thread_create_internal): Return the
3912         resulting MonoThread.
3914         Contributed under MIT/X11 license.
3916 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
3918         * metadata-verify.c: Verify the implmap table.
3919         Don't require that #US and #Strings be present.
3921 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
3923         * security-core-clr.c: Delegate checks are done at creation time,
3924         not a invocation time. Fix exception for Telerik Silverlight demo
3926 2009-05-11  Mark Probst  <mark.probst@gmail.com>
3928         * sgen-gc.c (need_remove_object_for_domain): Remove the special
3929         case for the Thread class.
3931         * threads.c: Do clean-up of abort exception/state in
3932         thread_cleanup() instead of Thread.free_internal().  Also clean up
3933         current_appcontext.  The reason we have to do that is because
3934         those references might point into another domain and if that
3935         domain is unloaded before the thread is finalized, they point to
3936         invalid data.
3938 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
3940         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
3941         stub signatures.
3942         
3943         Contributed unter MIT/X11 license.
3945 2009-05-09  Miguel de Icaza  <miguel@novell.com>
3947         * verify.c, metadata-verifier.c: Add support for disabling the
3948         verifier in some builds.
3950         [ Sorry, my previous commit accidentally commited some work in
3951         progress ]
3953 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
3955         * class.c (mono_class_setup_fields): Set class->field.first for
3956         generic instances.
3958 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
3960         * metadata-verify.c: Verify the typespec table.
3962 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
3964         * metadata-verify.c: Verify the module table.
3966 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3968         * metadata-verify.c: Verify the methodimpl table.
3970 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3972         * metadata-verify.c: Verify the property table.
3974 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
3976         * debug-helpers.c (mono_method_desc_match): Add support for generic
3977         glob patterns.
3979 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
3981         * metadata-verify.c: Verify the propertymap table.
3983 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
3985         * metadata-verify.c: Verify the event table.
3987         * metadata-verify.c (search_sorted_table): Fix offset
3988         calculation.
3990 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
3992         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
3994 2009-05-01  Mark Probst  <mark.probst@gmail.com>
3996         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
3997         because mono_delegate_free_ftnptr() needs it.
3999 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4001         * metadata-verify.c: Verify the eventmap table.
4003 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4005         * metadata-verify.c: Verify the standalonesig table.
4007 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4009         * metadata-verify.c: Verify the field layout table.
4011 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4013         * class.c (mono_type_get_name_recurse): Don't crash
4014         for ownerless generic params.
4016         * debug-helpers.c (mono_type_get_desc): Correct the format
4017         for ownerless generic params.
4019 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4021         * metadata-verify.c: Verify the class layout table.
4023 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4025         * metadata-verify.c: Verify the decl security table.
4027 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4029         * domain.c (mono_domain_set_internal_with_options): Don't do
4030         anything if the old domain is the same as the old one.  Fixes
4031         #499326.
4033 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4035         * appdomain.c: Deregister the reflection_info roots when unloading
4036         a domain.
4038         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
4039         memory allocated by a domain and frees its disappearing links.
4041         * boehm-gc.c, null-gc.c: Empty implementation of
4042         mono_gc_clear_domain().
4044 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4046         * appdomain.c (clear_cached_vtable): Free the static fields memory
4047         block.
4049 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4051         * gc.c: Set the correct domain when invoking finalizers.
4053         * appdomain.c: Set the correct domain when creating threads.
4055 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4057         * sgen-gc.c: Fix skip size for vectors.
4059 2009-05-03  Martin Baulig  <martin@ximian.com>
4061         * mono-debug-debugger.c
4062         (mono_debugger_check_breakpoints): Check class init handlers even
4063         if we don't have any method load handers.
4065 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
4067         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
4068         returning refonly assemblies if refonly is FALSE. Fixes #499013.
4070 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
4072         * metadata-verify.c: Verify the field marshal table.
4074 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
4076         * metadata-verify.c: Verify the custom attribute table.
4078 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4080         * metadata-verify.c: Verify the constant table.
4082 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4084         * metadata-verify.c: Verify the memberef table.
4086 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4088         * metadata-verify.c (get_coded_index_token): Remove
4089         dead argument.
4091 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4093         * metadata-verify.c: Verify the interfaceimpl table.
4095 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4097         * verify.c: Improve error message.
4099         * debug-helpers.c (mono_type_get_desc): Harden the code that
4100         deals with VAR and MVAR.
4102 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
4104         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
4105         part of #498692.
4107 2009-04-23 Tom Hindle <tom_hindle@sil.org>
4109         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
4110         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
4112 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
4114         * security-core-clr.c: Avoid redundant checks for platform code, 
4115         e.g. check for method and for class (very common) and check
4116         for class and outer class (less common)...
4118 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
4120         * reflection.c: Avoid returning random cattrs for synthetic methods.
4121         Fixes #498545.
4123 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
4125         * assembly.c: assemblies in the GAC should never be shadow-copied.
4127 2009-04-26  Mark Probst  <mark.probst@gmail.com>
4129         * domain.c, domain-internals.h: Disable
4130         track_resurrection_{objects,handles}_hash in MonoDomain if using
4131         SGen.
4133 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4135         * metadata-verify.c: Verify the param table.
4137 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4139         * metadata-verify.c (verify_typedef_table): Range check FieldList and
4140         MethodList.
4142         * metadata-verify.c (verify_method_table): Proper check the ParamList
4143         field.
4145 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4147         * metadata-verify.c (verify_method_table): Check for runtime
4148         implemented functions such as delegate .ctors. Remove spurious
4149         printf.
4150         
4151 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4153         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
4155 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
4157         Don't allocate MonoGenericInfo for ownerless generic params.
4158         * class-internals.h (MonoGenericParam::info): Move field to ...
4159         (MonoGenericParamFull): ... this.  New struct.
4160         (MonoGenericContainer::type_params): Change type to
4161         MonoGenericParamFull.
4162         (MonoGenericParam, MonoGenericContainer): Update accessors.
4163         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
4164         'info' field for ownerless generic param.
4165         (mono_metadata_load_generic_params): Update to changes.
4166         * reflection.c (mono_reflection_create_generic_class): Likewise.
4167         (reflection_methodbuilder_to_mono_method): Likewise.
4168         (mono_reflection_initialize_generic_parameter): Likewise.
4170 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
4172         Don't use MonoGenericParamInfo for ownerless generic params.
4173         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
4174         use ParamInfo class at all.
4175         (mono_class_from_generic_parameter): Use them.
4176         (make_generic_param_class): Fix a couple of instances where 'pinfo
4177         == NULL' wasn't handle.
4179 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
4181         * class.c (make_generic_param_class): Carve out of ...
4182         (mono_class_from_generic_parameter): ... here.
4184 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
4186         Simplify mono_class_from_generic_parameter
4187         * class-internals.h (MonoGenericParamInfo::token): New field.
4188         * metadata.c (mono_metadata_load_generic_params): Initialize it
4189         from metadata.
4190         * class.c (mono_class_from_generic_parameter): Use it instead of
4191         searching through metadata.
4193 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4195         * metadata-verify.c: Add verification of the method table.
4197 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4199         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
4200         Delegate::Invoke optimization.
4202 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4204         * appdomain.c (mono_domain_create_appdomain_internal): Free the
4205         string returned by get_shadow_assembly_location_base.
4207         * appdomain.c (get_shadow_assembly_location_base): Add a comment
4208         about caller's ownership.
4210 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4212         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
4213         reflection memory on domain unload.
4215         * domain.c (mono_domain_free): Don't free refobject_hash, let the
4216         reflection cleanup code do it.
4218         * domain-internals.h: Add mono_reflection_cleanup_domain.
4220         This fixes a memory leak for managed mirrors of reflection objects
4221         on domain unload. 
4223 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
4225         * metadata-verify.c: Implement more verification of the field table.
4227 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
4229         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
4230         doesn't try to parse the input assembly, which can be broken.
4232 2009-04-23  Mark Probst  <mark.probst@gmail.com>
4234         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
4235         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
4236         by using the lowest bit in the link to store whether the link is
4237         tracked.  Move the track_resurrection hashes into boehm-gc.c.
4239 2009-04-22  Miguel de Icaza  <miguel@novell.com>
4241         * Makefile.am: Split the console support in platform specific code
4242         and put together a framework for making this easy in the future so
4243         that we can start splitting code instead of having a mess of PLATFORM_WIN32
4245 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
4247         * pedump.c: Fix a warning.
4249 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
4251         * verify.c (mono_delegate_type_equal): Compare valuetypes using
4252         mono_class_from_mono_type to avoid bad interactions with the dual representation
4253         of the generic type definition.
4255 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
4257         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
4258         get the MonoClass for the call context type as it might be a generic
4259         instance.
4261         Fixes #491483.
4263 2009-04-21  Mark Probst  <mark.probst@gmail.com>
4265         * object-internals.h: The Thread object has no execution_context
4266         member anymore.
4268         * threads.c, threadpool.c, threads-types.h: Accessor functions for
4269         the execution context.
4271         * appdomain.c: Bump corlib version.
4273 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
4275         * verify.c (do_newobj): Improve error message.
4277 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
4279         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
4280         is nested in the filter block.
4282         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
4283         block is not fully nested.
4285         Fixes #495656.
4287 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
4289         * verify.c (verify_type_compatibility_full): Compare MonoClass and
4290         not MonoType to check for equality of valuetypes as the generic type
4291         definition allows for two different encodings: the generic type definition
4292         class or a generic instance over the GTD arguments.
4294         Fixes #496175.
4296 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
4298         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
4300         * verify.c (do_initobj): Improve error message.
4302 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
4304         * metadata-verify.c: Enable pe verification as the issue with #496453
4305         is that the authenticode data directory have a different unspecified
4306         format. Ignore it for now.
4308         * pedump.c: Run the metadata verifier together with the IL verifier.
4310         Fixes ##496453.
4312 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
4314         * metadata-verify.c: Temporarily disable pe verification due to #496453.
4316 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
4318         * class.c (can_access_type): Check visibility against
4319         the element type for pointers and arrays.
4321         Fixes #496150.
4323 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
4325         * metadata-verify.c: Fix cli and table verification to use information
4326         from the MonoImage. A lot of duplicated code got killed.
4328 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
4331         This patch starts to integrate the metadata verifier with the runtime code.
4333         This patch causes major regression in functionality for the metadata verifier
4334         as cli and table verification are disabled since they require to be ported to
4335         use MonoImage information.
4337         * image.c (do_mono_image_load): Split the code in this function
4338         into mono_image_load_pe_data and mono_image_load_cli_data.
4339         Add     care_about_pecoff parameter to not load pecoff data.
4340         Call into the metadata verifier for pecoff and cli verification.
4342         * image.c (mono_image_open_raw): New function that doesn't perform
4343         any parsing of the image contents.
4344         
4345         The reason for the 3 new functions is to give pedump better control
4346         into the interaction with the verifier.
4348         * metadata-internals.h: Add new functions from image.c as part of the
4349         internal mono API.
4351         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
4352         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
4353         to make those functions work together with the runtime.
4355         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
4356         true if the image needs to be verified.
4358         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
4360         * pedump.c: Use new metadata verifier API.
4362 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
4364         * object.c (mono_install_vtable_trampoline): Make this receive a
4365         trampoline creation function instead of trampoline, allowing the JIT
4366         to use a different trampoline for each vtable.
4368 2009-04-18  Mark Probst  <mark.probst@gmail.com>
4370         * object.c (mono_raise_exception): Don't reset the thread abort
4371         exception state here.
4373 2009-04-18  Mark Probst  <mark.probst@gmail.com>
4375         * icall-def.h: New icall for getting the thread abort exception
4376         state for a thread.
4378         * object.c, thread.c, object-internals.h: A thread's abort
4379         exception state is now a GC handle.  To get the object it stands
4380         for, we must move it into the current app domain, if it's
4381         different than the one where it originated from.
4383         * appdomain.c: Bump corlib version.
4385         * domain.c, domain-internals.h: New function for setting the
4386         domain and migrate the thread abort exception or not.
4388 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4390         * metadata-verify.c: Add initial verification of the
4391         field table.
4393 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4395         * metadata-verify.c: Add a macro to conditionally enable
4396         dumping of verification information. Add  make_coded_token
4397         and search_sorted_table to enable search sorted tables
4398         by a given coded token.
4400 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4402         * metadata-verify.c: Add array mapping from table index
4403         to description offset. Add get_col_offset and get_col_size
4404         functions.
4406 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4408         * metadata-verify.c: Add remaining table descriptions offsets.
4409         Add remaining coded index descriptions.
4411 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4413         * metadata-verify.c: Fixed constant table description.
4414         Fixed calculation of HasCustomAttribute coded index size.
4415         Fixed calculation of size for many table indexes. 
4417 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4419         * pedump.c (dump_metadata): Dump table offset instead
4420         of useless pointer in memory.
4422 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
4424         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
4426 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4428         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
4429         a missing of for interface types.
4431 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4433         * metadata-verify.c (verify_pe_optional_header): Add comment of why
4434         the code is commented.
4436         * metadata-verify.c (verify_resources_table): Remove spurious printf
4437         and don't fail if there are unmanaged resources. Gmcs generates a useless
4438         one     for all assemblies - I bet it's some MS compatibility junk.
4440 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4442         * metadata-verify.c (verify_typedef_table): Verify the extends field.
4444         * metadata-verify.c (mono_image_verify): Add a is_corlib.
4446         * verify-internals.h: Same.
4448         * pedump.c: Fix for mono_image_verify new signature.
4450 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4452         * metadata-verify.c (verify_typedef_table): Verify for some invalid
4453         flags combinations.
4455 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4457         * metadata-verify.c (verify_module_table): Ignore the generation field.
4459 2009-04-15  Martin Baulig  <martin@ximian.com>
4461         * debug-mono-symfile.c
4462         (mono_debug_symfile_lookup_location): Don't print a warning for
4463         unknown extended opcodes if they're within 0x40 and 0x7f.
4465 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
4467         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
4468         invoke signatures returning an enum. Fixes #494847.
4470 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4472         * metadata-verify.c: Initial code to verify the typedef table.
4474 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4476         * verify.c (mono_method_verify): Don't fail if an unconditional branch
4477         with non empty stack happens before the beginning of a try block.
4479         Fixes #494812.
4481 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4483         * metadata-verify.c: Verify typename and typenamespace fields of
4484         the typeref table.
4486 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
4488         * metadata-verify.c: Initial code to verify the typeref table.
4490 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
4492         * verify.c (verify_delegate_compatibility): Fix error message.
4494 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
4496         * security-core-clr.c: Fix typo
4498 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
4500         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
4501         a MonoGHashTable to keep its values alive.
4502         (emit_marshal_boolean): Fix a warning.
4504 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
4506         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
4507         not have any interface configured for IPv4/IPv6.
4509 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
4511         * assembly.c: fix typo in error message.
4513 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
4515         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
4516         allocating the location holding the this argument to prevent
4517         'too many root sets' errors.
4519         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
4520         to mark fields as special static.
4521         (mono_field_static_get_value): Handle special static fields.
4522         (mono_field_static_set_value): Ditto.
4524         * class-internals.h (struct _MonoClassField): Document this.
4526 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4528         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
4529           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
4530           case.  This will handle when managed code returns null to native code.
4532         Code is contributed under MIT/X11 license.
4534 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4536         * object.c (build_imt_slots): Changing a free to a g_free to match
4537           the g_malloc0 in add_imt_builder_entry that allocated this memory.
4539         Code is contributed under MIT/X11 license.
4541 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
4543         * marshal.c (emit_marshal_boolean): Adding code to ensure that
4544           the correct TRUE value is passed through the marshaling layer.
4546         Code is contributed under MIT/X11 license.
4548 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
4550         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
4551         correctly. Fixes #492330.
4552         
4553         * marshal.c: Fix the embedding of object pointers into JITted code in
4554         the native-to-managed wrappers by allocating some GC tracked memory, and
4555         embedding the address of that.
4557 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
4559         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
4560         pointers into the vtable.
4562 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
4564         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
4566         * verify.c (verify_ldftn_delegate): Improve error message.
4568 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
4570         * reflection.c (my_mono_class_from_mono_type): Remove.
4572 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
4574         Prepare to reduce memory usage of owner-less generic parameters (1/n)
4575         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
4576         and constraints fields into ...
4577         (MonoGenericParamInfo): ... this.
4578         (mono_generic_param_info, mono_generic_container_get_param_info):
4579         New accessors.
4580         * class.c, debug-helpers.c, icall.c: Update to changes.
4581         * metadata.c, reflection.c, verify.c: Likewise.
4583 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
4585         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
4587         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
4588         
4589         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
4590         booleans with sbytes.
4592 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4594         * class.c (can_access_instantiation): Verify accesibility of element types
4595         for arrays and pointers.
4597         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
4599         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
4601         Fixes #493068.
4603 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4605         * verify.c (do_invoke_method): Improve error messages.
4607 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
4609         * verify.c:  Fixing the MSVC build.
4611         Code is contributed under MIT/X11 license.
4613 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4615         * security-core-clr.c: Simplify get_reflection_caller not to call
4616         mono_method_get_last_managed (another stack walk) and adjust the
4617         callers to handle a (should not happen) NULL return value.
4619 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4621         Add accessors to some MonoGenericParam fields
4622         * class-internals.h (mono_generic_param_owner): New accessor.
4623         (mono_generic_param_num): Likewise.
4624         (mono_type_get_generic_param_owner): New helper.
4625         (mono_type_get_generic_param_num): New helper.
4626         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
4628 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4630         * class-internals.h (mono_generic_container_get_param): New wrapper.
4631         * class.c, icall.c, metadata.c, verify.c: Use it.
4633 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
4635         Fix gtest-252.cs
4636         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
4637         the standard case/loop.  In particular, don't complain about
4638         references to generic type definitions.
4640 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
4642         * debug-helpers.c (dis_one): Decode string arguments.
4644 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4646         * pedump.c (dump_verify_info): Dump type name correctly.
4648 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4650         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
4651         are larger than code size.
4653         This can happen in valid code if the try/catch block is not followed by any instruction
4654         and do a backward branch on the leave instruction.
4656         Fixes #492494.
4658 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
4660         * security-core-clr.c: Fix typo while comparing second method names
4661         in can_avoid_corlib_reflection_delegate_optimization
4663 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
4665         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
4667         Fixes #487738.
4669 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
4671         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
4672         a MVAR using a class context.
4674         Fixes #490335.
4676 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
4678         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
4680         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
4682         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
4683         functions supplied by the JIT for the SGEN GC.
4685         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
4686         
4687 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
4689         monitor.c (mono_monitor_try_enter_internal):
4690         Added calls to profile monitor contentions.
4691         Also duplicated a small piece of code (the "get the monitor" logic)
4692         from the fast path to the slow path, and changed the relevant goto
4693         statements, so that monitor acquisition events can be emitted from the
4694         slow path (this is by Paolo Molaro).
4696 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
4698         * profiler.c, profiler.h, profiler-private.h:
4699         Added support for profiling monitor contentions.
4701 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
4703         * metadata-verify.c: Verify the modules table.
4705 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
4707         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
4708         using the context of the method been verifier and not of the method been called.
4710         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
4711         safely inflate generic types. 
4713 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
4715         * security-core-clr.c: Change the strategy for checking the 
4716         "reflection using delegates optimization" to avoid unneeded 
4717         attributes in multiple class libraries.
4719 2009-04-02  Mark Probst  <mark.probst@gmail.com>
4721         * sgen-gc.c: Remove object element in the disappearing link struct
4722         by storing the object pointer in the link.
4724 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4726         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
4728 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4730         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
4732         * verify.c (mono_method_verify): Do proper bounds checking of exception
4733         clause ranges.
4735 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
4737         * loader.c (mono_field_from_token): Don't crash if the field parent could
4738         not be decoded.
4740 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4742         * sgen-gc.c: Execute critical finalizers after ordinary
4743         finalizers.
4745         * class-internals.h, domain.c: Add CriticalFinalizerObject to
4746         mono_defaults.
4748 2009-03-31 Jb Evain <jbevain@novell.com>
4750         * verify.c (do_ldstr): don't check if a string is in the user strings
4751         heap if the current image is dynamic.
4753 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4755         * sgen-gc.c: Wait until the last finalizer has executed when
4756         returning from WaitForPendingFinalizers.
4758 2009-03-31  Martin Baulig  <martin@ximian.com>
4760         * mono-debug-debugger.h (MonoDebuggerEvent): Add
4761         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
4762         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
4763         (mono_debugger_event_create_appdomain): New function.
4764         (mono_debugger_event_unload_appdomain): New function.
4766         * appdomain.c (mono_domain_create_appdomain_internal): Call
4767         mono_debugger_event_create_appdomain().
4769 2009-03-31  Martin Baulig  <martin@ximian.com>
4771         * mono-debug-debugger.c
4772         (mono_debugger_register_class_init_callback): Also register the
4773         class init callback if the class is already initialized to make
4774         things work with shadow copied assemblies.
4776 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
4778         * security-core-clr.c
4779         (mono_security_core_clr_ensure_reflection_access_field): Let 
4780         critical code access the field (just like we do for methods). Use
4781         check_field_access helper.
4782         (mono_security_core_clr_ensure_reflection_access_method): Use 
4783         check_field_access helper.
4785 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4787         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
4788         call the run-finalize function directly.
4790         * gc.c, gc-internal.h: Make run_finalize() non-static.
4792 2009-03-31  Mark Probst  <mark.probst@gmail.com>
4794         * sgen-gc.c: Use a separate struct for disappearing links.
4796 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
4798         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
4799         * MaxIOVectorLength enabled, just ignore them.
4800         Fixes bug #349688.
4802 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
4804         * metadata-verify.c: Fix eglib build.
4806 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
4808         * threads-types.h: Fix the win32 build.
4810 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
4812         * class.c: move coreclr inheritance/override checks to 
4813         security-core.clr.c
4814         * security-core.clr.c|h: add code from class.c with additional
4815         documentation. Fix override check when the method is not critical.
4817 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
4819         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
4820         (match_class): Ditto.
4822 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
4824         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
4826         * metadata-verify.c: Implement table layout row size calculation. Verify
4827         the total size of the tables.
4829 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
4831         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
4833 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
4835         * appdomain.c:
4836         * console-io.[ch]: added new mono_console_init() to make sure that
4837         file descriptors 0, 1 and 2 are opened.
4838         Bug #489019 fixed.
4840 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
4842         * appdomain.h: Export a new callback type and a new function to
4843         set this callback. This allow a mono host to provide it's own
4844         definition for "platform code".
4845         * metadata-internals.h: Add a core_clr_platform_code flag on 
4846         _MonoImage to (cache and) know if it is representing platform 
4847         code.
4848         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
4849         on platform code images.
4850         * security-core-clr.c|h 
4851         (mono_security_set_core_clr_platform_callback): Allow the host
4852         to provide it's own platform check definition.
4853         (mono_security_core_clr_determine_platform_image): Detect if an 
4854         image is platform code (using the specified callback).
4855         (mono_security_core_clr_is_platform_image): Return cached value 
4856         for platform code.
4858 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
4860         * threads.c (mono_create_thread): New helper function to wrap CreateThread
4861         which has different parameter types for the 'tid' argument in windows and
4862         the io-layer.
4864         * appdomain.c attach.c threads.c: Use the new helper.
4866 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
4868         * metadata-verify.c: Verify valid table bits.
4870 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
4872         * metadata-verify.c (verify_metadata_header): Store size in the size field.
4874         * metadata-verify.c: Add initial table schema verification.
4876 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
4878         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
4879         obtain the refclass argument needed by mono_param_get_objects (). Fixes
4880         #488383.
4882         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
4884         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
4886 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
4888         * security-core-clr.c: Add/update documentation
4890 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
4892         * marshal.c (emit_marshal_object): Generate code to throw an exception
4893         instead of throwing it. Fixes #488670.
4895 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
4897         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
4898         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
4899         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
4900         and add a call to mono_security_core_clr_ensure_delegate_creation
4901         to do the extra checks required by CoreCLR.
4902         * security-core-clr.c|h: Add function to check delegate creation,
4903         both in the binding and accessibility, under CoreCLR.
4905 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
4907         * reflection.c (mono_reflection_create_dynamic_method): when 
4908         coreclr is enabled make sure that every resolved object are
4909         checked (e.g. field and method access).
4910         * security-core-clr.c|h: Add function to check objects resolved
4911         when a dynamic method is created.
4913 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4915         * metadata-verify.c: Cache directory rva translations.
4917         * metadata-verify.c: Add cli-header and streams verification.
4919 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4921         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
4922         the wrong offset (8 instead of 6).
4924 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
4926         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
4927         methods, return the native function address itself. Fixes
4928         #487758.
4930 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
4932         * console-io.c: some of the values for control characters might not be
4933         present.
4935 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
4937         * exception.c|h: Add helpers to create [Field|Method]AccessException
4938         * icall.c: Add required coreclr check calls for field reflection.
4939         Move the existing (method) check logic into security-core-clr.c
4940         * security-core-clr.c: Add functions to check if the access of a
4941         field or method is allowed when reflecting under coreclr. This is
4942         mostly done using a stack walk to find the "real" caller: i.e. the
4943         code that is calling the reflection
4945 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
4947         * gc-internal.h: Change location of gc_wrapper.h
4949 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
4951         * class.c: Simplification to coreclr checks for overrides that
4952         makes it easier to set breakpoints.
4954 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
4956         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
4957         mono_security_core_clr_method_level): Avoid potential 
4958         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
4959         user/application code) and make it easier to set breakpoints
4961 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4963         * metadata-verify.c: Reject cli header tables that mono don't handle.
4965 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4967         * pedump.c: Fix CLI header dumping.
4969 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4971         * metadata-verify.c: More CLI header verification.
4973 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
4975         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
4977 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
4979         * metadata-verify.c: Initial verification of the CLI header.
4981 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
4983         * metadata-verify.c (verify_resources_table): Fix verification of zero
4984         sized resource section and id entries count.
4986 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
4988         * icall.c: Handle user types in many Type icalls. Fixes #486303.
4990 2009-03-17  Jb Evain  <jbevain@novell.com>
4992         * profiler.c: call mono_gc_base_init from mono_profiler_load.
4994 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
4996         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
4997         (mono_gc_make_descr_for_array): Ditto.
4999 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
5001         * verify.c (mono_verifier_is_class_full_trust): Add support for
5002         CoreCLR security mode where trusted assemblies are defined as
5003         "platform code".
5005 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
5007         * metadata-verify.c: Add minimal PECOFF resource verification.
5009 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
5011         * metadata-verify.c: Be less restrictive with some coff fields.
5013 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
5015         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
5016         params as boxed values on stack. Fixes #485706.
5018 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
5020         * console-io.c: the termios values may vary in different flavors of unix.
5022 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
5024         * console-io.[ch]: return the entire set of control characters when
5025         initializing the terminal.
5026         * appdomain.c: bump corlib version.
5028 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
5030         * mono-perfcounters.c: added support for in-process custom
5031         performance counters.
5033 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
5035         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
5037 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
5039         * metadata-verify.c: Verify the data pointed by the import table. 
5041 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
5043         * metadata-verify.c (load_data_directories): Store data
5044         directory contents.
5046         * metadata-verify.c: Verify the import table. 
5048 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
5050         * metadata-verify.c: Verify data directories.
5052 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
5054         * metadata-verify.c: Check section header flags.
5056 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
5058         * appdomain.c: if the assembly name is a shadow-copied file, return
5059         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
5060         in mono_make_shadow_copy.
5061         * icall.c: if the assembly name is a shadow-copied file, replace it
5062         with the original assembly path.
5064         Bug #484244 fixed. NUnit tests for corlib can be run without
5065         --noshadow now.
5067 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
5069         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
5070         entries when the table is reallocated.
5072         * icall.c: Allocate the memory used by the mono_ptr_array macros using
5073         mono_gc_alloc_fixed () since it contains GC refs.
5075 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
5077         * reflection.c (ensure_complete_type): New helper function to call
5078         type resolve handlers for unfinished dynamic types.
5079         (resolve_object): Call it for MonoClassFields. Fixes #483852.
5081 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
5083         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
5084         #483247.
5086 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
5088         * appdomain.c (get_shadow_assembly_location): Fix memleak.
5090 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
5092         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
5093         between GCHandles of type WeakTrackResurrection and the objects they
5094         point to.
5096         * gc.c: Partly implement the sematics of GCHandles of type 
5097         WeakTrackResurrection: these handles should only be cleared after the
5098         finalizer of the object they are pointing to has ran.
5100 2009-03-06  Mark Probst  <mark.probst@gmail.com>
5102         * icall.c: Partially revert r126631 because using the jump
5103         trampolines for generic shared methods makes it superfluous.
5105 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
5107         * threads.c (handle_store): Create the 'threads' hash table with the proper
5108         MONO_HASH_VALUE_GC type.
5110 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
5112         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
5113         FIRST_GC_TRACKED.
5115         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
5116         and LAST_GC_TRACKED as a GC root.
5118         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
5120         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
5121         the static data even if it consists of 1 reference.
5123         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
5124         if there is a GC descriptor.
5126         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
5127         instead of through the GC since they contain no object references.
5129 2009-03-05  Mark Probst  <mark.probst@gmail.com>
5131         * generic-sharing.c (instantiate_other_info): Always return a jump
5132         trampoline for method code.
5134 2009-03-05  Marek Habersack  <mhabersack@novell.com>
5136         * culture-info-tables.h: generated to include the en-tt culture.
5138 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
5140         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
5141         capture the thread context.
5143         * object.c (mono_async_result_new): Cache the invoke wrappers to
5144         ExecutionContext::Capture.
5146 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
5148         * marshal.h: Add a prototype for what mono_compile_method returns
5149         for invoke wrappers.
5151         * gc.c: Use the new prototype declaration.
5153 2009-03-04  Geoff Norton  <gnorton@novell.com>
5155         * boehm-gc.c: Add some MONO_LOG tracing for the GC
5156         * gc-internal.h:
5157         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
5159 2009-03-04  Martin Baulig  <martin@ximian.com>
5161         * mono-debug.h
5162         (mono_debugger_runtime_invoke): Removed.
5164         * mono-debug-debugger.c
5165         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
5167 2009-03-02  Martin Baulig  <martin@ximian.com>
5169         * mono-debug.h
5170         (mono_debugger_unhandled_exception): Removed.
5171         (mono_debugger_handle_exception): Removed.
5172         (mono_debugger_throw_exception): Removed.
5174         * mono-debug.c
5175         (mono_debug_debugger_version): Bump to 5.
5177         * mono-debug-debugger.c: Moved the exception handling code to
5178         ../mini/debug-mini.c
5180 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
5182         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
5183         finalize_objects_hash.
5185         * gc.c: Use the separate lock to access the finalize_objects_hash field.
5186         
5187         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
5188         field.
5190         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
5191         cache.
5193         * image.c (mono_image_close): Free it.
5194         
5195         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
5196         allowing a creation of a wrapper which invokes its method using a CALLVIRT
5197         on the this argument.
5199         * gc.c (run_finalize): Optimize the calling of the finalizers.
5201 2009-03-03  Martin Baulig  <martin@ximian.com>
5203         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
5204         of the `MonoGenericInst' changes.
5206 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
5208         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
5209         mono_array_class_get_cached to reduce locking contention. Extract
5210         a domain var.
5212         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
5213         intermediary managed arrays. Use caching version of mono_array_new
5214         to allocate the result array.
5216         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
5218         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
5220         * locales.c (create_names_array_idx):  Use mono_array_new_cached
5221         to reduce locking contention.
5223 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
5224                 
5225         * object.c (mono_method_add_generic_virtual_invocation): Put back the
5226         thunk builder code for the non-interface case.
5228 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
5230         * object.c (get_generic_virtual_entries): New helper function to collect
5231         the virtual generic method instances which need to be added to an IMT
5232         thunk.
5233         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
5234         Instead of creating a new IMT thunk, reset the vtable slot to the
5235         trampoline, the thunk will be created the next time the trampoline is called.
5236         (build_imt_slots): Add support for virtual generic methods in interfaces by
5237         adding to the IMT thunk all the methods registered using 
5238         mono_method_add_generic_virtual_invocation ().
5240         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
5241         (struct _MonoIMTCheckItem): Ditto.
5243         * object.c (mono_method_add_generic_virtual_invocation): Take a
5244         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
5245         the IMT thunk to include all items.
5246         
5247         * object.c (mono_class_create_runtime_vtable): Add a missing
5248         mono_loader_unlock ().
5250 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
5252         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
5254         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
5256 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
5258         * object-internals.h: Rename _MonoReflectionEvent to
5259         MonoReflectionMonoEvent so it reflects the right managed type.
5260         Add a MonoReflectionEvent that correctly represents System.EventInfo.
5262         * icall.c:
5263         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
5264         type.
5266 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
5268         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
5269         intermediary managed arrays. Use caching version of mono_array_new
5270         to allocate the result array.
5272 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
5274         * reflection.c: Use cached version of mono_array_new alongside
5275         the mono_reflection_get_custom_attrs_by_type call path.
5277 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
5279         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
5280         intermediary managed arrays. Use caching version of mono_array_new
5281         to allocate the result array.
5283         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
5285 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
5287         * icall.c: Add small implementation of a growable stack bound array.
5289         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
5291         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
5292         intermediary managed arrays. Use caching version of mono_array_new
5293         to allocate the result array.
5295 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
5297         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
5298         helps Enum::CompareTo to be implemented without reboxing all enums
5299         to their underlying type.
5300 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
5302         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
5303         since it acquires a global lock leading to scalability problems.
5305         * profiler.c: Make the stat profiler work with multiple appdomains, this
5306         currently only works when no appdomains are unloaded.
5308 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
5310         * appdomain.c: make the check to avoid copying when the assembly is
5311         already shadow copied actually work.
5313 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
5315         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
5317         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
5318         changes to the managed side.
5320 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
5322         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
5323         classes + a separate lock for it, as it is used frequently at runtime, not
5324         just during metadata loading/JIT compilation.
5326         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
5327         for szarrays.
5328         
5329         * object-internals.h (mono_class_from_name_cached): New macro to cache
5330         the results of the lookup locally without having to declare a static
5331         variable to hold it.
5332         (mono_class_get_field_from_name_cached): Ditto.
5333         (mono_array_class_get_cached): Ditto.
5335         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
5336         the new macros.
5337         
5338         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
5339         slower search in metadata.
5341         * pedump.c: Fix a warning.
5343 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
5345         * reflection.c (encode_locals): Add checks for user types.
5346         (method_encode_clauses): Ditto.
5347         (method_encode_code): Ditto.
5348         (mono_image_create_token): Ditto.
5350         * object-internals.h: Change the type of more fields from MonoReflectionType*
5351         to MonoObject*.
5353 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
5355         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
5356         the a thread does not suspend within 100ms.
5358         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
5359         in addition to StopRequested as well.
5361         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
5363         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
5364         search the method_hash before inserting a new entry, to avoid crashes when
5365         the same method is inserted multiple times, causing the old 
5366         MonoDebugMethodInfo structure to be freed by the value dtor function.
5368 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
5370         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
5371         SO_EXLUSIVEADDRUSE where available.
5373 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
5375         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
5376         runtime invoke wrappers, this time it is string ctor wrappers, which
5377         pass a dummy string as 'this' instead of their obj argument. Fixes
5378         #478473.
5380 2009-02-21  Jb Evain  <jbevain@novell.com>
5382         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
5383         only get create_culture once.
5385 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
5387         * reflection.c (mono_reflection_setup_internal_class): Move the user type
5388         check before the locking.
5389         
5390         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
5391         (mono_reflection_create_runtime_class): Ditto.
5392         (mono_reflection_sighelper_get_signature_local): Ditto.
5393         (mono_reflection_sighelper_get_signature_field): Ditto.
5395         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
5396         is a System.MonoType object or similar.
5397         (monotype_cast): New helper function to cast a MonoObject to a 
5398         MonoReflectionType object.
5400         * object-internals.h: Change MonoReflectionType* members in structures to
5401         MonoObject* members to force the usage of the monotype_cast () function.
5403         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
5404         structures/arrays. This causes us to assert instead of crashing when 
5405         instances of user defined subclasses of System.Type are encountered.
5407 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5409         * cil-coff.h:
5410         * icall-def.h:
5411         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
5412         win32 resource loaded from a PE file.
5414         * image.c: fix mono_image_lookup_resource.
5416 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5418         * icall-def.h:
5419         * threads-types.h:
5420         * threads.c: added internal call for WaitHandle.SignalAndWait.
5422 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
5424         * cominterop.c : Adding cominterop_type_from_handle and 
5425           registering it as an icall.  Replacing all references
5426           to type_from_handle.
5428         Code is contributed under MIT/X11 license.
5430 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5432         * Makefile.am: Add lock-tracer.h and lock-trace.c.
5434         * appdomain.c: Call the tracer init function.
5436         * domain-internals.h: Enable the tracer for the domain locks.
5438         * image.c: Enable the tracer for image locks.
5440         * loader.c: Enable the trace for the loader lock.
5442         * lock-tracer.h:
5443         * lock-tracer.c: Initial implementation of the lock trace utility.
5444         The tracer requires a compile time define to be enabled and a env var
5445         to be enabled at runtime.
5447 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5449         * domain.c (mono_domain_code_foreach): Improve documentation.
5451 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
5453         * appdomain.c:
5454         * generic-sharing.c:
5455         * object.c:
5456         * reflection.c:  Adjust locking order to the new semantics where the loader lock
5457         comes first.
5459 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
5461         * domain.c: Add mono_domain_code_* functions that perform locking
5462         around the domain codeman.
5464         * domain-internals.h: Export those functions.
5466         * object.c: Use new functions instead of acquiring the domain lock.
5468 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
5470         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
5471         delegate. Fixes #477396.
5473 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
5475         * reflection.c (create_custom_attr): Get rid of alloca.
5477 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
5479         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
5480           Adding exception handling for all CCW calls.
5482         Code is contributed under MIT/X11 license.
5484 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
5486         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
5488         * marshal.c (emit_marshal_boolean): Add null checks to the new 
5489         native->managed marshalling code. Fixes #476247.
5491 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
5493         * class.c (mono_class_get_vtable_entry): Move the addition of
5494         static rgctx invoke wrappers for vtable methods here, this simplifies
5495         a lot of code and causes fewer rgctx wrappers to be created.
5497         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
5498         name of the statistics to begin with an uppercase.
5500 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5502         * reflection.c: Revert previous change as it breaks the build.
5503         
5504 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5506         * verify.c: Properly handle SZARRAY element type.
5508         Fixes #474271.
5510 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
5512         * reflection.c (mono_image_create_method_token): Correctly encode
5513         MethodDef MemberRefParent token.
5515         Fixes #472845.
5517 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
5519         * image.c (mono_image_close): Delete the critical section before
5520         freeing the memory holding it.
5522 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5524         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
5525         Fixes #476257.
5527 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5529         * pedump.c (main): Call mono_marshal_init so pedump
5530         doesn't crash.
5532 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5534         * loader.c (method_from_memberref): Properly fix #474271 and
5535         don't break the runtime bad.
5537 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
5539         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
5540         (mono_domain_alloc0): Ditto.
5542 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5544         * loader.c (method_from_memberref): Don't abort if the array
5545         method is not found. A regular loader failure is more informative
5546         and correct.
5548         Fixes #474271.
5550 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
5552         *loader.c: Guard MonoImage::method_cache/methodref_cache
5553         using the image lock instead of the loader lock.
5555         * metadata.h: Add comments about which fields are protected by
5556         the image lock.
5558 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
5560         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
5562         * generic-sharing.c (mono_method_construct_object_context): Remove the
5563         wrapper_type == NONE assert, it is not needed.
5565 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
5567         * reflection.c (clear_cached_object): New helper function.
5568         (mono_method_clear_object): New function to clear the cached reflection
5569         objects for a dynamic method.
5571         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
5572         Partly fixes # 463323.
5573         
5574 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
5576         * class.c:
5577         * loader.c:
5578         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
5580 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
5582         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
5583         take the image lock instead of the loader lock.
5585         * metadata-internals.h: Export new functions.
5587 2009-02-12  Miguel de Icaza  <miguel@novell.com>
5589         * domain.c (app_config_parse): Remove another use of stat that is
5590         not necessary as g_file_get_contents already does the presence
5591         check. 
5593 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
5595         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
5597         * marshal.c: Move the bstr handling code to cominterop.c.
5599         * marshal.c: Remove some COM interop code missed previously.
5601 2009-02-12  Miguel de Icaza  <miguel@novell.com>
5603         More Paolo patches from the Wii port:
5604         
5605         * security.c: Remove ves_icall_System_Environment_get_UserName
5606         from here.
5608         * icall.c: And put ves_icall_System_Environment_get_UserName
5609         here. 
5611         * appdomain.c (mono_set_private_bin_path_from_config): Remove
5612         redundant call to stat that was only used to test for the file
5613         existence.   Patch from Paolo.
5615         * gc.c (run_finalize): If COM is disabled, do not link in
5616         mono_marshal_free_ccw.
5618         * generic-sharing.c: Use alloca.h here as well.
5620 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
5622         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
5624 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
5626         * cominterop.c cominterop.h: New files.
5628         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
5629         function/typedefs which are needed by cominterop.c global.
5631 2009-02-12  Mark Probst  <mark.probst@gmail.com>
5633         * generic-sharing.c: Don't take the loader lock to guard image
5634         mempool allocs.
5636 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5638         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
5639         called without the loader lock which is required to guard MonoImage:tokens.
5641 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5643         * class.c:
5644         * metadata.c:
5645         * method-builder.c:
5646         * marshal.c:
5647         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
5649 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5651         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
5652         Rework the code to use regular mono_image_alloc/0.
5654         * loader.c: Rework the code to use regular mono_image_alloc/0.
5656         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
5658 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
5660         * object-internals.h : Fixing a typo in the 
5661           MonoReflectionComVisibleAttribute struct.
5663         * marshal.c (cominterop_com_visible): Check the implemented 
5664           interfaces for ComImport.
5666         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
5667           assume that bools should be treated as VARIANTBOOLs.
5669         * marshal.c (emit_marshal_boolean): Adding cases for 
5670           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
5672         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
5673           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
5675         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
5676           should be treated as VARIANTBOOLs.    
5678         Code is contributed under MIT/X11 license.
5680 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5682         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
5683         allocation with the image lock.
5685 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5687         This patch is the last of a series to remove explicit reference of MonoImage::mempool
5688         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
5690         * object.c: Add mono_string_to_utf8_image.
5692         * object-internals.h: Export mono_string_to_utf8_image.
5694         * reflection.c: Rework all explicit references to the the image mempool to go thought
5695         the mono_image_alloc set of functions.
5697 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5699         This patch is the third of a series to remove explicit reference of MonoImage::mempool
5700         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
5701         and generics-sharing.c.
5703         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
5704         as first argument. Note that this function remains broken as it doesn't perform locking around the
5705         mempool allocation.
5707         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
5709         * image.c: Add g_slist_append_image.
5711         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
5712         the supplied image for allocation. Move code into mono_metadata_field_info_full.
5714         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
5715         Fix all related code to do the same.
5717         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
5719         * metadata-internals.h: Fix the signatures.
5721 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
5723         This patch is the second of a series to remove explicit reference of MonoImage::mempool
5724         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
5725         and similar to work using MonoImage.
5727         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
5728         MonoMemPool.
5730         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
5732         * class.c (mono_metadata_signature_deep_dup): Same.
5734         * class.c (inflate_generic_type): Same.
5736         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
5738         * metadata.c (mono_metadata_signature_dup_full): Same.
5740         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
5741         mono_metadata_signature_dup_full.
5743         * metadata.c (mono_metadata_type_dup): Same.
5745         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
5747         * reflection.c: Same.
5749         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
5751         * metadata-internals.h: Fix the signatures.
5753         * class-internals.h: Same.
5755 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5757         This patch is the first of a series to remove explicit reference of MonoImage::mempool
5758         and use mono_image_alloc set of functions instead. 
5760         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
5761         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
5762         of a MonoMemPool.
5764         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
5766         * class.c (g_list_prepend_mempool): Removed.
5768         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
5770         * image.c: Add g_list_prepend_image.
5772         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
5774         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
5777 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5779         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
5780         mono_image_unlock.
5782         * image.c (mono_image_init): Init the lock field.
5784         * image.c (mono_image_init): Cleanup the lock field.
5786         * image.c: Add mono_image_(un)lock functions.
5788 2009-02-11  Mark Probst  <mark.probst@gmail.com>
5790         * class.c, class-internals.h: mono_method_get_context_general()
5791         combines the functionality of mono_method_get_context() and
5792         mini_method_get_context().
5794         * generic-sharing.c, domain-internals.h:
5795         mono_method_construct_object_context() and
5796         mono_domain_lookup_shared_generic() moved from mini.
5798         * icall.c (ves_icall_InternalInvoke): Handle the case where the
5799         method doesn't have the correct instantiation because it's shared
5800         generic code.  Fixes #473999.
5802 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
5804         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
5806         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
5807         
5808 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
5810         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
5812         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
5814         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
5815         and recheck the cache for dups after it.
5817         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
5819         Fixes one of the deadlocks found in #473150.
5821 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
5823         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
5824           For Win32, add additional break conditions for accept.
5826         Code is contributed under MIT/X11 license.
5828 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
5830         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
5831         lazily initialize the native wrapper cache.
5832         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
5833         cache, since they are different from the normal wrappers.
5835         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
5837         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
5838         AOT compiled native wrappers.
5840 2009-02-09  Geoff Norton  <gnorton@novell.com>
5842         * appdomain.h:
5843         * security-core-clr.c: Allow enabling core-clr from the embedding
5844         API.
5846 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5848         * socket-io.c: when requesting all the local ips, if there are no
5849         interfaces up and running, MS returns 127.0.0.1.
5851 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5853         * mono-perfcounters-def.h: processor time is an inverse time.
5854         Fixes bug #468625.
5856 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
5858         * socket-io.c: an empty host name returns the list of local IPs.
5859         Fixes bug #386637 part 1/2.
5861 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
5863         * verify.c (mono_class_interface_implements_interface): Call
5864         mono_class_setup_interfaces ().
5865         (merge_stacks): Ditto.
5867 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
5869         * class.c (mono_class_setup_interfaces): New function to lazily initalize
5870         klass->interfaces.
5871         (mono_generic_class_get_class): Don't initalize klass->interfaces.
5872         (mono_generic_class_get_class): Ditto.
5874 2009-02-06  U-QUACK\miguel  <miguel@quack>
5876         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
5877         they live in security.c
5879         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
5880         another bit from Paolo's code.
5882 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
5884         * object.c (build_imt_slots): Add a small optimization to avoid inflating
5885         methods which will be discarded by add_imt_builder_entry ().
5887         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
5888         need to be boxed.
5890         * loader.c: Add a statistics for the size of the memberref signature cache.
5891         
5892         * loader.c (find_cached_memberref_sig): New helper function.
5893         (cache_memberref_sig): Ditto.
5895         * loader.c: Cache the result of parsing memberref signatures, since otherwise
5896         they will be parsed again for every generic instantiation, leading to unbounded
5897         memory growth.
5899 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5901         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
5902         parameters of generic methods.
5904         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
5905         after the original method is copied to the inflated method.
5906         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
5908         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
5909         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
5911         * class.c metadata.c: Update after the changes above.
5913 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
5915         * metadata-verify.c: Simplified error handling and added
5916         section table validation.
5918 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5920         * class-internals.h (MonoClassExt): New structure containing rarely used
5921         fields of MonoClass.
5922         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
5923         through a new 'ext' field.
5925         * class.c (mono_class_alloc_ext): New helper function to allocate 
5926         class->ext.
5928         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
5930 2009-02-05  Mark Probst  <mark.probst@gmail.com>
5932         * object.c (mono_object_get_virtual_method): Properly inflate
5933         generic methods.  Fixes #472692.
5935 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
5937         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
5938         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
5939         for the parent type, the created type must be ready to be used on a generic
5940         instantiation.
5941         We fill this_arg/byval_arg if the parent is a generic instance to make sure
5942         we won't have duplicated entries in generic_inst_cache.
5944         Fixes #469553.
5946 2009-02-05  Miguel De Icaza  <miguel@novell.com>
5948         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
5949         replace with plain BSD per the comments on the bug MONO77637.
5951 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
5953         * class.c (mono_class_get_generic_class): New accessor function.
5954         (mono_class_get_generic_container): Ditto.
5956         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
5957         fields, similar to the ones in MonoMethod.
5959         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
5960         (mono_class_create_from_typedef): Set klass->is_generic if needed.
5962         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
5963         
5964         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
5965         the same information as element_class->byval_arg.
5967         * class.c reflection.c: Remove references to class->byval_arg.
5969         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
5970         klass->enum_basetype directly.
5972         * verify.c metadata.c object.c icall.c reflection.c: Use 
5973         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
5974         directly.
5976 2009-02-04  Miguel de Icaza  <miguel@novell.com>
5978         * icall-def.h: Remove internal calls for sockets when
5979         DISABLE_SOCKET is defined, file system writing features when the
5980         OS only support reading and not writing data and Policy support if
5981         the Policy is disabled.
5982         
5983         * image.c (do_mono_image_open): Apply Paolo's patches for using
5984         mono_file_map_ APIs here.
5986         * assembly.c: Add support for platforms to avoid prefix
5987         auto-detection. 
5989 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
5991         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
5992         warning.
5994         * class.c (mono_class_inflate_generic_class): New helper function.
5996         * class.c: Use mono_class_inflate_generic_class in a few places. Add
5997         statistics for inflated methods/classes.
5999         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
6001         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
6002         the call is made from Delegate.CreateDelegate () for the invoke method of
6003         a delegate.
6005         * loader.c: Add a statistics for the memory occupied by inflated signatures.
6007         * metadata.c (mono_metadata_signature_size): New helper function.
6009         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
6010         generic instances.
6012         * metadata.c (inflated_method_in_image): Avoid calling 
6013         mono_method_signature () if the method does not already have a signature.
6015 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6017         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
6018         valuetype is compatible with target type, check by inheritance as a
6019         VT is not really compatible with System.ValueType, for example.
6021         * verify.c (do_invoke_method): Improve error message.
6023         * verify.c (do_box_value): If boxing a nullable, use the type argument
6024         on stack instead.
6026         * verify.c (do_newobj): Improve error message.  
6028         Fixes #469549.
6030 2009-02-03  Miguel de Icaza  <miguel@novell.com>
6032         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
6034 2009-02-03  Mark Probst  <mark.probst@gmail.com>
6036         * generic-sharing.c: Don't hold domain lock when calling
6037         instantiate_other_info().  Fixes #471958.
6039         * domain-internals.h, loader.c: Describe locking policy of domain
6040         lock vs loader lock.
6042 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6044         * verify.c (mono_delegate_signature_equal): Make it possible to check
6045         first-arg-bound delegates to static method.
6047         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
6048         static methods with the first arg bound.
6050         Fixes #469529.
6052 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6054         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
6055         errors.
6057         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
6058         under strict mode. Any type, when boxed can be seen as a reference type.
6060         Fixes #469528.
6062 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6064         * object.h: The lower bound of an array is a signed integer value.
6065         Introduce mono_array_lower_bound_t typedef. It should be used instead of
6066         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
6068         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
6069         calculate the upper bound.
6070         
6071         Fixes #471252.
6073 2009-02-02  Miguel de Icaza  <miguel@novell.com>
6075         From Paolo's work, refactored, cleared up:
6076         
6077         * threadpool.c, icall.c: ifdef code that requires a working socket
6078         stack.
6080         * metadata.c (mono_metadata_field_info): Do not attempt to return
6081         a value from a function declared as void.
6083         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
6084         from the console stack.
6086         * assembly.c: use strrchr instead of rindex.
6088         * class.c, object.c, marshal.c, icall.c, reflection.c: include
6089         alloca.h on systems that have it.
6091         * environment.c: Avoid code that uses stuff from
6092         HAVE_SYS_UTSNAME_H
6093         
6094         * appdomain.c: Include sys/time.h.
6096         * console-io.c: include sys/ioctl.h if it is available.
6098 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
6100         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
6102         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
6103         the method builder.
6105         * marshal.c: Set mb->skip_visibility instead of setting it on the method
6106         after it was created and cached, as the later is not thread safe.
6107         
6108 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
6110         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
6111         called while the debugging module is not initialized. Fixes #471669.
6113 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
6115         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
6117         Fixes #471255.
6119 2009-02-02  Mark Probst  <mark.probst@gmail.com>
6121         * generic-sharing.c (lookup_or_register_other_info): Make sure the
6122         loader lock is not taken while the templates lock is held.  Fixes
6123         #471089.
6125 2009-02-02  Mark Probst  <mark.probst@gmail.com>
6127         * metadata.c (type_in_image): Added a check to fix a monodis
6128         crash.
6130 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
6132         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
6133         nullable arguments.
6135         * object.c (mono_runtime_invoke_array): Ditto.
6136         
6137         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
6138         freeing wrappers of dynamic methods.
6140         * loader.c (mono_free_method): Call it. Fixes #463323.
6141         
6142         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
6143         methods taking vtype/byref arguments, to fix yet another bug caused by
6144         the sharing of runtime invoke wrappers. Partly fixes #471259.
6146 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
6148         * debug-mono-symfile.c (check_line): Return NULL instead of returning
6149         <first file in file table>:1 when the IL offset does not have an associated
6150         line number.
6152 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
6154         * mono-debug.c (mono_debug_lookup_locals): New function to return local
6155         variable info for a method.
6157         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
6158         
6159 2009-01-30  Jb Evain  <jbevain@novell.com>
6161         * pedump.c: reuse code from monodis to make sure pedump honors
6162         MONO_PATH, which is needed to verify net_2_1 assemblies.
6164 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
6166         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
6167         there is no line number info.
6169 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
6171         Avoid some MonoType allocations
6172         * reflection.c (mono_reflection_initialize_generic_parameter):
6173         Reuse MonoType from param->pklass rather than allocating one.
6174         (mono_dynamic_image_free): Update to changes.
6176 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
6178         Rearrange some code to improve consistency
6179         * reflection.c (mono_reflection_setup_generic_class): Move body ...
6180         (mono_reflection_initialize_generic_parameter): ... here.
6182 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
6184         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
6185         with type constraints as an experiment.
6187         * boehm-gc.c (on_gc_notification): Update mono_stats.
6189 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
6191         Avoid some allocations
6192         * class-internals.h (_MonoGenericInst::type_argv): Convert from
6193         pointer to tail array to avoid extra allocation.
6194         * metadata.c (free_generic_inst): Update to changes.
6195         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
6196         on-stack struct.
6198 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
6200         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
6201         return TRUE if the two type objects are the same.
6203 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
6205         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
6206         (mono_class_native_size): Use klass->marshal_info->min_align instead of
6207         klass->min_align, since klass->min_align contains the managed alignment,
6208         while the native alignment can be different, like for longs on x86.
6209         Fixes #469135.
6211         * class-internals.h (MonoMarshalType): Add a min_align field.
6213 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
6215         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
6216         the 1.0 format.
6218 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
6220         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
6221         some comments about the usage of the used_regs field.
6223         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
6224         Fixes #469217.
6226 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
6228         * appdomain.c: return NULL instead of throwing FileNotFoundException
6229         when LoadAssembly() fails.
6231 2009-01-23  Mark Probst  <mark.probst@gmail.com>
6233         * metadata.c (mono_metadata_generic_param_equal): Only compare the
6234         image if the owner is NULL.  Fixes the AOT failures.
6236 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
6238         * metadata.c (mono_metadata_load_generic_params): Initialize the 
6239         MonoGenericParam structure using memset so the image field is initialized
6240         as well.
6242 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
6244         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
6245         a plain store.
6247 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
6249         * class.c (mono_class_setup_vtable_general): In the generic instance
6250         optimization, set method->slot for abstract virtual methods. Fixes part of
6251         #467834.
6253 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
6255         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
6256         which signals that the unloading has started but all appdomain services must
6257         remain operational.
6259         * appdomain.c (mono_domain_unload): The initial state for unloading now
6260         is unloading_start and we switch to unloading after the managed call to
6261         AppDomain::DomainUnload has finished.
6263         The new unloading state has to be created because managed code in the
6264         DomainUnload event can depend on things like the threadpool still working.
6265         The domain must remain fully functional while the event executes.
6267         This shown as an issue due to Process::WaitForExit, which waits for
6268         async reads of stdout and stderr to complete. Since those are processed
6269         in the threadpool the code deadlocks because the DomainUnload callback 
6270         waits for the async read finished event, which should have been set by a
6271         threadpool job but has been discarded due to the domain been in unload
6272         state.
6274 2009-01-21  Mark Probst  <mark.probst@gmail.com>
6276         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
6277         image must match.
6279 2009-01-21  Mark Probst  <mark.probst@gmail.com>
6281         * reflection.c (resolve_object): For fields, inflate the class and
6282         then get the field in the inflated class.
6284 2009-01-20  Mark Probst  <mark.probst@gmail.com>
6286         * object-internals.h (struct _MonoException): Added a comment
6287         explaining the new use of trace_ips.
6289 2009-01-20  Mark Probst  <mark.probst@gmail.com>
6291         * generic-sharing.c (inflate_other_data): Inflate array methods
6292         correctly.
6294         * loader.c, class-internals.h: Rename search_in_array_class() to
6295         mono_method_search_in_array_class() and make it non-static.
6297 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
6299         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
6300         Hopefully fixes #458168.
6302 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
6304         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
6305         as it is performed elsewhere.
6307         Code is contributed under MIT/X11 license
6309 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
6311         * mono-perfcounters-def.h: Add counters for asp.net requests total and
6312         requests queued.
6313         * object.c (mono_raise_exception): Increment the exceptions total
6314         counter when an exception is thrown.
6315         * class-internals.h: Add a location for storing the total number of
6316         asp.net requests served.
6317         * mono-perfcounters.c: Implement update support for asp.net counters
6318         from the class libraries. Implement read support for asp.net counters
6319         and exceptions total counter.
6321 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
6323         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
6324         accessing klass->methods. Fixes #467385.
6326 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
6328         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
6329         for byval arguments without an [Out] attribute. Fixes #467212.
6331         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
6332         Fix compilation under android.
6333         
6334         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
6335         processed, scan them directly after they are copied, to achieve better locality
6336         and cache usage.
6338         * socket-io.c: Applied patch from Koushik Dutta
6339         (koush@koushikdutta.com). Disable IPV6 when running under android.
6341 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
6343         * icall.c (ves_icall_InternalExecute): Add write barriers.
6345         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
6346         the GC code.
6348         * sgen-gc.c: Implement write barriers in IL code.
6350 2009-01-17  Geoff Norton  <gnorton@novell.com>
6352         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
6354 2009-01-17  Geoff Norton  <gnorton@novell.com>
6356         * image.c: When unloading the image->references table, there can be gaps
6357         in it.  Ensure that we iterate every entry to avoid leaking assembly references
6358         when unloading an appdomain.
6360 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
6362         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
6363         speed up ptr-in-nursery checks.
6365         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
6366         threads_lock () to prevent deadlocks.
6368         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
6369         does not need to be scanned during minor collections, since writes to it
6370         must use write barriers.
6372 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
6374         * metadata-verify.c: Add pe nt header verification.
6375         
6376 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
6378         * gc.c: Fix a few warnings when using SGEN.
6380 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
6382         * metadata-verify.c: Add pe optional header verification.
6384 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
6386         * sgen-gc.c: Add support for user defined marker functions, used by
6387         MonoGHashTable to avoid registering a GC root for every hash node.
6389 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
6391         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
6392         non-pinned roots into separate hashes to avoid having to traverse them
6393         in functions which are only interested in one kind.
6395 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
6397         * metadata-verify.c: Add pe header machine field verification.
6398         
6399 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
6401         * metadata-verify.c: Add pe header size verification.
6403 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
6405         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
6406         using the GC, they don't contain references.
6408         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
6410 2009-01-13  Geoff Norton  <gnorton@novell.com>
6412         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
6413         AppDomains created on the native side can be cleaned up on the native side.
6415 2009-01-13  Geoff Norton  <gnorton@novell.com>
6417         * appdomain.c: Ensure that we call mono_context_init for the embedding api
6418         as well as the managed api.
6420 2009-01-13  Geoff Norton  <gnorton@novell.com>
6422         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
6423         with a MonoAppDomain initialized against it.
6425 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
6427         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
6428         
6429         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
6431         * marshal.c: Avoid setting the exception clauses after a method has been entered 
6432         into the wrapper caches. Fixes #465700.
6434         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
6435         method builder.
6436         (mono_mb_create_method): Set the clauses from the method builder.
6438 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
6440         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
6441         Patch from Makoto Kishimoto.
6443 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
6445         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
6446         encoding them as ROOT_DESC_COMPLEX.
6447         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
6449 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
6451         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
6452         no longer point to the nursery.
6454         * sgen-gc.c: Add a few comments/FIXMEs.
6455         
6456         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
6458         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
6459         initialization of the various _method variables thread safe. Fixes
6460         #465377.
6462 2009-01-12  Mark Probst  <mark.probst@gmail.com>
6464         * domain.c, domain-internals.h: Remove the shared_generics_hash
6465         and its lookup functions.
6467 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
6469         * socket-io.c:  Fixing the MSVC build. 
6471         Code is contributed under MIT/X11 license.
6473 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
6475         * metadata-verify.c: Add pe header watermark verification.
6477 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6479         * metadata-verify.c: Add lfanew verification.
6481 2009-01-12  Jb Evain  <jbevain@novell.com>
6483         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
6484         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
6486 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
6488         * socket-io.c: Fix the build.
6490         * environment.c: Fix an #ifdef.
6492 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6494         * threadpool.c (async_invoke_thread): Handle the wait function returning
6495         WAIT_IO_COMPLETION as well.
6496         (async_invoke_io_thread): Ditto.
6498 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
6500         * threads.c: Fixing the Windows build.
6502         Code is contributed under MIT/X11 license.
6504 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6506         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
6507         interrupt a wait.
6508         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
6509         the thread to wait again.
6511 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6513         * metadata-verify.c: Initial skeleton of the metadata verifier.
6515         * pedump.c: Add support for the metadata verifier.
6517         * verify-internal.h: Export the whole assembly metadata verifier function.
6519 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6521         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
6523 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
6525         * Makefile.am: Upgrade dtrace-prelink.sh location.
6527 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
6529         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
6530         well. Otherwise the shutdown deadlock that happens on unix will can happen
6531         as well.
6532         If the main thread code finishes too fast it's possible that the finalizer
6533         thread won't have executed yet, won't record itself as the finalizer thread
6534         and the shutdown sequence will wait on it forever.
6536 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
6538         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
6539         with MSVC.
6541 2009-01-08  Miguel de Icaza  <miguel@novell.com>
6543         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
6544         Robert Jordan for pointing this out.
6546 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
6548         * icall.c
6549         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
6550         ves_icall_System_IO_DriveInfo_GetDriveType.
6552 2009-01-07  Miguel de Icaza  <miguel@novell.com>
6554         * icall.c: Wrap calls to mono_strtod in CriticalSection
6555         invocations when using eglib, to work around #464316.
6557 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
6559         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
6560         return value of GetCurrentDirectory to never access unitialized memory.
6562 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
6564         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
6565         return value of GetCurrentDirectory and expand the buffer if needed.
6567         Fixes #459094.
6569 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
6571         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
6572           Adding a call to mono_init_com_types.
6574         Code is contributed under MIT/X11 license.
6576 2009-01-07  Geoff Norton  <gnorton@novell.com>
6578         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
6579         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
6580         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
6581         be the value of the ip buffer.
6583 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6585         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
6586         interfaces_packed here.
6588         Fixes part of #463294.
6590 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6592         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
6594         Fixes part of #463294.
6596 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6598         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
6599         is a boxed complex as well.
6601         Fixes part of #463294.
6603 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
6605         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
6606         control if a methodspec should be created for the generic method definition from external assemblies.
6607         Caching of methodspec is done using the handleref hash table.
6609         Fixes #462592.
6611 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
6613         * loader.c (find_method): When searching the interfaces of a class
6614         check the transitive closure of implemented interfaces.
6616         Fixes #463303.
6618 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
6620         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
6621         
6622 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
6624         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
6625         interfaces calculation to fill_valuetype_array_derived_types.
6627         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
6628         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
6629         for example.
6631         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
6632         interfaces for valuetypes if needed.    
6634         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
6635         for their basetype as well. Types are array expanded if rank is > 0.
6637         Fixes #400716.
6639 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
6641         * socket-io.h : Changing the signature of
6642           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
6643           the blocking state.
6645         * icall-def.h :  Changing the signature of
6646           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
6648         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
6649           For Windows only.  Avoid blocking when calling accept by
6650           querying for a connection via select.  The loop also queries
6651           the thread state every 1000 micro seconds for the thread
6652           stop state.  This will avoid the process hanging on shutdown
6653           when using a TcpChannel that is never connected to.
6655         Code is contributed under MIT/X11 license.
6657 2008-12-30  Marek Safar  <marek.safar@gmail.com>
6659         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
6661 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
6663         * class.c (get_implicit_generic_array_interfaces): Extract common
6664         code to a helper function making it a lot easier on the eyes.
6666 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
6668         * class.c (get_implicit_generic_array_interfaces): If the internal
6669         enumerator is an interface inflate System.Object instead of itself.
6671         Fixes #461261.
6673 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
6675         * object.c (mono_runtime_invoke_array): Don't assert with
6676         byref nullable types.
6678         * marshal.c (mono_marshal_get_runtime_invoke): To handle
6679         byref nullables we unbox the object and store it on the
6680         stack. 
6681         We can't use the boxed object since it is the T of Nullable<T>
6682         and the boxed representation of a nullable it's underlying type
6683         or null.
6684         We could cheat and create a boxed nullable and use the same
6685         machinery of other byref VTs but this feels like a hack and
6686         using the stack has the bonus of reducing heap pressure.
6688         Fixes #461941.
6690 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
6692         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
6693         return value.
6695         Fixes #461867.
6697 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
6699         * icall-def.h : Adding an internal call definition for 
6700           System.Environment.internalBroadcastSettingChange.
6702         * icall.c : Adding a Windows only implementation to broadcast a 
6703           WM_SETTINGCHANGE when an environment variable has changed.
6705         Code is contributed under MIT/X11 license.
6707 2008-12-19  Mark Probst  <mark.probst@gmail.com>
6709         * class.c, class-internals.h: Made
6710         mono_class_has_parent_and_ignore_generics() non-static.
6712 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
6714         * image.c: deal with the mmap failing when loading an image.
6716 2008-12-17  Geoff Norton  <gnorton@novell.com>
6718         * threadpool.c: Ensure that the io_queue_lock is initialized
6719         in all circumstances, as we always attempt to cleanup against it.
6721 2008-12-17  Miguel de Icaza  <miguel@novell.com>
6723         * icall.c (ves_icall_System_Environment_get_Platform): For
6724         compatibility reasons for existing client code we will keep
6725         returning 4 for a while.   
6727         For how long will depend on the documentation being updated, and
6728         for us to give client code a chance to be updated.
6730         This reverts the original decison on #433108 since we did not
6731         catch roughly 33 instances of the broken code in our own source
6732         code base, we did not catch failures on the buildbots, and QA did
6733         not bring this as a problem.
6735         Only today I found some customer's code breaking due to our own
6736         class libraries not being fully updated and tracked it down to
6737         this change.  I am reverting it because if we could not even get
6738         our story straight in our own code base, how can we hope that our
6739         end user code be fixed?
6741         As of this morning, our Wiki page that documents how to detect
6742         Unix had not been fixed.    
6744 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
6746         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
6748         * class.c (mono_class_get_fields): Handle loading errors.
6750 2008-12-12 Mark Mason <mmason@upwardaccess.com>
6752         * 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.
6753         
6754 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
6756         * mono-perfcounters.c: avoid warning.
6758 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6760         * reflection.c (ensure_runtime_vtable): Work on generic instances and
6761         make sure all interfaces have MonoClass::interface_id set.
6763         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
6764         method table is property set.
6766 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6768         * class.c: New function mono_class_setup_interface_id that setup
6769         MonoClass::interface_id if needed.
6771         * class-internals.h: Export new function.
6773 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
6775         * class.c: Add code to sanity check the vtable after setup_vtable_general
6776         has done it's work.
6778 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
6780         * icall.c: make Assembly.GetExecutingAssembly work properly when
6781         reflection is used to invoke the method.
6782         Bug #321781 fixed.
6784 2008-12-11  Mark Probst  <mark.probst@gmail.com>
6786         * metadata/generic-sharing.c: Look for constraints in all type
6787         arguments, not just the first one.
6789 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
6791         * appdomain.c: return the correct CodeBase for an Assembly instance
6792         that was loaded from the shadow-copy directories.
6793         Bug #458190 fixed.
6795 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
6797         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
6799         * sgen-gc.c (check_object): New debugging helper function.
6801         * object.c: Fix calls to mono_value_copy_array ().
6803 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6805         * class.c (mono_class_setup_fields): If working on an inflated class
6806         first check if the generic definition did init with success.
6808         Fixes #445361.
6810 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6812         pedump.c (main): Fix a warning.
6814 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
6816         * object-internals.h : Adding a definition for 
6817           MonoReflectionComVisibleAttribute.
6819         * marshal.c (cominterop_com_visible) :  Method added to check the 
6820           ComVisible attribute of a class.
6822         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
6823           cominterop_raise_hr_exception added to consolidate common code 
6824           to raise hr exceptions.
6826         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
6827           if a managed class should support IDispatch.
6829         * marshal.c 
6830           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
6831           Added additional checks for managed object when getting 
6832           an IDispatch interface.
6834         Code is contributed under MIT/X11 license.
6836 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
6838         pedump.c (main): Handle mono_get_method () returning NULL. 
6840 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
6842         * marshal.h: Fix a warning.
6844 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
6846         * marshal.c : Adding cominterop_release_all_rcws to release all
6847           runtime callable wrappers held by the runtime.
6849         * marshal.h : Adding declaration for cominterop_release_all_rcws.
6850           
6851         Code is contributed under MIT/X11 license.
6853 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
6855         * metadata.c (mono_image_alloc_lock): New helper function.
6856         (mono_image_alloc0_lock): Ditto.
6858         * metadata.c: Use the alloc_lock () helper functions for allocating
6859         memory from the image mempool.
6861 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
6863         * class.c (mono_class_from_generic_parameter): Document it's
6864         locking behavior. Fix double checked locking here, we stored in
6865         param->pklass a partially initialized MonoClass and no membar was used.
6867 2008-12-05  Marek Habersack  <mhabersack@novell.com>
6869         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
6870         (3) functions are present in the C library use them to do the
6871         job. If they are absent, make sure that the sum of int_part and
6872         dec_part is rounded before returning. This is necessary due to the
6873         division of dec_part by the power of 10 before the final addition
6874         is performed - if the result is not rounded in some cases it will
6875         yield invalid results.
6877 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
6879         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
6880         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
6881         instruction instead of a pointer constant.
6883 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
6885         * loader.c (mono_method_get_header): Do most of the work outside the
6886         loader lock, to avoid assembly load hook deadlocks.
6888         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
6889         (mono_metadata_parse_type_full): Ditto.
6891 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
6893         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
6894         Make the stack depth fixed. Ensure proper argument passing to the backtrace
6895         funtions. Finally, use a lock to produce well ordered output.
6897         The lock looks silly, as all calls to the corlib mempool should be guarded
6898         with the loader lock, but for some reason this fact doesn't help. 
6900         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
6902 2008-12-02  Mark Probst  <mark.probst@gmail.com>
6904         * socket-io.c: 64 bit big-endian fixes.
6906 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
6908         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
6909         targets that require strict compatibility between the types.
6911         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
6912         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
6913         Kill the strict argument and create a new one valuetype_must_be_boxed.
6915         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
6916         state that all valuetypes must be boxed.
6918         Fixes #448560.
6920 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
6922         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
6923         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
6925         Contributed under MIT/X11 license.
6927 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
6929         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
6930         the inflate_generic_type machinery should handle it.
6932         This avoids a crash when the field's flags is zero and it's type is
6933         a primitive.
6934         What happens is that mono_metadata_parse_type_full will see that opt_attrs
6935         is zero and will return one of the cached built-in primitive types. Since
6936         those types live in read-only memory, the code that copies it crashes.  
6938 2008-11-28  Mark Probst  <mark.probst@gmail.com>
6940         * object.c: Don't put function descriptors into generalized IMT
6941         thunks.
6943 2008-11-28  Mark Probst  <mark.probst@gmail.com>
6945         * class.c: Enable generic code sharing on PPC64.
6947 2008-11-27  Mark Probst  <mark.probst@gmail.com>
6949         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
6950         from mini/mini.c.
6952         * generic-sharing.c: Allocate the method template slists from the
6953         image mempool so it doesn't leak.
6955 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
6957         * class.c (generic_array_methods): Release the linked list.
6959 2008-11-27  Mark Probst  <mark.probst@gmail.com>
6961         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
6962         invocation to g_utf16_to_utf8().
6964 2008-11-26  Mark Probst  <mark.probst@gmail.com>
6966         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
6967         arguments on big endian archs.
6969 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
6971         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
6972         the type name (test added in corlib).
6974 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
6976         * pedump.c: initialize perf. counters. Fixes a segv.
6978 2008-11-25  Martin Baulig  <martin@ximian.com>
6980         * mono-debug-debugger.c
6981         (mono_debugger_runtime_invoke): Return the exception object if an
6982         exception was thrown.  Visual Studio displays the exception object
6983         in the locals window.
6985 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6987         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
6988         ftnptr.
6990 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6992         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
6993         MONO_TYPE_U are sizeof (gpointer), too.
6995 2008-11-24  Mark Probst  <mark.probst@gmail.com>
6997         * marshal.c (mono_type_native_stack_size): Fixed size and
6998         alignment for reference types.
7000 2008-11-23  Mark Probst  <mark.probst@gmail.com>
7002         * class.c (mono_class_generic_sharing_enabled): Disable generic
7003         code sharing for PPC64.
7005 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
7007         * icall.c (mono_method_get_equivalent_method): Make sure
7008         method->klass->methods is inited before looping over it.
7010 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
7012         * object.c: when calling ExecuteAssembly in a newly created domain,
7013         the configuration file and application base are already set up.
7014         Bug #446353 take 2 fixed.
7016 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
7018         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
7019         Fixes #444715. Fix a warning.
7021 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
7023         * appdomain.c: write the full path of the assembly to the .ini file
7024         created when "shadow-copying"
7025         Bug #446353 fixed.
7027 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
7029         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
7030         if signature==FALSE.
7032 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
7034         * marshal.h : Fix the cygwin build.
7035            marshal.c:12442: undefined reference to `_IID_IMarshal'
7036           
7037         Code is contributed under MIT/X11 license.
7039 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
7041         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
7042           free threaded marshaler when QueryInterface is called on a COM callable
7043           wrapper requesting the IMarshal interface.
7044           
7045         Code is contributed under MIT/X11 license.
7047 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
7049         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
7051         * reflection.c (mono_type_get_object): Special case the very common
7052         void type.
7054         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
7055         hold typeof(void).
7057 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
7059         * process.h : Adding method declaration for
7060           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
7061           
7062         * process.c : Adding implementation for
7063           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
7064           
7065         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
7066           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
7068         Code is contributed under MIT/X11 license.
7070 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
7072         * appdomain.c (unload_thread_main): Clean up threadpool by
7073         calling mono_thread_pool_remove_domain_jobs.
7075         * domain-internals.h (struct _MonoDomain): Add new fields to
7076         help coordinate the cleanup of the threadpool.
7078         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
7079         that cleans up the threadpool of all jobs associated with an appdomain.
7080         It does that by cleaning up the queues and making sure all active
7081         threads are accounted.
7083         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
7084         unloaded or in the process of. Take this is such way that there is
7085         no race condition between another thread starting the unload and the
7086         current thread acknowledging it.
7088         * threadpool.c (async_invoke_thread): Same.
7090         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
7091         firing the new thread.
7093         * threadpool.c (start_tpthread): Same.
7095         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
7097         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
7099 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
7101         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
7102         Add support for DuplicateHandle.
7103         
7104         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
7105         Add support for DuplicateHandle.
7106         
7107         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
7108         Add support for DuplicateHandle.
7110         Code is contributed under MIT/X11 license.
7112 2008-11-06  Mark Probst  <mark.probst@gmail.com>
7114         * class-internals.h: Make min_align into a whole byte.
7116         * class.c: Set min_align for SIMD types to 16.
7118 2008-11-05  Geoff Norton  <gnorton@novell.com>
7120         * attach.c: Default the attacher to enabled for all cases including
7121         embedded.
7123 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
7125         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
7126         change r117650.
7128 2008-11-04  Mark Probst  <mark.probst@gmail.com>
7130         * monitor.c, monitor.h: New function for querying offsets of
7131         members of MonoThreadsSync.
7133 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
7135         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
7136         to speed up this function and to avoid the boundless memory growth caused by
7137         the signature_dup () calls.
7139 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
7141         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
7142         wrapper.
7144         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
7145         by 1 bit.
7147         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
7149 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
7151         * appdomain.c:
7152         * domain-internals.h: made mono_set_private_bin_path_from_config()
7153         "internal".
7154         * object.c: call the above function after setting the configuration
7155         file path for the root domain.
7156         Fixes bug #314478.
7158 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
7160         * assembly.c: when the assembly is loaded from an absolute path, end
7161         basedir with a directory separator.
7162         Bug #440781 fixed.
7164 2008-10-30  Mark Probst  <mark.probst@gmail.com>
7166         * monitor.c (mono_monitor_get_fast_enter_method): If
7167         CompareExchange is not available, don't create the fastpath
7168         instead of asserting.  (The method is missing in the 1.1 profile.)
7170 2008-10-30  Mark Probst  <mark.probst@gmail.com>
7172         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
7174         * monitor.c, monitor.h: Code for generating Monitor.Enter and
7175         Monitor.Exit IL fastpaths.
7177 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
7179         * class.c (mono_class_create_from_typedef): Added Vector2ul.
7181 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
7183         * class.c (mono_class_create_from_typedef): Added Vector2l.
7185 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
7187         * class.c (mono_class_create_from_typedef): Added Vector2d.
7189 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
7191         * appdomain.c: translate \ into / for cache_path.
7192         * domain-internals.h: new mono_is_shadow_copy_enabled().
7193         * icall.c: (fill_reflection_assembly_name) do the same path
7194         manipulations that get_code_base does.
7195         (get_code_base) use mono_is_shadow_copy_enabled.
7197 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
7199         * appdomain.c: shadow-copied assemblies go to CachePath +
7200         ApplicationName when both are set. DynamicBase has nothing to do with
7201         shadow copies.
7202         Bug #406877 fixed.
7204 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
7206         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
7207         STANDALONESIG table.
7209         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
7210         standalone signatures.
7212         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
7213         comparison code: instead of comparing the signatures using a custom
7214         equals function, transform them to a common signature and compare that. This
7215         works better with AOT.
7217 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
7219         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
7221         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
7222         call for generic instances.
7223         (mono_class_setup_properties): Call setup_properties () before accessing
7224         gklass->properties.
7226         * class.c (mono_class_get_virtual_methods): New helper function to iterate
7227         over the virtual methods of a class using metadata if possible, avoiding the
7228         creation of MonoMethod's for non-virtual methods.
7229         
7230         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
7231         get_virtual_methods () to iterate over the virtual methods of classes.
7233 2008-10-25  Martin Baulig  <martin@ximian.com>
7235         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
7237 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
7239         * class.c (mono_class_create_from_typedef): Added Vector4i.
7241 2008-10-24  Mark Probst  <mark.probst@gmail.com>
7243         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
7244         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
7245         special-casing applies to eliminate the call completely.
7247 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
7249         * class.c (mono_class_create_from_typedef): Added Vector8s.
7251 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
7253         * class.c (mono_class_create_from_typedef): Added Vector16sb.
7255 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
7257         * icall.c: get rid of annoying warning.
7259 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
7261         * threadpool.c: in 1.x, if you change the background status of the
7262         threadpool thread, it's not reset.
7263         Remove unnecessary calls to SetState.
7265 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
7267         * threadpool.c: asynchronously create a set of idle threads upon first
7268         use of the threadpool. SetMinThreads will now start the appropriate
7269         number of idle threads if they are not already running. The default is
7270         1 threadpool thread per CPU. Increased the maximum number of threads
7271         per CPU to 10.
7273 2008-10-22  Martin Baulig  <martin@ximian.com>
7275         Revert r116521 from Zoltan, it breaks the debugger:
7277         * class.c (mono_class_get_virtual_methods): New helper function to iterate
7278         over the virtual methods of a class using metadata if possible, avoiding the
7279         creation of MonoMethod's for non-virtual methods.
7280         
7281         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
7282         get_virtual_methods () to iterate over the virtual methods of classes.
7284 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
7286         * threads.c: when creating a threadpool thread, set its state to
7287         'background'.
7288         * threadpool.c: reset the background state of a threadpool thread
7289         after finishing each work item
7290         Bug #437888 fixed.
7292 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
7294         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
7295         
7296         * class.c (mono_class_setup_vtable_general): Add an optimized version for
7297         generic instances which works by inflating the methods in the container
7298         class's vtable.
7300         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
7301         variant which doesn't make a copy if no inflation was done.
7302         (mono_class_setup_fields): Use it.
7304         * metadata.c (mono_metadata_get_shared_type): New helper function to
7305         return a shared instance of a given MonoType.
7307         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
7308         a copy of most non-generic types.
7310 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
7312         * threadpool.c: remove one more GetSystemInfo () call.
7314 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
7316         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
7317         use the code in mono-proclib.h to get processor information.
7319 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
7321         * appdomain.c: fixed the logic that determines whether assemblies in a
7322         directory are "shadow-copied" or not. Bug #433483 fixed.
7324 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
7326         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
7327         warning.
7329 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
7331         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
7332         returning a vtype.
7334         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
7335         reflection.c: Use mono_field_get_name () for accessing a field's name.
7337         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
7338         class.c
7340         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
7341         field.
7343         * loader.c (find_method_in_class): Reenable the metadata optimization by
7344         not using it for generic instances.
7346         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
7347         data/def_type fields from MonoClassField into a separate structure.
7348         (struct MonoClassField): Remove data/def_type fields.
7349         (struct _MonoClass): Add a 'field_def_values' array to store the default
7350         values/RVA for fields.
7352         * class.c reflection.c: Update after the changes.
7353         
7354         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
7355         for accessing field->data.
7357         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
7359         * loader.c (find_method_in_class): Revert the last change for now as
7360         it breaks Mono.C5 unit tests.
7362         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
7363         'field_generic_types' and 'field_objects' which contain the information
7364         previously stored in MonoInflatedField.
7365         (MonoInflatedField): Delete.
7366         (struct _MonoClassField): Delete 'generic_info' field.
7368         * reflection.c: Store the information which was previously in 
7369         field->generic_info in MonoDynamicGenericClass instead.
7371         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
7372         MonoClassField changes.
7374 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
7376         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
7377         store the value inside the data array of the MonoMethodWrapper.
7378         This saves memory, is faster and fixes the lifetime issues (methods
7379         were never removed from the hash previously). May also fix bug#436996.
7381 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
7383         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
7384         generic instances, compute the type from the generic definition instead of
7385         looking in field->generic_info.
7387         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
7388         for inflated fields, the only user was get_fieldref_token () which no
7389         longer needs it.
7391         * class.c (mono_class_init): Revert the last change as it seems to cause
7392         crashes.
7394         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
7395         bytes on 64 bit platforms.
7397         * object.c (mono_class_create_runtime_vtable): Fix a warning.
7398         
7399         * object.c (mono_class_create_runtime_vtable): Don't initalize
7400         field->data/field->def_type here, it is done lazily by 
7401         mono_class_get_field_default_value ().
7403         * icall.c (ves_icall_get_enum_info): Call 
7404         mono_class_get_field_default_value () instead of directly accessing
7405         field->data and field->def_type.
7407         * object.c (get_default_field_value): Ditto.
7409         * class.c (mono_field_get_data): Ditto.
7410         
7411         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
7412         call for generic instances.
7414         * loader.c (find_method_in_class): If klass != from_class, then inflate
7415         the method with the context of from_class, since the caller assumes this.
7417 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
7419         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
7420         for accessing method->slot.
7422 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
7424         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
7426 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
7428         * class.c (mono_method_get_vtable_index): Use
7429         mono_method_get_vtable_slot () for accessing method->slot.
7431         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
7432         accessing klass->methods.
7434         * class.c (mono_method_get_vtable_slot): New helper function.
7435         (mono_class_get_vtable_entry): Ditto.
7436         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
7437         accessing method->slot.
7439         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
7440         method to get_inflated_method ().
7442         * class.c (mono_class_get_inflated_method): New helper method to obtain
7443         a method of an inflated class without calling setup_methods ().
7444         (mono_class_get_cctor): Use get_inflated_method.
7446         * generic-sharing.c (mono_class_get_method_generic): Ditto.
7447         
7448         * marshal.c image.c: Lazily create all the marshal caches.
7450         * image.c (mono_image_init): Move initialization of runtime_invoke
7451         caches to marshal.c.
7453         * marshal.c (get_cache): New helper function to lazily initialize a 
7454         wrapper cache.
7455         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
7457         * debug-helpers.c (mono_method_full_name): Include generic arguments.
7459 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
7461         * loader.c: fixed check for interface type.
7463 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
7465         * appdomain.c: check for NULL setup before it's referenced.
7468 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
7470         * class.c: remove the unused old vtable setup code.
7472 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
7474         * class.c: don't depend on interface order in
7475         setup_interface_offsets (bug #435777).
7476         * reflection.c: sort the InterfaceImpl table (patch from
7477         Jb Evain  <jbevain@novell.com>).
7479 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
7481         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
7482         the low level assemblies lock.
7484 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
7486         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
7487         object.c, reflection.c, socket-io.c, threads.c: introduced
7488         mono_framework_version () to return the major framewrok version,
7489         changed the code that was using more complex patterns to use it.
7490         Return the correct value for PlatformID for OSX.
7492 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
7494         * icall-def.h, process.h, process.c: added an icall to get info about
7495         processes using mono-proclib.
7497 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
7499         * mono-perfcounters.c: use the mono-proclib functions to
7500         access process information.
7502 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
7504         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
7505         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
7506         reflection.c: remove rawbuffer usage: mmap support is more sanely
7507         provided by utils/mono-mmap.
7509 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
7511         * gc.c: use posix semaphores when possible so that
7512         mono_gc_finalize_notify() is signal safe.
7514 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
7516         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
7517         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
7518         be #ifdef-ed out, the linker will remove the rest.
7520         * marshal.c: Implement DISABLE_COM.
7522         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
7524 2008-10-11  Miguel de Icaza  <miguel@novell.com>
7526         * locales.c (string_invariant_compare_char): Optimization: do not
7527         call g_unichar_type unless we actually need the information.
7529 2008-10-10  Mark Probst  <mark.probst@gmail.com>
7531         * object.c, class-internals.h: Also create remoting trampolines
7532         for generic methods.  Pass the domain to the remoting trampoline
7533         creation function, too.
7535 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
7537         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
7539 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
7541         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
7542         Vector4ui.
7544 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
7546         * assembly.c:
7547         * locales.c: remove the use of g_strdown. Fixes bug #322313.
7549 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
7551         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
7552         for the least possible amount of time (extending the fix in r113458).
7554 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
7556         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
7558 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
7560         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
7561         as possible simd intrinsic types.
7562         Optimized the test to check for the common prefix first.
7564 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
7566         * class.c: back out part of a broken optimization committed on
7567         May 23th (bug #433908).
7569 2008-10-09  Mark Probst  <mark.probst@gmail.com>
7571         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
7572         Win32.  Should fix #432388 for most cases until we have the new
7573         profiler on Win32.
7575 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
7577         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
7578         instead of using inst->id so the hash is stable for AOT.
7580 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
7582         * appdomain.c:
7583         * icall.c: create a .ini file for shadow-copied assemblies that
7584         contains the location of the original assembly. Use this to return the
7585         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
7586         Also fix the number of '/' for windows when returning the CodeBase.
7587         Fixes bug #430920.
7589 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7591         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
7593         Code is contributed under MIT/X11 license.
7595 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7597         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
7598           if if the class vtable needs initialized.
7600         Code is contributed under MIT/X11 license.
7602 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
7604         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
7605           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
7606           STRING->BSTR, and CLASS->INTERFACE.
7608         Code is contributed under MIT/X11 license.
7610 2008-10-07  Marek Habersack  <mhabersack@novell.com>
7612         * sysmath.h: changed the declaration of the
7613         ves_icall_System_Math_Round2 icall by adding an extra
7614         away_from_zero parameter.
7616         * sysmath.c (ves_icall_System_Math_Round2): added support for
7617         away from zero rounding. The icall now takes an extra boolean
7618         parameter to signal that away from zero operation is requested.
7620 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
7622         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
7623         the delegate klass so it can work with full-aot.
7624         (mono_marshal_get_delegate_end_invoke): Ditto.
7625         (mono_marshal_get_delegate_invoke): Ditto.
7627 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
7629         * gc.c, attach.h, attach.c: remove a bad pattern:
7630         add_finalizer_callback () is not implemented correctly, it can't
7631         without adding more overhead to the finalizer loop and it's not
7632         even needed, since we know exactly what we need to call, so there is
7633         no need to do so through an expensive function pointer.
7635 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
7637         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
7638         for the no-gc case.
7639         * attach.c (mono_attach_init): Remove the #ifdef.
7641 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
7643         * attach.c (mono_attach_init): Don't use
7644         mono_gc_add_finalizer_thread_callback when compiling without GC.
7645         Fixes #432306.
7646         
7647         Code is contributed under MIT/X11 license.
7649 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
7651         * class.c (mono_class_create_from_typedef): Remove the 
7652         #ifndef DISABLE_SIMD stuff.
7654 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
7656         * class-internals.h (MonoClass): Added simd_type bit field.
7658         * class.c (mono_class_create_from_typedef): Check if type is a simd
7659         intrinsic.
7661 2008-10-03  Mark Probst  <mark.probst@gmail.com>
7663         * object.c (mono_method_add_generic_virtual_invocation): Only add
7664         instantiations to the thunk whose count is at least as large as
7665         the threshold.
7667 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
7669         * icall.c: changed the Type of the exception thrown when trying to
7670         invoke a constructor on an abstract class. Part of the fix for bug
7671         #324185.
7673 2008-10-02  Mark Probst  <mark.probst@gmail.com>
7675         * class.c, class-internals.h (mono_method_get_vtable_index): New
7676         function which returns the index into the vtable and properly
7677         handles inflated virtual generic methods.
7679 2008-10-01  Mark Probst  <mark.probst@gmail.com>
7681         * object.c, domain.c, object-internals.h, domain-internals.h:
7682         Generalize IMT thunk machinery to also handle thunks for virtual
7683         generic method invokes.  When a virtual generic method is invoked
7684         more than a number of times we insert it into the thunk so that it
7685         can be called without lookup in unmanaged code.
7687         * generic-sharing.c, class-internals.h: Fetching a
7688         MonoGenericInst* for a method from an (M)RGCTX.
7690 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
7692         * marshal.c (emit_marshal_string): Applied a variant of a patch by
7693         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
7694         marshalling. Fixes #431304.
7696 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
7698         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
7699           handle when ref is specified without In or Out.
7701         Code is contributed under MIT/X11 license.
7703 2008-09-30  Mark Probst  <mark.probst@gmail.com>
7705         * loader.c (mono_get_method_constrained): Don't expand method with
7706         the class's context, because it's already a method of that class.
7708 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
7710         * attach.c : should be correct build fix.
7712 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
7714         * attach.c: Fix the previous change.
7716 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
7718         * attach.c : quick w32 build fix.
7720 2008-09-27  Miguel de Icaza  <miguel@novell.com>
7722         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
7723         crashes MonoDevelop: #430455.
7725 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
7727         * domain-internals.h (struct _MonoDomain): Move most fields used only by
7728         the JIT do MonoJitDomainInfo in ../mini/mini.h.
7730         * domain.c: Remove initialization/cleanup of the removed fields.
7732 2008-09-27  Mark Probst  <mark.probst@gmail.com>
7734         * class.c (mono_class_generic_sharing_enabled): Enable generic
7735         code sharing for PPC.
7737 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
7739         * attach.c : Fixing the Windows builds.
7741         Code is contributed under MIT/X11 license.
7743 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
7745         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
7746         the default generic sharing mode to 'all'.
7748 2008-09-25  Mark Probst  <mark.probst@gmail.com>
7750         * generic-sharing.c, class-internals.h: New function for checking
7751         whether a method needs a static RGCTX invoke wrapper.  A few
7752         funtions moved from mini/generic-sharing.c.
7754         * icall.c: New function used.
7756 2008-09-25  Mark Probst  <mark.probst@gmail.com>
7758         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
7759         Static RGCTX invoke wrapping applies to value type methods, too.
7761         * class.c (mono_class_setup_vtable_general): In generic-shared
7762         value types, wrap methods with a static RGCTX invoke wrapper.
7764 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
7766         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
7767         osx build.
7769 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
7771         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
7772         register a callback which is called when the finalizer thread is woken
7773         up.
7774         (finalizer_thread): Call the callback if it exists.
7776         * attach.h attach.c: New files, implementing the attach mechanism.
7778         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
7779         
7780         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
7781         by the previous change.
7783 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
7785         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
7786         loader.c, marshal.c, metadata-internals.h, metadata.c,
7787         method-builder.c, object.c, reflection.c: introduced specific functions
7788         to allocate from the domain and image mempools and cleaned up most of
7789         the code to use them (still missing a few in reflection.c).
7790         Keep the loader bytes counter updated.
7792 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
7794         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
7795         loader-related counters.
7797 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
7799         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
7800         added more MS-compatible counters.
7802 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
7804         * class.c (mono_class_setup_fields): Call setup_fields before accessing
7805         class->blittable. Fixes #428217.
7807 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
7809         * reflection.c (mono_image_get_field_on_inst_token): Call 
7810         field_encode_signature () since that handles custom modifiers too.
7811         Fixes #424663.
7813 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
7815         * reflection.c (add_custom_modifiers): New helper function to merge custom
7816         modifiers stored in objects to a MonoType.
7817         (fieldref_encode_signature): Encode custom modifiers.
7818         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
7819         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
7821 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
7823         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
7824         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
7825         64-bit IL only images because imports are not resolved for IL only images.
7826         Special thanks to Bill Holmes for finding this bug and testing the patch.
7827         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
7829         Contributed under MIT/X11 license.
7831 2008-09-19  Miguel de Icaza  <miguel@novell.com>
7833         * mono-config.c (dllmap_start): Add support for the bits keyword
7834         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
7836 2008-09-19  Mark Probst  <mark.probst@gmail.com>
7838         * reflection.c (inflate_mono_method): When the class the method is
7839         to be inflated for is itself not inflated, just return the method.
7841 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
7843         * mono-perfcounters.c: use more user friendly process instance names.
7845 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
7847         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
7848           handle "[in] ref" and "[in][out] ref" cases.
7850         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
7851           to mono_mb_create_method.  This was causing problems calling native to
7852           managed passing Variants by value.
7854         Code is contributed under MIT/X11 license.
7856 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
7858         * class.c (can_access_internals): Call mono_assembly_load_friends ()
7859         before accessing the friend_assembly_names field.
7861         * assembly.c (mono_assembly_load_friends): Make this callable multiple
7862         times.
7863         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
7864         called lazily when it is needed.
7866         * metadata-internals.h (struct _MonoAssembly): Add 
7867         'friend_assembly_names_inited' flag.
7869 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
7871         * mono-perfcounters-def.h: fix the types of a few counters.
7872         * mono-perfcounters.c: implemented the instance names getter
7873         and a few bugfixes.
7875 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
7877         * culture-info-table.h : regenerated.
7879 2008-09-17  Robert Jordan  <robertj@gmx.net>
7881         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
7882         context bound objects. Fixes #415577.
7884         Code is contributed under MIT/X11 license.
7886 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
7888         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
7889         implementation (bug #423582).
7891 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
7893         * object.c (mono_object_get_virtual_method): Handle the case method->slot
7894         is not set. Fixes #426309.
7896 2008-09-16  Jb Evain  <jbevain@novell.com>
7898         * class.c (mono_class_from_name): fix the exported type look up
7899         when the type is defined in a referenced assembly.
7901 2008-09-16  Jb Evain  <jbevain@novell.com>
7903         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
7904         increment the next index counter on each iteration to make that work
7905         for more than one type forwarder. Unmanaged part to fix #422929.
7907 2008-09-15  Mark Probst  <mark.probst@gmail.com>
7909         * object-internals.h: enum ComInterfaceType in
7910         MonoInterfaceTypeAttribute is guint32, not guint16.
7912 2008-09-12  Mark Probst  <mark.probst@gmail.com>
7914         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
7915         writing code.
7917 2008-09-11  Mark Probst  <mark.probst@gmail.com>
7919         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
7920         not gboolean.
7922 2008-09-11  Mark Probst  <mark.probst@gmail.com>
7924         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
7925         Endianness fixes for MonoSymbolFileOffsetTable.
7927 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
7929         * process.c (complete_path) : Removing quotes from the 
7930           input path.  The glib file routines do not handle file paths
7931           that have quotes around them.
7933         Code is contributed under MIT/X11 license.
7935 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
7937         * socket-io.h : Adding a comment to provide locations where 
7938           changes to MonoSocketAsyncResult need to be synced.
7940         Code is contributed under MIT/X11 license.
7942 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
7944         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
7945         parameters as well. Fixes #425001.
7947 2008-09-08  Miguel de Icaza  <miguel@novell.com>
7949         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
7950         windows build.
7952 2008-09-07  Miguel de Icaza  <miguel@novell.com>
7954         * console-io.c: Add support for tracking the window size if it
7955         changes.
7957         The setup is very simple: the TtySetup function will now return a
7958         pointer to a location in memory that tracks the current console
7959         size.  The managed code checks its current value every time its
7960         queried against the last value set, and updates accordingly.
7962         With this setup we can work with multiple consoles, and we do not
7963         require to poke into managed code from a signal handler.
7965         Additionally, the environment for COLUMNS and LINES is now handled
7966         in unmanaged code.
7968         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
7970 2008-09-07  Mark Probst  <mark.probst@gmail.com>
7972         * marshal.c (mono_type_native_stack_size): Treat
7973         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
7975 2008-09-04  Jb Evain  <jbevain@novell.com>
7977         * class.c (mono_class_is_assignable_from): fix assignability of nullables
7978         to nullables.
7980 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
7982         * verify.c (verify_type_compatibility_full): Revert change
7983         to allow converting a native int to unmanaged pointer be verifiable
7984         under non-strict mode.
7985         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
7987         * verify.c: Added some TODOs.
7989 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
7991         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
7992           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
7993           Changed to use GlobalAlloc for the memory returned on Windows platforms.
7995         Code is contributed under MIT/X11 license.
7997 2008-09-02  Jb Evain  <jbevain@novell.com>
7999         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
8001 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
8003         reflection.c (typebuilder_setup_fields): Handle classes with
8004         explicit size.
8006 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
8008         class.c (mono_class_setup_events): Add memory barrier due to
8009         double checked locking.
8010         
8011         class.c (mono_class_setup_properties): Same.
8013 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
8015         * class.c (mono_class_is_assignable_from): Fix the build.
8016         
8017         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
8018         before accessing klass->interface_bitmap. Fixes #421744.
8020 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
8022         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
8023         the runtime into no-exec mode, useful when running the AOT compiler.
8025         * appdomain.c gc.c object.c: Avoid executing managed code when running
8026         in no-exec mode.
8027         
8028         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
8030         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
8031         special case when the mono_assembly_loaded () returns NULL because the 
8032         search hook is not installed.
8034 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
8036         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
8037         crashes in bstr marshalling on linux.
8039 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
8041         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
8042         with more than one parameter.
8044 2008-08-24  Miguel de Icaza  <miguel@novell.com>
8046         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
8047         start/stop flow control as well when turning off ICANON (allows
8048         C-s and C-q to be read by Console.ReadKey).
8050 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
8052         * class.c (mono_class_init): Move the initialization of nested classes
8053         into mono_class_get_nested_types (). Fixes #418433.
8055         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
8056         flag.
8058         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
8059         iterating tough the nested classes of a class.
8061 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
8063         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
8064         on arm.
8066 2008-08-22  Miguel de Icaza  <miguel@novell.com>
8068         * console-io.c (sigcont_handler): Support signal chaining for
8069         SIGCONT.
8071         (console_set_signal_handlers): Use best practices with sigaction,
8072         clear the structure before using it. 
8074 2008-08-22  Robert Jordan  <robertj@gmx.net>
8076         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
8077         Fix the Windows build.
8079 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
8081         * class.c (mono_class_generic_sharing_enabled): Make the default
8082         sharing mode 'corlib'.
8084 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
8086         * console-io.c (console_set_signal_handlers): Fix a warning.
8088         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
8089         method normally, the JIT will take care of avoiding recursion.
8091 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
8093         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
8095         Code is contributed under MIT/X11 license.
8097 2008-08-20  Miguel de Icaza  <miguel@novell.com>
8099         * console-io.c (sigcont_handler): We need to restore the entire
8100         termios state, not only the original settings, as things like echo
8101         can be controlled after this (Booish exposes this issue with its
8102         own ReadLine implementation).
8104         Additionally, we need to set the terminal back into keypad_xmit
8105         mode.
8106         
8107         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
8108         string as a paramter as well.   Otherwise we get different
8109         keyboard sequences.
8111 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
8113         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
8114         delegates with byref out parameter passing. Fixes #351520.
8116         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
8117         a generic context.
8118         (mono_type_get_desc): Add the type arguments for GENERICINST.
8119         (mono_method_full_name): Stringify the class name using mono_type_full_name
8120         so it picks up generic arguments.
8122 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
8124         * console-io.c: Removed debug output.
8126 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
8128         reflection.c (mono_reflection_create_runtime_class): Alloc
8129         the nested classes linked list using the dynamic image mempool.
8130         Fixes leak in corlib compilation.
8132 2008-08-19  Miguel de Icaza  <miguel@novell.com>
8134         * console-io.c: Fix incredibly annoying behavior on the console
8135         after resuming execution after control-z.   This affected every
8136         console application.
8138 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
8140         * mempool-internals.h: Header for mono private mempool functions. The first
8141         two function are for allocating glib linked lists using pools.
8143         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
8145         * Makefile.am: Added mempool-internals.h.
8147 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
8149         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
8150         (mono_domain_free): Ditto.
8152         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
8153         be used by the JIT to store its domain-specific information, instead of putting
8154         it directly into MonoDomain.
8156         * domain.c (mono_install_create_domain_hook): New helper function to install
8157         a hook which initializes domain->runtime_info.
8159         * domain.c (mono_install_free_domain_hook): Ditto.
8160         
8161 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
8163         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
8164         asserting if the ares parameter is null.
8166         * mono-perfcounters.c: Fix warnings.
8168         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
8169         is not needed, don't check for interruptions either.
8170         (mono_marshal_get_delegate_end_invoke): Ditto.
8172 2008-08-15  Marek Habersack  <mhabersack@novell.com>
8174         * mono-perfcounters.c (predef_readonly_counter): added support for
8175         reading the ASP.NET Requests Queued counter from another process.
8177 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
8179         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
8180         MonoImage to simplify the AOT code.
8182 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
8184         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
8185         marshalling. Fixes #416078.
8187 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
8188         
8189         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
8190         it is set, looking up the icall address is deferred to the JIT, since 
8191         in embedded scenarios, the icall might not be registered in the runtime
8192         doing the AOT compilation. Backported from the 2.0 branch.
8194 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
8196         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
8197         Fixes #415621.
8199 2008-08-05  Marek Habersack  <mhabersack@novell.com>
8201         * Makefile.am: added support for cross-compilation.
8203 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
8205         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
8207 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
8209         * mono-perfcounters.c: jitted methods and jitted bytes counters.
8211 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
8213         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
8214         mono-perfcounters.c: performance counters implementation.
8216 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
8218         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
8219         to gpointer, letting the AOT code decide what to store in it.
8221 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
8223         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
8224           mono_class_setup_methods if the methods are not initialized.
8226         Code is contributed under MIT/X11 license.
8228 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
8230         * verify.c: Remove some debug code I commited by accident.
8232         * verify.c (mono_method_is_valid_in_context): Change the return value
8233         to make possible to distinguish between invalid and unverifiable.
8235         * verify.c (verifier_load_method): Don't return NULL for unverifiable
8236         methods.
8238 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
8240         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
8241         constraints. Fixes regression in gtest-253.
8243 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
8245         * verify.c (mono_verifier_verify_class): Don't allow generic types
8246         with explicit layout.
8248         * verify.c (mono_method_verify): Check locals and argument types.
8250 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
8252         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
8253         wait if the thread is in StopRequested state.
8255         * class.c (mono_class_from_name): Refactor the module searching code into
8256         a separate function so it can be reused in the AOT case too.
8258 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
8260         * verify.c (mono_type_is_valid_in_context): Improve the error message.
8261         Check both the type and it's generic type definition for loader errors.
8262         
8263         * verify.c (mono_method_is_valid_in_context): Don't generate another
8264         error when a type errors occur, this leads to the wrong exception been
8265         thrown.
8267 2008-07-28  Dick Porter  <dick@ximian.com>
8269         * icall-def.h
8270         * process.c
8271         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
8272         New internal calls to duplicate and close a process handle.
8274 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
8276         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
8278 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
8280         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
8282 2008-07-27  Robert Jordan  <robertj@gmx.net>
8284         * class.c (mono_class_init): Don't compute class.has_finalize for
8285         valuetypes. Fixes #412477.
8287 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
8289         * verify.c: Implement constraint equivalence checking.
8290         This is required when a generic parameter is used as
8291         argument to a constrained one.
8293         Fixes #410637.
8295 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
8297         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8299         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
8301         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
8302         synch with managed object layout.
8304 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
8306         * verify.c (do_branch_op): Handle valuetypes and generic
8307         arguments properly.
8309         * verify.c (do_cmp_op): Same.
8311         Fixes #410383.
8313 2008-07-24  Mark Probst  <mark.probst@gmail.com>
8315         * generic-sharing.c: Fix memory leaks.
8317         * class.c, class-internals.h: Make
8318         mono_class_inflate_generic_type_with_mempool() non-static.
8320 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
8322         * pedump.c (dump_verify_info): Dump full class name.
8324 2008-07-24  Mark Probst  <mark.probst@gmail.com>
8326         * generic-sharing.c: Removed some old code that didn't do anything.
8328 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
8329         * profiler.c: Added runtime_initialized_event,
8330         mono_profiler_install_runtime_initialized and
8331         mono_profiler_runtime_initialized. This new hook tells the profiler
8332         when the runtime is sufficiently initialized to be able to call
8333         mono_thread_attach on the root appdomain.
8334         * profiler.h, profiler-private.h: Likewise.
8336 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
8338         * verify.c (do_cast): Do boxing for generic arguments as well.
8340         * class.c (is_nesting_type): Drop generic instantiations before
8341         checking for nesting.
8343         * class.c (can_access_instantiation): Allow access to generic
8344         arguments.
8346 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
8348         * verify.c (verify_class_for_overlapping_reference_fields):
8349         On some cases, the field size might be zero, guard against that.
8350         Fix the explicit layout check to work as expected.
8352 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
8354         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
8355         mono_thread_resume () during shutdown, since the thread we want to abort
8356         might be suspended.
8358 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
8360         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
8361         warning.
8363         * debug-mono-symfile.c: Fix a warning.
8365         * mono-perfcounters.c (get_cpu_times): Fix a warning.
8367         * object.c (mono_class_vtable): Check if exception_type is set, and return
8368         NULL as defined by the function comments.
8370 2008-07-22  Mark Probst  <mark.probst@gmail.com>
8372         * mempool.c: Use malloc for every single mempool allocation if the
8373         configure option is set.  This makes it easier to track mempool
8374         allocations with tools like Valgrind.
8376 2008-07-22  Jb Evain  <jbevain@novell.com>
8378         * reflection.c (create_dynamic_mono_image): emit the same
8379         metadata version that SL2 does when creating a SL2 image.
8381 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
8383         * icall-def.h:
8384         * icall.c: New icall System.Enum:get_hashcode. This function
8385         avoids the overhead of boxing the enum to the underlying type.
8387 2008-07-21  Mark Probst  <mark.probst@gmail.com>
8389         * reflection.c (mono_method_get_object): Don't let static RGCTX
8390         invoke wrappers get into MonoReflectionMethods.
8392 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
8394         * object-internals.h:
8395         * object.c: New mono_runtime_class_init_full function
8396         that makes throwing the exception optinal.
8398         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
8399         for the case where the exception object is supplied.
8401 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
8403         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
8404         old ld versions.
8406         Contributed under MIT/X11 license.
8408 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
8410         * string-icalls.c (ves_icall_System_String_InternalSplit):
8411         Optimize array allocation by caching the MonoClass of the
8412         array type.
8414         * icall.c (ves_icall_Type_GetMethodsByName): Same.
8416         * reflection.c (mono_param_get_objects): Same.
8418 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
8420         * icall-def.h:
8421         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
8422         It inflates the given type using the class context.
8424 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
8426         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
8427         the vtable if it already exists.
8429         * object-internals.h: Add mono_class_try_get_vtable as part of the
8430         internal API.
8432         * reflection.c (mono_type_get_object): Use the MonoObject from the
8433         vtable when possible. Reduces locking contention on reflection heavy
8434         code.
8436 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
8438         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
8439         g_bit_nth_msf () since that macro is not implemented in eglib.
8441 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
8443         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
8444         on platforms which do not support it.
8446 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
8448         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
8450 2008-07-11  Martin Baulig  <martin@ximian.com>
8452         * mono-debug-debugger.h
8453         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
8455         * mono-debug-debugger.c
8456         (_mono_debugger_interruption_request): New global volatile variable.
8457         (mono_debugger_check_interruption): New public function.
8459         * threads.c
8460         (mono_thread_current_check_pending_interrupt): Call
8461         mono_debugger_check_interruption().
8462         (mono_thread_interruption_checkpoint_request): Likewise.
8464 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8466         * verify.c: Add more type checks for loaded types. Verify the result
8467         handle from ldtoken.
8469 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8471         * loader.c (field_from_memberref): Don't crash if the field
8472         wasn't found.
8474 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8476         * verify.c: Verify if type and method instantiations
8477         don't have invalid VAR or MVAR arguments.
8479 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8481         * verify.c: Fix double free of function pointer list.
8483 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
8485         * object.c (mono_string_to_utf8): Comment the new code as it
8486         breaks under eglib.
8488 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
8490         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
8492 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
8494         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
8495           is not throw too many times.
8497         Code is contributed under MIT/X11 license.
8499 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
8501         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
8502         debugging is turned off.
8504 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
8506         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
8508 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8510         * class-internals.h, class.c: Added new generic sharing option:
8511         Share only stuff in System.Collections.Generic, which is now the
8512         default.
8514 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8516         * generic-sharing.c, class-internals.h: New function for getting a
8517         generic method in a generic class given the corresponding method
8518         for a different instantiation of the class.  Partly refactored
8519         from mini-trampolines.c.
8521         * class.c: Make sure generic methods have a class_inst if they are
8522         part of a generic class.
8524         * metadata.c (mono_type_stack_size_internal): Handle type
8525         variables.
8527 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8529         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
8530         Signifies whether information on the this/vtable/mrgctx variable
8531         is available.
8533 2008-07-04  Mark Probst  <mark.probst@gmail.com>
8535         * object.c, object-internals.h, icall.c: New function
8536         mono_delegate_ctor_with_method(), which does the same as
8537         mono_delegate_ctor(), but takes an explicit method argument
8538         instead of taking the method from the jit info.
8540         * marshal.c: When creating a delegate with an inflated method take
8541         the "this" argument as the target class for the castclass.
8543 2008-07-03  Mark Probst  <mark.probst@gmail.com>
8545         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
8546         mono_jit_info_table_find() to perform very badly in some cases.
8548 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
8550         * icall.c (type_from_typename): Handle 'string'.
8552         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
8553         wrappers into the wrapper_hash, since the key is not a MonoMethod.
8555 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
8557         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
8559         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
8560         number of available managed allocator types.
8562         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
8563         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
8565 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
8567         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
8568         which is a low level lock protecting just the 'jit_code_hash' hash table.
8570         * domain.c: Initialize+cleanup jit_code_hash_lock.
8571         
8572 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
8574         * coree.c (mono_load_coree): Set coree_module_handle global variable only
8575         after initialization.
8577         * coree.h: Make MonoFixupExe internal.
8579         Contributed under MIT/X11 license.
8581 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
8583         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
8584         because that is platform independent. Check NumberOfRvaAndSizes in PE32
8585         as well.
8586         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
8587         image being loaded is a CLI image and _CorValidateImage gets called.
8589         * coree.h: Add MonoLoadImage.
8591         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
8592         instead of LoadLibrary.
8594         Contributed under MIT/X11 license.
8596 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
8598         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
8599         for any primitive type.
8601 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
8603         * object.c (mono_array_new_specific): Optimize this and the other allocation
8604         functions a bit.
8605         
8606         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
8607         domains too if mono_dont_free_domains is set.
8609         * domain-internals.h (mono_dont_free_domains): New internal option controlling
8610         whenever to free appdomain data after it has been unloaded.
8612         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
8613         
8614 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
8616         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
8617         (mono_method_get_equivalent_method): Fix a warning.
8619         * object.c (mono_message_init): Avoid looking up array types for each call.
8621 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
8623         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
8624         call.
8626         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
8627         even more.
8629         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
8630         each iteration.
8632         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
8633         fields of an enum.
8635 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
8637         * object.c (mono_value_box): Fix boxing of nullables.
8639 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
8641         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
8642         mono_module_handle that is defined by the linker; no initialization required.
8643         * coree.h: Remove mono_module_handle, add __ImageBase, update
8644         mono_image_open_from_module_handle.
8645         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
8646         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
8647         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
8648         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
8649         to 4 GB away from image base address. IA64 version is not tested but was very
8650         easy to implement and should work if we ever need it.
8651         * domain.c (mono_init_internal): Avoid system error message boxes.
8652         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
8653         with has_entry_point. Handle do_mono_image_load fauilre correctly.
8654         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
8655         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
8656         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
8658         Contributed under MIT/X11 license.
8660 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8662         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
8663         as part of the private mono API.
8664         
8665         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
8666         Do proper argument checking for methods that belong to generic classes.
8667         Do proper type resolution for GMFH/2.
8668         Fixes #377324.
8669         
8670 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8672         * verify.c (do_switch): Fix a memory corruption bug with
8673         the jump index is out of bound.
8675 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8677         * verify.c: Disable debug code.
8679 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
8681         * reflection.c (mono_image_get_methodbuilder_token): Use
8682         mono_image_get_methodspec_token_for_generic_method_definition
8683         instead of mono_image_get_memberref_token. We cache more memberef
8684         entries now.
8686 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8688         * verify.c: Inflate exception clause types.
8689         Fixes #402606.
8690         
8691 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8693         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
8694         name.
8696         * reflection.c (mono_image_get_ctorbuilder_token): Same.
8698         * reflection.c (mono_image_create_method_token): Same.
8700 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
8702         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
8703         It does the same as mono_image_get_methodref_token but works on
8704         MethodBuilder.
8706         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
8707         and always generate a methodspec. This follows the old behavior and fixes
8708         the regressions in System.Core. 
8710 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
8712         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
8713         don't event mono_class_get () succeeds. Fixes #402182.
8715 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
8717         * metadata-internals.h: Added MonoDynamicImage::methodspec
8718         hashtable to store methodspec tokens created for MethodBuilders.
8720         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
8721         MethodBuilders as open instantiations if a methodspec was requested.
8723         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
8725         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
8727         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
8729         Fixes bug #349190.
8731 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
8733         * loader.c (method_from_methodspec): Avoid crashing if the
8734         method lookup fails.
8736 2008-06-20  Dick Porter  <dick@ximian.com>
8738         * socket-io.c (get_socket_assembly): Cope with Moonlight network
8739         classes being in a different assembly.  Fixes bug 399184.
8741 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
8743         * loader.c (mono_loader_init): Make this callable multiple times.
8744         (mono_dllmap_insert): Call mono_loader_init () so this works even before
8745         the runtime is initialized. Fixes #401755.
8747 2008-06-19  Dick Porter  <dick@ximian.com>
8749         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
8750         Fixes bug 349688.
8752 2008-06-19  Dick Porter  <dick@ximian.com>
8754         * socket-io.c:
8755         * icall-def.h: Implement Socket generic Send() and Receive()
8756         methods.  Fixes bug 395168.
8758 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
8760         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
8762         Contributed under MIT/X11 license.
8764 2008-06-18  Martin Baulig  <martin@ximian.com>
8766         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
8767         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
8768         set to 80.0.  The debugger <-> runtime interface is now frozen as
8769         well.   
8771         * mono-debug.c
8772         (mono_debug_debugger_version): Bump to 4.
8774 2008-06-18  Martin Baulig  <martin@ximian.com>
8776         * debug-mono-symfile.c
8777         (load_symfile): Don't check the minor version.
8779         * debug-mono-symfile.h: Bump the version number to 50.0.
8781 2008-06-18  Martin Baulig  <martin@ximian.com>
8783         * debug-mono-symfile.c
8784         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
8785         minimum required version.
8787 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
8789         * reflection.c (mono_custom_attrs_from_property): Fix support for
8790         retriveving cattrs of dynamic inflated generic types.
8792         * reflection.c (mono_custom_attrs_from_event): Same.
8794         * reflection.c (mono_custom_attrs_from_field): Same;
8796         * reflection.c (typebuilder_setup_events): Same cattrs of events.
8798         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
8799         Moved to metadata.c.
8801         * metadata.c: New functions to retrive the equivalent field, event
8802         of property from the generic type definition.
8804         * metadata-internals.h: Added new functions from metadata.c.
8806 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
8808         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
8809         to cached in a mempool is used.
8811         * metadata.c (free_generic_class): In some situations field generic_info type
8812         is not properly dup'ed and leads to double free'ing.
8814         Fixes #400643.
8816 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8818         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
8819         this arguments (will be needed later for generic methods).
8820         Collect stats.
8822 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8824         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
8825         Create a static RGCTX invoke wrapper for methods which require it.
8827 2008-06-17  Mark Probst  <mark.probst@gmail.com>
8829         * object.c, class-internals.h: New function for checking whether
8830         an individual field is special static.
8832 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
8834         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
8835         linear search since the table is sorted.
8837         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
8838         Fixes #324180.
8840 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
8842         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
8843         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
8845         * gc.c (mono_domain_finalize): Allow an infinite timeout.
8847         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
8848         
8849         * threads.c (mono_thread_request_interruption): Get rid of locking, use
8850         InterlockedCompareExchange to query and modify 
8851         thread->interruption_requested.
8853         * object-internals.h (struct _MonoThread): Change interruption_requested
8854         to a gint32 so it can be modified by atomic operations. Add 
8855         'critical_region_level' from the managed side, change small_id to a guint32,
8856         add new set of 'unused' fields.
8858         * appdomain.c: Bump corlib version.
8860 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
8862         * class.c (mono_class_from_name): Search modules as well. Fixes
8863         #322332.
8865 2008-06-13  Mark Probst  <mark.probst@gmail.com>
8867         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
8868         templates.  Templates are generalized with an additional type_argc
8869         argument.  RGCTX templates have type_argc==0, MRGCTX templates
8870         have type_argc>0.
8872         * domain-internals.h, domain.c: New hash table for looking up
8873         MRGCTXs.
8875         * metadata.c, metadata-internals.h: Rename hash and equal
8876         functions for MonoGenericInst's and make them public.
8878         * class-internals.h: New data structures for the MRGCTX.  Macros
8879         for distinguishing slots in the RGCTX and the MRGCTX.
8881 2008-06-13  Mark Probst  <mark.probst@gmail.com>
8883         * object.c (mono_method_get_imt_slot): Put the same methods of
8884         different instantiations of the same generic interface in the same
8885         IMT slots, to make generic sharing simpler.
8887 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8889         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
8891         * metadata.c (mono_metadata_field_info_with_mempool): Added.
8892         This function works just like mono_metadata_field_info, but
8893         accept a mempool as argument to be used allocating memory.
8895         * marshal.c (mono_marshal_load_type_info): Use new function
8896         to load marshal data into image mempool.
8898 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8900         * class.c (mono_class_inflate_generic_type_with_mempool):
8901         This function allows to inflate a generic type using
8902         a mempool.
8904         * class.c (inflate_generic_type): Take a mempool as argument
8905         and use it to do type dup'ing.
8907         * class.c (mono_class_setup_fields): Field type for generic
8908         generic classes are allocated from the image mempool.
8910         * metadata.c (free_generic_class): Inflated field type is
8911         now allocated in the image mempool.
8913 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
8915         * threads.c (thread_cleanup): Free MonoThread::name.
8917 2008-06-12  Marek Habersack  <mhabersack@novell.com>
8919         * appdomain.c (ensure_directory_exists): avoid unnecessary
8920         mkdir(2) calls when the shadow directory already exists.
8921         (mono_make_shadow_copy): copy also satellite assemblies from the
8922         private bin directories.
8924 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
8926         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
8927         
8928         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
8929         a page boundary. Fixes #396219.
8931 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8933         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
8934         due to double-checked locking.
8936 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8938         * assembly.c (build_assembly_name): Release memory on failure.
8940         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
8942 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8944         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
8945         memory on failure.
8947 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8949         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
8950         memory on failure.
8952 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8954         * loader.c (field_from_memberref): Check if field signature type is equal
8955         to the non-inflated type of the field. Fixes #398980.
8957 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
8959         * assembly.c (mono_assembly_load_from_full): Call 
8960         mono_assembly_load_friends () outside the assemblies lock, since it can
8961         acquire the loader lock. Fixes #323696.
8963         * reflection.c (resolve_object): Inflate the inst with the context for
8964         FieldOnTypeBuilderInst. Fixes #399010.
8966 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8968         * reflection.c (mono_image_get_field_on_inst_token): Don't
8969         inflate the field to encode it's signature. If it's a
8970         VAR or MVAR it should stay that way in the signature.
8971         Fixes #399047.
8973 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8975         * reflection.c (resolve_object): Release memory of inflated types.
8977 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
8979         * loader.c (mono_method_get_signature_full): Remove assert about
8980         loading a methodspec to a generic method. We have such methods, such as
8981         System.Threading.Interlocked::CompareExchange<T>.
8982         This assert was removed since it crashes the verifier when it checks
8983         methods calling CompareExchange<T>.
8985 2008-06-10  Marek Safar  <marek.safar@gmail.com>
8987         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
8988         of Type array and not MonoType.
8990 2008-06-10  Marek Habersack  <mhabersack@novell.com>
8992         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
8993         <lupus@ximian.com>
8995 2008-06-10  Martin Baulig  <martin@ximian.com>
8997         * debug-mono-symfile.h
8998         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
8999         changes to the file format, but we were generating incorrect
9000         source file indices in the line number table due to a bug, which
9001         made backtraces report an incorrect source file.
9003 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9005         * mono-debug.c: Moved mono_debug_free_method_jit_info from
9006         mini/debug-mini.c to here.
9008         * mono-debug.c (il_offset_from_address): Free memory from find_method.
9010         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
9011         use it to release structs returned by mono_debug_find_method.
9013 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
9015         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
9016         since it needs to set method->slot for all interface methods.
9018 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9020         * class-internals.h: Forgot to add.
9022 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9024         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
9026         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
9027         Lookup the custom attributes from property_hash.
9029         * reflection.c (mono_save_custom_attrs): Save the custom attributes
9030         in property_hash. Allocate all data using the image mempool.
9032         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
9033         for dynamic_custom_attrs to checks if the image is dynamic.
9035 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
9037         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
9038         assemblies array.
9039         
9040         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
9041         runtime functions while holding the domain assemblies lock.
9043 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9045         * verify.c: Reapplied the last bit of the reverted changes.
9047 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9049         * verify.c: Reapplied more of the reverted changes.
9051 2008-06-09  Martin Baulig  <martin@ximian.com>
9053         * debug-mono-symfile.c (load_symfile): Check the major version
9054         first; if it's wrong, don't print the minor version in the error message.
9056 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
9058         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
9059         lock instead of the domain lock to avoid deadlocks, since the thread might
9060         already hold the loader lock.
9062         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
9063         (mono_thread_attach): Ditto.
9065         * monitor.c: Use a TLS variable for holding the current thread id instead
9066         of calling pthread_self ().
9067         (mono_monitor_init_tls): New internal function to initialize the TLS
9068         variable.
9069         (mono_monitor_try_enter_internal): Put the owner == id check after the
9070         owner == 0 check.
9072         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
9073         missed optimizations when using gcc-4.3.
9075 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
9077         * reflection.c (mono_dynamic_image_free): Free the memory
9078         used by MonoGenericParam in MonoDynamicImage::gen_param.
9080         * reflection.c (mono_reflection_setup_generic_class): Allocate
9081         container from mempool.
9083         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
9084         container from mempool.
9086 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
9088         * threads.c (mono_set_pending_exception): New internal function to set the
9089         pending exception of the current thread.
9090         (mono_thread_get_and_clear_pending_exception): Check for 
9091         thread->pending_exception as well.
9093         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
9095         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
9096         it can trigger a collection.
9098 2008-06-06  Martin Baulig  <martin@ximian.com>
9100         Merged the `debugger-kahalo' branch.
9102         * mono-debug.h
9103         (MONO_DEBUGGER_VERSION): Bumped to 72.
9105         * debug-mono-symfile.h
9106         (MonoSymbolFileMethodIndexEntry): Removed.
9107         (MonoSymbolFileMethodEntry): New public typedef.
9108         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
9109         (MonoSymbolFileSourceEntry): Remove everything except `index' and
9110         `data_offset'.
9111         (MonoSymbolFileMethodEntry): Removed.
9112         (MonoSymbolFileLexicalBlockEntry): Removed.
9113         (MonoSymbolFileLineNumberEntry): Removed.
9114         (MonoDebugLexicalBlockEntry): Removed.
9115         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
9116         removed `num_il_offsets' and `il_offsets'.
9117         (MonoSymbolFile): Replace `version' with `major_version' and
9118         `minor_version'.
9119         (MONO_SYMBOL_FILE_VERSION): Replace with
9120         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
9121         `MONO_SYMBOL_FILE_MINOR_VERSION'.
9123         * debug-mono-symfile.c
9124         (mono_debug_symfile_lookup_location): Add support for the new line
9125         number table format.
9127 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
9129         * metadata.c (free_generic_class): Release the inflated
9130         MonoClass of dynamic generic classes if it's not a generic
9131         type definition.
9133 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
9135         * verify.c: Reapplied more of the reverted changes.
9137 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
9139         * reflection.c (lookup_custom_attr): Clean the cached flag or
9140         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
9141         for SRE types.
9143 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
9145         * verify.c: Reapplied a small part of the reverted changes.
9147 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
9149         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
9151         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
9152         previously in managed code.
9153         (mono_monitor_exit): Ditto.
9154         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
9156         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
9157         the managed definition.
9159 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
9161         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
9163 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
9165         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
9166         
9167         * monitor.c: Add some micro optimizations.
9169         * icall.c (type_from_typename): Handle 'bool'.
9171 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
9173         * verify.c: Implement constructor verification per P III 1.8.1.4.
9174         Fixes #396716.
9176 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
9178         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
9179         holding the assemblies lock here too.
9181 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
9183         * verify.c: Kill stack_top function.
9185 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
9187         * verify.c: Kill stack_get function.
9189 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
9191         * verify.c (mono_method_verify): Last change broke the build. Fixed.
9193 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
9195         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
9196         more reliable.
9198         * verify.c (mono_method_verify): Inflate params and locals to avoid
9199         mismatch when checking for compatibility.
9201 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
9203         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
9204         Length prefix should be size in bytes. Fix bug #339530.
9205         
9206         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
9207         Length prefix should be size in bytes. Fix bug #339530.
9209         Code is contributed under MIT/X11 license.
9211 2008-06-05  Bill Holmes <billholmes54@gmail.com>
9213         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
9215         Contributed under MIT/X11 license.
9217 2008-06-05  Martin Baulig  <martin@ximian.com>
9219         * mono-debug-debugger.c
9220         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
9222 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
9224         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
9225         while holding the assemblies lock to prevent deadlocks. Handle the case
9226         where the search hook returns NULL but the assembly was still loaded.
9227         Fixes #323696.
9229         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
9230         modify domain state.
9232 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
9234         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
9235         * Makefile.am (pedump_LDADD): Post-process object files and
9236         add dtrace-generated object file, if necessary.
9238         Code is contributed under MIT/X11 license.
9240 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
9242         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
9244 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
9246         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
9248 2008-06-04  Mark Probst  <mark.probst@gmail.com>
9250         * threads.c: Try to free everything from the delayed free table
9251         when shutting down threads, and set the variable to NULL after the
9252         table is freed so that calling
9253         mono_thread_hazardous_try_free_all() when shutting down the root
9254         domain doesn't crash.
9256 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
9258         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
9259         the caller if resulting type was inflated.
9261         * class.c (mono_class_create_from_typespec): Free the MonoType if it
9262         was inflated.
9264         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
9267 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
9269         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
9270         class library tests.
9272         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
9273         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
9274         #396989.
9276 2008-06-04  Mark Probst  <mark.probst@gmail.com>
9278         * domain.c, domain-internals.h: The JIT infos are now freed by the
9279         JIT info table code.  They are freed immediately if there only a
9280         single JIT info table in circulation.  If there is more, the free
9281         is delayed via a queue.
9283         * threads.c, threads-types.h: New hazard pointer function for
9284         freeing all freeable delayed items in one sitting.
9286 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
9288         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
9290         * reflection.c (typebuilder_setup_properties): Same.
9292         * reflection.c (typebuilder_setup_events): Same.
9294 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
9296         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
9297         and use it for allocating memory.
9299         * reflection.c (mono_marshal_spec_from_builder): Same.
9301         * reflection.c: Change code to use new signatures.
9303         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
9305 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
9307         * decimal.c (rescale128): Put back one line which was accidently commented
9308         out.
9309         
9310         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
9311         to cause crashes.
9313 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
9315         * reflection.c (mono_reflection_generic_class_initialize): Name must
9316         be always malloc'ed so we can free it later on. Do this for field, property
9317         and event.
9319         * metadata.c (free_generic_class): Free field, property and event names.
9321 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
9323         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
9324         instead of g_memdup.
9326         * reflection.c (typebuilder_setup_fields): Same.
9328 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
9330         * decimal.c (rescale128): Optimize this function a bit more.
9332 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
9334         * metadata.c (free_generic_class): Release some memory from
9335         SRE generic classes.
9337 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
9339         * reflection.c (mono_image_get_generic_field_token): No reference
9340         to name is kept, free it.
9342         * reflection.c (mono_reflection_generic_class_initialize): Free
9343         more memory of the inflated field.
9345 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
9347         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
9348         code.
9350 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
9352         * reflection.c (mono_dynamic_image_free): Release memory used by
9353         MonoDynamicImage::array_methods elements.
9355         * reflection.c (assembly_add_win32_resources): Release memory after
9356         encoding.
9358 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
9360         * decimal.c (log2_32): Use an optimized version for this function too.
9361         
9362         * decimal.c (log2_64): Fix this on 32 bit machines.
9364 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
9366         * class.c (mono_dup_array_type): Implement allocation using a mempool.
9368         * class.c (mono_metadata_signature_deep_dup): Same.
9370         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
9371         a mempool.
9373         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
9375         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
9377         * metadata-internals.h: Added mono_metadata_signature_dup_full.
9379         * class-internals.h: Update signatures to take a MonoMemPool.
9381 2008-06-02  Dick Porter  <dick@ximian.com>
9383         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
9384         * icall-def.h: Add
9385         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
9386         FormatMessage API to get the error text.  Fixes bug 321827.
9388 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
9390         * decimal.c: Add some micro optimizations to make decimal operations faster.
9392 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
9394         * reflection.c (method_encode_clauses): Take a mempool
9395         as parameter and use it to allocate the clause array.
9397         * reflection.c (mono_image_get_field_on_inst_token): Free
9398         the inflated type after encoding it.
9400         * reflection.c (mono_dynamic_image_free): Free each element
9401         of MonoDynamicImage::gen_params.
9403         * reflection.c (reflection_methodbuilder_to_mono_method):
9404         Allocate the generic param array from the mempool.
9405         Allocate signature params from the mempool.
9407         * reflection.c (mono_reflection_generic_class_initialize):
9408         Free inflated fields after been used.
9410 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
9412         * icall.c: Reapply the memory leak fixes as they no
9413         longer make mono crash.
9415 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
9417         * reflection.c (mono_type_get_object): Don't store the suplied
9418         MonoType with type_hash. A caller which pass a type that
9419         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
9420         might end with a pointer to freed memory.
9421         The solution is to use byval_arg or this_arg from the associated
9422         MonoClass of the supplied type.
9424 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
9426         * icall.c: Revert the rest of the last change as it breaks the build too.
9428 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9430         * icall.c: Revert a leak fix as it's breaking the build.
9432 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9434         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
9436 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9438         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
9440 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
9442         * icall.c: Fix some memory leaks.
9444 2008-05-29  Dick Porter  <dick@ximian.com>
9446         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
9447         async socket operations from the pending list when a socket
9448         closes.  Leaving it until the threadpool services the event
9449         exposes a race condition when a socket descriptor is reused.
9450         Fixes bug 377589.
9452 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9454         * object.c: Fix negative index check for array alocation.
9456 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9458         * icall.c, marshal.c: Delegate wrappers should skip visibility.
9459         This check is performed by the verifier for IL created delegates
9460         and by Delegate::CreateDelegate for programatically created ones.
9461         Fixes #372406.
9463 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9465         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
9466         Fix code to use mono_array_size_t instead of int.
9468         Based on patch by Luis F. Ortiz.
9469         Contributed under X11 license.
9470         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9472 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9474         * icall.c: Added ves_icall_System_Array_GetLongLength and
9475         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
9476         arrays.
9478         * icall.h: Export both new functions.
9480         Based on patch by Luis F. Ortiz.
9481         Contributed under X11 license.
9482         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9484 2008-05-28  Martin Baulig  <martin@ximian.com>
9486         The debugger now requires exactly r103463.
9488         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
9489         This version is not supported by the debugger, wait for 72.
9491 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9493         * object.h: Changed array related functions to use
9494         mono_array_size_t instead of guint32. Forgot to commit this file.
9496         Patch by Luis F. Ortiz.
9497         Contributed under X11 license.
9498         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9501 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
9503         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
9504         don't define it. Use the number literal instead.
9506 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9508         * icall.c: Changed array related functions to use
9509         mono_array_size_t instead of guint32.
9511         * icall.c (ves_icall_System_Array_GetLength): Check for length
9512         overflow under MONO_BIG_ARRAYS.
9514         Based on patch by Luis F. Ortiz.
9515         Contributed under X11 license.
9516         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9518 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9520         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
9522         Based on patch by Luis F. Ortiz.
9523         Contributed under X11 license.
9524         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9526 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9528         * object.c, object.h: Changed array related functions to use
9529         mono_array_size_t instead of guint32.
9531         Patch by Luis F. Ortiz.
9532         Contributed under X11 license.
9533         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9535 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
9537         * object.h: Introduced mono_array_size_t typedef. This must be used
9538         in all places an array length is expected. This is 64bits wide if
9539         MONO_BIG_ARRAYS is enabled.
9541         Patch by Luis F. Ortiz.
9542         Contributed under X11 license.
9543         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
9545 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
9547         * security-manager.c class.c: Set the class exception info by calling
9548         mono_class_set_failure ().
9550         * class.c (mono_class_get_exception_data): New accessor function.
9551         (mono_class_set_failure): Store exception_data in the property hash.
9553         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
9554         the struct as a property.
9556         * loader.c (mono_get_method_full): Store the lookup result for method
9557         tokens in method_cache, the others in methodref_cache to decrease the memory
9558         usage of hash tables.
9560         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
9561         (mono_image_init): method_cache is lazy inited now.
9563         * metadata-internals.h (struct _MonoImage): Change method_cache to
9564         a MonoValueHashTable, add a separate methodref_cache.
9566 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
9568         * number-formatter.h: Fix tables to avoid arithemtic overflow in
9569           Double.ToString as exposed by Bug #383531.
9571 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
9573         * number-formatter.h: Make some tables static.
9575         * class.c (mono_method_set_generic_container): New accessor function.
9576         (mono_method_get_generic_container): Ditto.
9578         * class-internals.h (struct _MonoMethod): Remove rarely used 
9579         'generic_container' field, store it in the property hash instead. Add 
9580         'is_generic' boolean field instead.
9582         * image.c (mono_image_init): Initialize property_hash.
9583         (mono_image_close): Destroy property_hash.
9585         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
9586         hold rarely used fields of runtime structures belonging to this image.
9588         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
9589         to get/set method->generic_container.
9591         * loader.c (mono_get_method_from_token): Avoid loading the method header for
9592         generic methods.
9594 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
9596         * class.c (mono_class_inflate_generic_method_full): Don't increase
9597         mono_stats.inflated_method_count for methods found in the cache.
9599         * threads.c (mono_thread_request_interruption): Add a comment about 
9600         QueueUserAPC ().
9602 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
9604         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
9605         interface_offsets_packed table.
9606         
9607         * class.c (mono_class_init): Remove some dead code.
9609         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
9610         mono_class_setup_vtable () when CAS is active to detect security problems.
9612 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
9614         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
9616         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
9617         parameters as it's irrelevant for delegate checking.
9619 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
9621         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
9623         * class.c (mono_class_init): Control the creation of a generic vtable using
9624         a global which is true by default, but set to false by the runtime startup code.
9625         
9626         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
9627         Disabled for now since it breaks the embedding API.
9628         Move the setup of class->methods for arrays to mono_class_setup_methods ().
9629         (mono_class_setup_methods): Add a memory barrier.
9631         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
9632         when mono_class_init () doesn't compute the generic vtable.
9633         
9634 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
9635         * profiler.c: Added mono_profiler_install_statistical_call_chain,
9636         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
9637         to support call chains (backtrace) in the stat profiler.
9638         * profiler.c, profiler-private.h: Likewise.
9640 2008-05-22  Mark Probst  <mark.probst@gmail.com>
9642         * generic-sharing.c: Init generic class when a method of it is
9643         requested via a runtime generic context.
9645 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
9647         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
9649         * reflection.c (mono_type_get_object): Add a FIXME.
9651         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
9653         * class.c (mono_class_get_method_by_index): New helper function, returning an
9654         entry in the class->methods array.
9656 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
9658         * class.c (mono_class_init): Only do the array optimization for szarrays. 
9659         Avoid creating a generic vtable for generic instances as well.
9660         (mono_class_get_method_from_name_flags): Don't search in the metadata for
9661         generic instances.
9663 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
9665         * loader.c (mono_get_method_constrained): Inflate the signature
9666         with class context. Fix #325283.
9668 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
9670         * object.c (mono_class_create_runtime_vtable): Add a comment.
9672         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
9673         where needed.
9674         (setup_interface_offsets): Handle the case when this is called twice for arrays.
9675         (mono_class_setup_vtable_general): Add an assert.
9676         (mono_class_init): Avoid creating a generic vtable for arrays.
9678         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
9679         here, let mono_class_init () do that.
9681         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
9682         interfaces in mscorlib.
9684         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
9685         interfaces. Add some comments.
9686         (mono_class_init): Call mono_class_setup_methods () here since it is no
9687         longer called by mono_class_setup_vtable ().
9689         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
9690         not set in class->vtable.
9691         (mono_class_create_runtime_vtable): Reenable the disabled code.
9693         * object.c (mono_class_create_runtime_vtable): Disable the last change for
9694         now as it causes some test failures.
9696         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
9697         if using the vtable trampoline. Also remove some strange code which put the
9698         generic methods themselves into the vtable slots. Remove the AOT init_vtable
9699         stuff as it is no longer needed.
9701 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
9703         * pedump.c: Give make --verify all option check code as well.
9704         Using --verify code won't check for metadata now.
9706 2008-05-19  Martin Baulig  <martin@ximian.com>
9708         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
9710         * mono-debug.c
9711         (_mono_debug_using_mono_debugger): New global variable; it's set
9712         directly by the debugger, so mono_debug_using_mono_debugger() also
9713         works after attaching.
9715 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
9717         * object.c (mono_class_create_runtime_vtable): Use memory barriers
9718         as we do double checked locking on MonoClass::runtime_info and
9719         MonoClassRuntimeInfo::domain_vtables.
9721 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
9723         * debug-helpers.c (print_field_value): Fix a warning.
9725 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
9727         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
9728         set in the AOT case.
9730 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
9732         * class.c (mono_class_setup_vtable_general): Use memory barriers
9733         as we do double checked locking on MonoClass::vtable.
9735 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
9737         * reflection.c (resolve_object): Inflate only if the generic context
9738         is not null. Fixes #389886.
9740 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
9742         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
9743         instead of g_free.
9745         Code is contributed under MIT/X11 license.
9747 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9749         * class.c: Revert unrelated change.
9751 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9753         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
9754         a generic instantiation, use mono_class_from_mono_type instead of playing
9755         with MonoType directly.
9757 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
9759         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
9760         checks must ignore generic instantiations, so mono_class_has_parent is not
9761         suitable. Fixes #390128.
9763 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
9765         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
9766         it to avoid registering tokens during metadata generation. Fixes #390023.
9768 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
9770         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
9771         consistent.
9773         Contributed under MIT/X11 license.
9775 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
9777         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
9778         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
9779         to fixup the EXE image.
9780         (mono_cleanup): Use mono_close_exe_image.
9781         (mono_close_exe_image): New function.
9782         * image.c: Include "marshal.h".
9783         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
9784         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
9785         counting when the image is loaded outside of mono_image_open_full. Set status
9786         based on GetLastError.
9787         * coree.c: Include required headers. Add init_from_coree.
9788         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
9789         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
9790         (_CorExeMain): Set init_from_coree.
9791         (CorExitProcess): Only call ExitProcess for now.
9792         (CorBindToRuntimeEx): New stub implementation.
9793         (CorBindToRuntime): New function.
9794         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
9795         (MonoFixupExe): ILONLY executables require no fixups.
9796         (mono_set_act_ctx): New function to set activation context.
9797         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
9798         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
9799         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
9800         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
9801         as MONO_INTERNAL.
9802         * domain-internals.h: Add mono_close_exe_image.
9804         Contributed under MIT/X11 license.
9806 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
9808         * metadata.c (mono_metadata_compute_size): Correctly calculate field
9809         size for generic param and event tables. Fixes #388977.
9811 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
9813         * loader.c (mono_method_signature): Use memory barriers because of the double
9814         checked locking pattern.
9816         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
9817         aborting or aborted as well. Fixes #376391.
9818         
9819         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
9820         existing runtime state in the Suspend handler during shutdown.
9822 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
9824         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
9826         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
9827         which are starting up or shutting down.
9829         * threads.c (mono_threads_set_shutting_down): Don't return a value since
9830         this function never returns if the runtime is already shutting down.
9832         * icall.c (ves_icall_System_Environment_Exit): Update after 
9833         mono_threads_set_shutting_down () signature change.
9834         
9835 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
9837         * class.c: Added can_access_instantiation to verify if the instantiation
9838         is visible. Fix access check for nested types as they returned TRUE
9839         before doing type and generic instantiation visibility checks.
9841 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
9843         * reflection.c (mono_reflection_create_generic_class): The created type
9844         must have a different container from its TypeBuilder. Otherwise they
9845         will end sharing generic arguments, which is wrong.
9847         Due to the sharing, making a generic instance of the created type using
9848         the TypeBuider generic arguments resulted in the generic type definition
9849         been returned, which is wrong as well.
9851         As a bonus the code was leaking the type_params array. This memory should
9852         be allocated from the image mempool.
9854         This fixes bug #354047.
9856 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
9858         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
9859         to here         as they are now used in assembly.c new code.
9860         Added a skipverification flag to MonoAssembly.
9861         New internal function mono_assembly_has_skip_verification.
9863         * assembly.c: New function mono_assembly_has_skip_verification. It checks
9864         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
9865         part of #387274.
9867 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
9869         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
9870         needed. Fixes #387034.
9872         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
9874 2008-05-06  Miguel de Icaza  <miguel@novell.com>
9876         * assembly.c (mono_assembly_load_reference): Prevent crash while
9877         disassembling Silverlight 2.0 executables while we still do not
9878         have GACed libraries.
9880 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
9882         * reflection.c: Special case generic type definitions as well. Fixes #383444.
9884 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
9886         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
9887         of the dynamic case. Fixes #387404.
9889 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9891         *verify.c (mono_verifier_is_class_full_trust): If under
9892         verify_all and the verifier mode was not set, only
9893         gac and corlib types are fulltrust. This makes --verify-all
9894         usable to detect unverifiable code, which is the expected
9895         use case.
9897 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9899         * verify.h: Ops, commited the header with debug
9900         enabled.
9902 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
9904         * verify.c (merge_stack): Use the new value on unverifiable
9905         stack merges.
9907         * verify.c (verify_type_compatibility_full): Comparison
9908         of nullable types can't use mono_class_is_assignable_from.
9910         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
9911         that makes all verification errors be reported.
9913         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
9914         mono_method_verify.
9916 2008-05-05  Robert Jordan  <robertj@gmx.net>
9918         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
9919         support for value types. See #386415.
9921         * object.c: comments.
9923         Code is contributed under MIT/X11 license.
9925 2008-05-05  Martin Baulig  <martin@ximian.com>
9927         * debug-mono-symfile.h
9928         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
9929         for old pre-terrania symbol files.
9931 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
9933         * mono-config.c: Add ppc64 architecture.
9935         Code is contributed under MIT/X11 license.
9937 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
9939         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
9940           PPC64 uses function descriptors as well.
9942         Code is contributed under MIT/X11 license.
9944 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
9946         * object.c (compute_class_bitmap): Ignore literal static fields.
9948         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
9949         var has an invalid format.
9950         (describe_ptr): Add some sanity checks for the vtable.
9951         (add_nursery_frag): Clear unused nursery fragments.
9952         (major_collection): Clear all remaining nursery fragments.
9954 2008-05-03  Robert Jordan  <robertj@gmx.net>
9956         * image.c, metadata-internals.h: add thunk_invoke_cache.
9958         * marshal.c, marshal.h: implement
9959         mono_marshal_get_thunk_invoke_wrapper ().
9961         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
9963         Code is contributed under MIT/X11 license.
9965 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
9967         * verify.c (do_leave): Empty the stack.
9969 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
9971         * class.c (mono_class_is_assignable_from): Variance
9972         doesn't work between reference and value types. For example,
9973         given type C<T+>, C<int32> is not assignable to C<object>.
9974         Break the argument checking loop on first error. 
9976 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
9978         * icall.c : base64_to_byte_array() needs some more strict
9979           check for sequence of '=' characters. Patch by Santa
9980           Marta (http://deee.g.hatena.ne.jp/santamarta).
9982           Contributed under MIT/X11 license.
9983           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
9985 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
9987         * domain.c: Disable LoadLibrary support to fix Win32 build.
9989         Code is contributed under MIT/X11 license.
9991 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
9993         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
9994         to help with cache behaviour.
9996 2008-05-01  Miguel de Icaza  <miguel@novell.com>
9998         * appdomain.c (mono_domain_from_appdomain): Add new accessor
9999         method. 
10001 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
10003         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
10005 2008-05-01  Dick Porter  <dick@ximian.com>
10007         * process.c (process_get_fileversion): Only pass 16 bits of
10008         language ID to VerLanguageName.  Fixes bug 381204.
10010 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
10012         * verify.c (mono_method_verify): Fix the comparison
10013         operator for code bounds check.
10015 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
10017         * verify.c (mono_method_verify): Check the bounds of
10018         all access of the code array.
10020 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
10022         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
10024 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
10026         * image.c (mono_image_strong_name_position): Fix return value when the rva is
10027         not valid.
10029 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
10031         * loader.c (mono_get_method_from_token, mono_method_signature): Add
10032         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
10033         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
10034         fixup main EXE images when using mono.exe for mixed-mode assembly support.
10035         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
10036         mono_runtime_load.
10037         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
10038         runtime initialization from metadata.
10039         * assembly.c: Remove obsolete ceGetModuleFileNameA.
10040         (mono_set_rootdir): Use mono_get_module_file_name.
10041         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
10042         handles.
10043         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
10044         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
10045         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
10046         MonoCLIImageInfo. Add support for module handles.
10047         (load_cli_header): Update mono_cli_rva_image_map signature.
10048         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
10049         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
10050         (mono_image_rva_map): Add support for module handles.
10051         (mono_image_ensure_section_idx): Add support for module handles.
10052         (mono_image_close): Add support for module handles.
10053         (do_load_header): Add support for module handles.
10054         (mono_image_open_from_module_handle): New function for internal use.
10055         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
10056         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
10057         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
10058         handles.
10059         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
10060         * image.h: Add mono_image_fixup_vtable.
10061         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
10062         support.
10063         * coree.h: New file.
10064         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
10065         unsupported native code.
10066         (mono_marshal_set_callconv_from_modopt): New function splitted from
10067         mono_marshal_get_managed_wrapper.
10068         (mono_marshal_get_managed_wrapper): Use
10069         mono_marshal_set_callconv_from_modopt.
10070         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
10071         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
10072         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
10073         that results in a deadlock when the runtime is loaded in _CorDllMain.
10074         * Makefile.am: Add coree.c and coree.h.
10076         Contributed under MIT/X11 license.
10078 2008-04-28  Mark Probst  <mark.probst@gmail.com>
10080         * generic-sharing.c: Search for type arguments in array element
10081         types as well.
10083 2008-04-28  Mark Probst  <mark.probst@gmail.com>
10085         * class-internals.h, generic-sharing.c: New, small runtime generic context.
10087         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
10089         * object.c: Don't setup the RGCTX when the vtable is created,
10090         because we're setting it up lazily now.
10092 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
10094         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
10095         64 bit support.
10097 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
10099         * verify.c (verify_class_for_overlapping_reference_fields): 
10100         If class is under fulltrust allow reference types to overllap
10101         if they have the same RVA.
10103 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
10105         * pedump.c: Added new flag valid-only, that makes the verifier
10106         behaves just like --security=validil. It won't fail type load
10107         due to unverifiable restrictions.
10109 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
10111         * class-internals.h (struct MonoMethod): Added a verification_success
10112         field to cache verifier executions. Reduced MonoMethod:slot size by
10113         one bit.
10115 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
10117         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
10118         instead of a 'vt' argument to save an indirection and to allow these to be used
10119         for valuetypes.
10120         (scan_vtype): New helper function to scan an area using a gc descriptor.
10121         (mono_gc_wbarrier_value_copy): Implement this.
10122         (handle_remset): Add support for REMSET_VTYPE.
10123         (find_in_remset_loc): Ditto.
10124         (mono_gc_base_init): Allow some debugging options to be controlled through the
10125         use of the MONO_GC_DEBUG env variable.
10126         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
10127         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
10129 2008-04-23  Martin Baulig  <martin@ximian.com>
10131         * domain.c (mono_domain_create): Move the call to
10132         mono_debug_domain_create() down, after allocating the domain id.
10134 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
10136         verify.c (verify_class_for_overlapping_reference_fields): Skip
10137         static fields while verifying for overlapping fields as they
10138         don't matter at all.
10140 2008-04-23  Marek Habersack  <mhabersack@novell.com>
10142         * domain-internals.h: added a declaration of
10143         mono_make_shadow_copy.
10145         * assembly.c (mono_assembly_open_full): shadow copying of
10146         assemblies moved to here, so that all the assemblies within the
10147         application domain's private binary directories can be
10148         processed. Fixes bug #380546
10150         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
10151         mono_make_shadow_copy and made non-static. The decision whether
10152         to shadow-copy an assembly is made based on its location - it's
10153         copied if it's in one of the private application domain binary
10154         directories and its different to the target file in the shadow
10155         directory. Fixes bug #380546
10157 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
10159         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
10161         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
10162         types.
10164         * reflection.c (mono_image_create_token): Handle 
10165         Method/ConstructorOnTypeBuilderInst.
10166         (resolve_object): Ditto.
10167         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
10168         so it can be called from resolve_object. Also handle the case when the inflated
10169         class already has its methods setup.
10171 2008-04-21  Martin Baulig  <martin@ximian.com>
10173         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
10175 2008-04-20  Geoff Norton  <gnorton@novell.com>
10177         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
10178         pointer dereference.
10180 2008-04-15  Marek Habersack  <mhabersack@novell.com>
10182         * appdomain.c (try_load_from): if IOMAP is in effect, call the
10183         portability API to look up the assembly file. Fixes behavior in
10184         situations when the application has a bin/ directory, but the
10185         assembly search patch refers to Bin/ (and thus the requested file
10186         name is Bin/SomeLibrary.dll). Fixes bug #379888
10188 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
10190         verify.c (mono_type_is_generic_argument): Extracted this check
10191         from a dozen places to here.
10193         verify.c: Fixed all issues related to boxing generic arguments
10194         and their constraints.
10196 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
10198         verify.c (mono_class_interface_implements_interface): Fix win32 build.
10200 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
10202         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
10203         isn't finished yet. Fixes #363447.
10205 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
10207         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
10208         Fixes #346419.
10210 2008-04-13  Jb Evain  <jbevain@novell.com>
10212         * domain.c: update the 2.1 profile versions.
10213         Merged from the Moonlight 2 branch.
10215 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
10217         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
10218         mscorlibs for the non-refonly case as well.
10220         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
10221         in mono_assembly_load_from_full (). Fixes #378924.
10223 2008-04-11  Geoff Norton  <gnorton@novell.com>
10225         * icall.c: The global extern environ doesn't exist on Mac.  We
10226         need to call NSGetEnviron instead.
10228 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
10230         verify.c: Add generic method constraint verification.
10232 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
10234         class.c (mono_class_inflate_generic_method_full): Add a long
10235         explanation to the is_mb_open hack. Remove the FIXME.
10237 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
10239         * verify.c (mono_method_verify): Mark all unknown opcodes
10240         as invalid. Mark jmp as unverifiable.
10242 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
10244         * verify.c: Add code to do type constraint verification on class instances.
10246         * verify.c (mono_verifier_verify_class): Use the type constraint 
10247         verification code.
10249 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
10251         * class.c (mono_class_get_field_default_value): Don't pass cindex
10252         as hint to mono_metadata_get_constant_index. The local is not initialized
10253         and should contain garbage most of the time. This could only work
10254         with a lot of luck.
10256 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
10258         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
10260 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
10262         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
10264         * class.c (mono_class_from_generic_parameter): Save the token of the
10265         generic param in MonoClass::sizes.generic_param_token.
10267         * reflection.c (mono_custom_attrs_from_class): If the class type is
10268         VAR or MVAR retrieve the attributes of the generic param.
10270 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
10272         * class.c (mono_class_init): Do class verification if the verifier
10273         is enabled.
10275 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
10277         * verify-internal.h: Added mono_verifier_verify_class.
10279         * verify.c: Added mono_verifier_verify_class. It checks for
10280         classes with explicit layout that have overlapping reference fields.
10282         * pedump.c: Init the verifier state prior to verification. Fixed
10283         command line arguments.
10285 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
10287         * Makefile.am: Added verify-internals.h, hopefully fix the build.
10289 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
10291         * verify-internals.h: Fix a warning.
10293 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
10295         * verify-internals.h: New header with the verifier configuration
10296         extracted from mini.c.
10298         * verify.c: Implemented the new functions exported by verify-internals.h.
10300 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
10302         * verify.c: Add proper verification of ckfinite.
10304 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
10306         * verify.c (do_conversion): Improved error message to something
10307         more meanfull.
10309         * verify.c (check_is_valid_type_for_field_ops): Fix to work
10310         with primitive types.
10312 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
10314         * verify.c: Added tail prefix checking. Marked icall
10315         as unverifible.
10317 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
10319         * verify.c: Fix the detection of branches to the middle
10320         of an instruction.
10322 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
10324         * verify.c: Implemented verification of volatile. and
10325         unaligned. prefix. Check if a type is valid after retrieving it.
10327 2008-04-01  Dick Porter  <dick@ximian.com>
10329         * process.c (process_get_fileversion): If there's no string block,
10330         set the file language to en_US.  Fixes the other new part of bug
10331         374600.
10333 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
10335         * class.c: New functions mono_method_can_access_field_full and
10336         mono_method_can_access_method_full. They perform type visibility
10337         and type site check.
10339         * class-internal.h: Added exported functions.
10341         * verify.c: Use new functions to implement proper visibility checks.
10343 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
10345         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
10347 2008-03-28  Dick Porter  <dick@ximian.com>
10349         * process.c (process_get_fileversion): Use the first language ID
10350         we see, rather than insisting on an invariant language.  Fixes bug
10351         374600.
10353 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
10355         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
10356         the streams to fix reading of invalid memory later.
10358         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
10359         to ease debugging.
10361 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
10363         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
10364         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
10366 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
10367         * threads.h: Added MonoThreadManageCallback type and
10368         mono_thread_set_manage_callback prototype
10369         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
10370         (used to store the mono_thread_manage callback).
10371         * threads.c: Added mono_thread_set_manage_callback, and handle
10372         "MonoThread->manage_callback" in build_wait_tids.
10374 2008-03-26  Dick Porter  <dick@ximian.com>
10376         * process.c (process_get_fileversion): Set FileVersionInfo strings
10377         to Empty when the resource doesn't have the particular info.
10378         Fixes bug 355717.
10380 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
10382         * verify.c (mono_method_verify): Proper prefix validation.
10384 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
10386         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
10387         itself in a separate argument instead of throwing them. Fixes #373448.
10389         * appdomain.c: Bump corlib version.
10391 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
10393         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
10395 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
10397         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
10398         version macros.
10400 2008-03-20  Mark Probst  <mark.probst@gmail.com>
10402         * generic-sharing.c, class-internals.h: Code for putting
10403         reflection types into the runtime generic context.
10405 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
10407         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
10408         Fixes #340662. 
10411 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
10413         * verify.c (VerifyContext): Added instruction prefix data to the struct.
10415         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
10417         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
10419         * verify.c (do_cast): Let the result value keep the boxed status.
10421         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
10423 2008-03-17  Jb Evain  <jbevain@novell.com>
10425         * reflection.c: when running on a 2.0 runtime, emit
10426         unconditionally the #~ header version as 2.0, and the
10427         CLI header version as 2.5, for symmetry's sake with csc.
10429 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
10431         * class.c: Remove the unused cache_interface_offsets stuff.
10433         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
10434         profiler.c: Fix warnings.
10436 2008-03-16  Mark Probst  <mark.probst@gmail.com>
10438         * generic-sharing.c, class-internals.h: Support for putting
10439         methods into the runtime generic context.
10441 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
10443         * class.c (mono_class_setup_fields): Ignore calls made to this function for
10444         classes which are generic instances of not-yet finished typebuilders. Fixes
10445         #351172.
10447         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
10449 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
10451         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
10453         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
10454         field, replace it with a hash table in MonoDynamicImage.
10456         * reflection.c (inflate_mono_method): Access the generic definition object from
10457         image->generic_def_objects instead of imethod->reflection_info.
10459         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
10461         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
10462         
10463         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
10464         function in reflection.c so it is easier to keep in sync with the dynamic image
10465         creation code.
10467         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
10468         mono_image_close ().
10470 2008-03-15  Mark Probst  <mark.probst@gmail.com>
10472         * class.c (mono_class_generic_sharing_enabled): Disable generic
10473         sharing for all architectures except AMD64 and x86 to fix build.
10475 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
10477         * verify.c: Use the generic definition MonoGenericContext when available.
10478         Remove code for checking generics instance compatibility in favor of
10479         mono_class_is_assignable_from.
10481 2008-03-14  Mark Probst  <mark.probst@gmail.com>
10483         * marshal.c, marshal.h, metadata-internals.h, image.c,
10484         wrapper-types.h: New wrapper for invoking a shared static method
10485         without having to pass the runtime generic context argument.
10487 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
10489         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
10491 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
10493         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
10494         
10495         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
10496         create a token from a FieldOnTypeBuilderInst.
10497         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
10498         (resolve_object): Ditto.
10500         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
10501         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
10503 2008-03-14  Martin Baulig  <martin@ximian.com>
10505         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
10507         * debug-mono-symfile.h
10508         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
10509         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
10511 2008-03-10  Martin Baulig  <martin@ximian.com>
10513         * debug-mono-symfile.h
10514         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
10515         `lexical_block_table_offset'.
10516         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
10517         `lexical_blocks'.
10518         (MonoSymbolFile): Added `version'.
10520         * mono-debug.h
10521         (MonoDebugLexicalBlockEntry): Removed.
10522         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
10523         `lexical_blocks'.
10525         * mono-debug.c (mono_debug_add_method): Don't compute lexical
10526         blocks here; the debugger now does this internally.
10528 2008-02-27  Martin Baulig  <martin@ximian.com>
10530         * object.c (mono_runtime_exec_main): Call
10531         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
10532         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
10534 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
10536         * verify.c (verify_type_compatibility_full): Allow native int to be converted
10537         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
10539 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
10541         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
10542         ldftn with a virtual method.
10544 2008-03-13  Geoff Norton  <gnorton@novell.com>
10546         * decimal.c:  Only include memory.h if the platform has it.
10548 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
10550         * assembly.c, class.c, metadata-internals.h: make sure public key
10551         tokesns are compared in a case-insensitive way. Also, all
10552         the lookups in the GAC use a lowercase public key token
10553         (gaacutil already does the lowercasing on install). Fixes
10554         bug #369541.
10556 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
10558         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
10559         and return value.
10561 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
10563         * image.c: when someone loads a mscorlib from a file, return the
10564         currently loaded mscorlib (fixes bug #369253).
10566 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
10568         * class.c: handle types with no parents by forcing them to have
10569         System.Object as a parent and marking them as broken (this currently
10570         allows the first part of bug #369173 to work as well, likely because
10571         we don't check for typeload exceptions everywhere yet).
10573 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
10575         * class.c: more complete check that types belong to corlib
10576         (fixes second part of bug #369173).
10578 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
10580         * generic-sharing.c:  Including glib.h for the MSVC builds to define
10581           "inline" to "__inline" before including mono-membar.h.
10582           
10583         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
10584           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
10585           MSVC builds.
10587         Contributed under MIT/X11 license.
10589 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
10591         * verify.c (do_invoke_method): Remove return type validation.
10593         * verify.c (do_ret): Do return type validation at return site instead of
10594         call site.
10596 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
10598         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
10600         * verify.c: Some todos cleaned and improved a few error messages.
10602 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
10604         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
10606 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
10608         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
10609         system types correctly.
10611         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
10612         function.
10614 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
10616         * assembly.c (build_assembly_name): Fix a warning.
10618 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
10620         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
10621         the called function takes an object type argument. Fixes storing or
10622         valuetypes across remoting as well as reducing memory usage.
10623         * image.c, metadata-internals.h: remove now unused ldfld_remote and
10624         stfld_remote wrapper caches.
10626 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
10628         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
10629         is not found.
10631         * reflection.c (mono_image_register_token): New helper function to save
10632         a token->object mapping.        
10634         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
10635         managed code.
10637         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
10638         one dimension arrays. Fixes #367670.
10639         (mono_reflection_get_type_internal): Ditto.
10641 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
10643         * marshal.c: mono_load_remote_field_new() always returns object.
10644         so use the proper signature (fixes bug #366445).
10646 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
10647         
10648         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
10649         add an 'inline_failure' flag instead.
10651 2008-03-04  Mark Probst  <mark.probst@gmail.com>
10653         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
10654         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
10655         contains the location of "this", used for exception handling.
10657 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
10659         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
10660         their size on all platforms for perf reasons.
10662 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10664         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
10665         object-internal.h
10667         * object-internal.h: Same.
10669 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10671         * reflection.h: Fix the build I just broke.
10673 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10675         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
10676         Test if a token is valid, this remove explicit usage of 
10677         MonoDynamicImage::tokens from the verifier code.
10679         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
10681         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
10682         instead of direct access to MonoDynamicImage::tokens.
10684 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10686         * verify.c (token_bounds_check): Fix the build I just broke.
10688 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
10690         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
10692         * verify.c (verifier_load_method): Fixed the errors message.
10694         * verify.c (mono_method_verify): Fixed a debug message.
10696 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
10698         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
10699         mono-perfcounters.h, class-internals.h: support for predefined
10700         writable counters, query of categories and counters, bugfixes.
10702 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
10704         * verify.c (do_refanytype): Verify the refanytype opcode.
10706         * verify.c (mono_method_verify): Use do_refanytype.
10708 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
10710         * verify.c (do_mkrefany): Verify the mkrefany opcode.
10712         * verify.c (mono_method_verify): Use do_mkrefany.
10714 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
10716         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
10717         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
10718         implementation.
10720 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
10722         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
10723         the type load exception.
10725 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
10727         * verify.c: Added a few FIXME for method signatures
10729         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
10730         of mono_method_get_signature and get vararg call working. Removed unused
10731         checks for return value.
10733         * verify.c (do_refanyval): Verify the refanyval opcode.
10735         * verify.c (mono_method_verify): Implemented verification of arglist and
10736         use do_refanyval.
10738 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
10740         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
10741         vtypes to marshal.c.
10743         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
10744         it works for AOT as well.
10746 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
10748         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
10749         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
10750         the system time is adjusted.
10752 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
10754         * icall.c, icall-def.h: use the new time functions (fixes the
10755         non-monotonic behaviour of TickCount).
10757 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
10759         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
10760         it breaks the build.
10761         
10762         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
10763         cattr is not finished yet.
10765 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
10767         * verify.c: Proper token validation for field, method and type.
10769 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
10771         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
10773         * loader.c (method_from_memberref): Generate type load error instead of method missing
10774         if the type is not found.
10776 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
10778         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
10779         some of the conversions caused the generation of a marshal directive exception.
10781 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
10783         verify.c: Report which exception should be thrown by the JIT.
10784         Added a lot of FIXME notes.
10786 2008-02-22  Mark Probst  <mark.probst@gmail.com>
10788         * generic-sharing.c: Runtime generic context slots are not
10789         instantiated on init anymore.  Instead, provide function to do the
10790         instantiating on demand.
10792         * class-internals.h: Added vtable to runtime generic context.
10793         Macros for encoding direct and indirect slot offsets in one
10794         guint32.
10796 2008-02-21  Mark Probst  <mark.probst@gmail.com>
10798         * object.c, generic-sharing.c: Moved some generic sharing code
10799         from object.c to generic-sharing.c.
10801         * generic-sharing.c: Added support for extensible runtime generic
10802         context.
10804         * metadata-internals.h: Two new hash tables in MonoImage for
10805         extensible runtime generic context support.
10807         * domain.c: Unregister generic vtables upon domain unloading.
10809         * image.c: Destroy new hash tables upon image unloading.
10811         * metadata.c: Unregister generic subclasses upon image unloading.
10813         * class-internals.h: New data structure for runtime generic
10814         context template.  New fields in the runtime generic context for
10815         extensible part.
10817         * Makefile.am: Added generic-sharing.c.
10819 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
10821         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
10822         there is a pending loader exception, raise it.
10824         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
10825         same.
10827         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
10828         same.
10830         Fixes #363450.
10832 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
10834         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
10836         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
10837         
10838         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
10839         ref-only requests for compatibility with MS.
10841 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
10843         * reflection.c (mono_custom_attrs_from_method): Don't silently
10844         return an empty list for generic method instances.
10845         (mono_custom_attrs_from_param): Likewise.
10847 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
10848             Raja R Harinath  <harinath@hurrynot.org>
10850         Fix #354757
10851         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
10852         * class.c (mono_class_inflate_generic_method_full): Initialize it
10853         when a fully-open method is instantiated.
10854         * metadata.c (inflated_method_equal, inflated_method_hash): Update
10855         to new field.
10856         * reflection.c (inflate_mono_method): Don't create a temporary context.
10858 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
10860         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
10861         Compute correct value, to prepare for imethod->reflection_info going away.
10863 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
10865         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
10867 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
10869         * verify.c: Implement skip visibility flag.
10871 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
10873         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
10874         which contains an extra field to tell the kind of exception that should be thrown.
10876         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
10878 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
10880         * loader.c (mono_method_get_param_names): Initialize 'klass' after
10881         'method' is updated.
10883 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
10885         * class.c (mono_class_layout_fields): Set class->min_align for classes using
10886         explicit layout as well. Fixes #360375.
10888 2008-02-11  Geoff Norton  <gnorton@novell.com>
10890         * loader.c: Guard and dereference against inflated generic methods
10892 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
10894         * class.c: Include Retargetable spec in assembly name.
10895         * assembly.c: Always include PublicKeyToken spec in assembly name
10896         (with value "null" if assembly is not signed), and include
10897         Retargetable spec.
10898         * icall-def.h: Added icall for Assembly.get_fullname.
10899         * icall.c: Added icall returning the fullname of an assembly.
10901 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
10903         * class.c (mono_class_setup_vtable_general): Add a missing call to
10904         mono_class_setup_methods () which is needed in the AOT case.
10906 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
10908         * verify.c (mono_type_get_stack_name): Added. Return the name for the
10909         stack type of the given MonoType.
10911         * verify.c (verify_type_compatibility_full): Handle the void type.
10913         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
10914         way stack merging works.
10916         * verify.c (store_local): Improved verification message.
10918         * verify.c (do_branch_op): If the merging is invalid, the method
10919         is unverifiable and not invalid. Improved error message.
10921         * verify.c (merge_stacks): Properly merge a boxed valuetype and
10922         a reference type diferent than System.Object. Improved error
10923         message.
10925 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
10927         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
10929         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
10930         type of an enum even if the argument is byref.
10932         * verify.c: Replace all explicit uses of enumtype and enum_basetype
10933         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
10935         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
10937         *verify.c (verify_type_compatibility_full): Make enum types
10938         compatible with their base types.
10940         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
10941         types are compatible for the special case of a boxed valuetype and
10942         System.Object.
10944         * verify.c (verify_stack_type_compatibility): The function
10945         is_compatible_boxed_valuetype was extracted from here.
10947         * verify.c (push_arg): Only set ctx->has_this_store if the method
10948         is not static.
10950         * verify.c (do_ldelem): Fixed a typo in an error message and added
10951         strict check for mixing int32 and native int as the array type
10952         and ldelem type.
10954         * verify.c (merge_stacks): Consider boxed valuetypes in the
10955         compatibility checks.
10957 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
10958         * profiler.h: (MonoGCEvent): Added start-stop the world events.
10960 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
10961         *class.c: use_new_interface_vtable_code: renamed the env var to have
10962         a "MONO_" prefix, and fix the logic to enable it by default.
10964 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
10965         *class.c:
10966         mono_class_setup_vtable_general: rewrote the way in which interface
10967         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
10968         makes the code more maintainable.
10969         For now the old code is still there, and can be activated setting
10970         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
10972 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
10974         * verify.c: guarded some debug functions around and #ifdef.
10976         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
10978 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
10980         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
10981         changes for now since they seem to break too many things.
10983 2008-02-05  Mark Probst  <mark.probst@gmail.com>
10985         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
10986         mono_marshal_find_nonzero_bit_offset): Added macro and function
10987         for finding the byte- and bit-offset of a bitfield within a
10988         struct.
10990 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
10992         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
10993         (mono_marshal_get_struct_to_ptr): Ditto.
10995         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
10996         cctor_signature.
10998 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
11000         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
11001         between methods for non-corlib types.
11003 2008-02-02  Geoff Norton  <gnorton@novell.com>
11005         * loader.c (mono_method_get_param_names): Populate the parameter name for 
11006         generic parameters as well. (Fixes #342536)
11008 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
11010         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
11012         * verify.c (do_invoke_method): Fix for calling with byref structs.
11014         * verify.c (do_cast): push a boxed value type based on the type token and not
11015         the type of stack.
11017 2008-01-31  William Holmes  <billholmes54@gmail.com>
11019         * process.c (process_module_string_read): Check the size returned form 
11020           VerQueryValue to avoid out of memory exception. 
11022 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
11024         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
11025         Handle properly modules which are not in the moduleref table. Fixes
11026         #356938.
11028 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
11030         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
11031         the dynamic case which is now in managed code.
11032         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
11034         * marshal.c (mono_string_to_bstr): Fix a warning.
11035         (init_com_provider_ms): Ditto.
11037         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
11039         * exception.c (mono_get_exception_out_of_memory): New helper function.
11041 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
11043         * marshal.c: Add support for BSTR marshalling
11044         using other COM systems.
11046         Code is contributed under MIT/X11 license.
11048 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
11050         * object.c (mono_runtime_invoke_array): reverted previous
11051         commit as it breaks the build.
11053 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
11055         * object.c (mono_runtime_invoke_array): Verify arguments for
11056         invalid types. Fixes #348522.
11058 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
11060         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
11061         non-final virtual calls using call. 
11063         * verify.c (do_invoke): fixed some TODOs.
11065         * verify.c (push_arg): set has_this_store for "ldarga 0".
11067 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
11069         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
11070         which belong to an inflated class. Fixes #356531.
11072 2008-01-26  Robert Jordan  <robertj@gmx.net>
11074         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
11075         which resort to FindFirstFile when a certain error condition
11076         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
11077         Code is contributed under MIT/X11 license.
11079 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
11081         * marshal.c (emit_marshal_string): Fix out string marshalling
11082         to use specified encoding. Fixes #323900.
11084         Code is contributed under MIT/X11 license.
11086 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
11088         * class.c (mono_class_inflate_generic_method_full): Don't modify
11089         iresult->context after cache check.
11091 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
11093         * class.c (mono_class_inflate_generic_method_full): Change the
11094         struct assignments to memcpy for better visibility and add some comments.
11096 2008-01-23  Dick Porter  <dick@ximian.com>
11098         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
11099         procedure, and make it work on windows.
11101 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
11103         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
11104         a MonoReflectionTypeBuilder since it is always of that type.
11106         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
11108         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
11110         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
11111         
11112         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
11114         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
11116         * reflection.c (mono_reflection_create_runtime_class): Remove already created
11117         instantiations from the type cache.
11119 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11121         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
11123         * verify.c (do_unbox_value): push a controled mutability managed pointer.
11125 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11127         * verify.c (do_ldstr): added, verifies if the #US token is valid.
11129         * verify.c (mono_method_verify): removed old TODO
11131 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11133         * verify.c (do_newobj): add visibility check.
11135 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11137         * verify.c (do_load_function_ptr): add visibility check.
11139 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
11140         *class.c:
11141         mono_generic_class_get_class: hook profiler events.
11142         mono_field_get_offset: added to support heap-shot in the new profiler.
11143         *class.h: exported mono_field_get_offset.
11144         * reflection.c:
11145         mono_reflection_setup_internal_class: hook profiler events.
11147 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
11149         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
11150         argument here too and use it to avoid checking for pending exceptions if 
11151         possible.
11153 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
11155         * assembly.c (build_assembly_name): add arg for passing the assembly
11156         flags. Do not consider a PublicKey with value "null" valid.
11157         (mono_assembly_name_parse_full): added boolean argument that will be
11158         set if the assembly name contains a PublicKeyToken spec. Added support
11159         for the Retargetable spec for which only Yes or No are allowed as valid
11160         value. Consider assembly name invalid if Retargetable spec is set, but
11161         either version, culture or public key (token) are not specified.
11162         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
11163         with implementation in assembly.c.
11164         * icall.c (fill_reflection_assembly_name): also copy assembly flags
11165         from MonoAssemblyName.
11166         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
11167         introduced argument for mono_assembly_name_parse_full to know if the
11168         assembly name has a PublicKeyToken spec, and if it has instruct
11169         fill_reflection_assembly_name to use default value for keyToken (if
11170         PublicKeyToken is null).
11172 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
11174         * verify.c (mono_method_verify): fixed ovf ops with
11175         float values. They are unverifiable now.
11177 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
11179         * class.c (set_failure_from_loader_error): add BadImageException to the
11180         list of exceptions that can cause a type to fail to load.
11182         * class.c (mono_class_get_exception_for_failure): same.
11184 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
11186         * verify.c (in_any_exception_block): added, check if offset
11187         is part of any exception handling clause.
11189         * verify.c (get_stack_type): added VAR and MVAR types.
11191         * verify.c (do_stobj): better error messages.
11193         * verify.c (do_cpobj): added, check cpobj.
11195         * verify.c (do_initobj): added, check initobj.
11197         * verify.c (do_sizeof): added, check sizeof.
11199         * verify.c (do_localloc): added, check localloc.
11201         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
11203 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
11205         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
11206         save_lmf/restore_lmf opcodes.
11208         * threads.c (mono_threads_install_notify_pending_exc): New function to
11209         install a callback notifying the JIT there is a pending exception on a thread.
11210         (mono_thread_request_interruption): Call the new callback.
11211         (mono_thread_get_and_clear_pending_exception): New function to return the
11212         exception pending on a thread.
11214         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
11215         to turn off checking for pending exceptions.
11216         (mono_marshal_get_native_wrapper): Ditto.
11218 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
11220         * threads-types.h: Get rid of the unnecessary extern declarations.
11222 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
11224         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
11225         return field from parent class if not private.
11226         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
11227         returns fields from parent class if they are not private.
11228         (method_nonpublic): added function to determine if a given method
11229         should be considered non-public. Returns false for private methods
11230         on parent class, and internal methods from parent on the 1.0 profile.
11231         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
11232         use method_nonpublic function to determine whether method should be
11233         returned.
11234         (property_accessor_public): use newly introduced method_nonpublic
11235         function to determine whether accessor is non-public. 
11236         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
11237         event from parent class if not private. Only return static event if
11238         Static flag is set, and only return static event from parent class if
11239         FlattenHierarchy flag is set.
11240         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
11241         include non-private events from parent class.
11243 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
11245         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
11246         warning.
11248 2008-01-16  Wade Berrier <wberrier@novell.com>
11250         * security.c: Add assembly.h header to appease some warnings
11252 2008-01-16  Dick Porter  <dick@ximian.com>
11254         * process.c (process_module_string_read): Remove trailing null
11255         when saving string.
11257 2008-01-16  Mark Probst  <mark.probst@gmail.com>
11259         * class-internals.h: A new data structure describing the layout of
11260         a runtime generic context (MonoRuntimeGenericContextTemplate).
11262         * metadata-internals.h: Added a hash table to MonoDomain that maps
11263         from open generic classes to their runtime generic context
11264         templates.
11266         * object.c: Building of the runtime generic context, including
11267         proper handling of generic type arguments of superclasses.
11268         Building of the runtime generic context according to the template.
11270 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
11272         * class.c (mono_class_setup_fields): Set field.count for generic instances.
11273         Fixes #350856.
11275         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
11276         mono_portability_find_file (). Fixes #325466.
11277         (mono_image_get_public_key): Fix a warning.
11279 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
11281         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
11282         Fixes #353550.
11283         (mono_class_from_name_case): Ditto.
11285 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
11287         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
11288           common storage for the tables used in the System/NumberFormatter class.
11290 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
11292         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
11294 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
11296         * verify.c (get_boxable_mono_type): check if the token is valid.
11298         * verify.c (set_stack_value): changed to add an error if an
11299         invalid type is set on stack. Changed all callers due to signature change.
11301         * verify.c (do_stobj): implement stobj validation.
11303 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
11305         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
11306         set container->is_method, it was set earlier.
11308         * metadata.c (type_in_image): Handle MVARs which belong to not finished
11309         generic methods.
11311         * reflection.c (mono_reflection_initialize_generic_parameter): Set
11312         is_method of the generic container to TRUE for methods.
11314 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
11316         * metadata.c (type_in_image): Handle type parameters properly.
11318         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
11319         memory ownership of this structure.
11321 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
11323         * verify.c (get_boxable_mono_type): make typedref types been just
11324         unverifiable. check for void type.
11326         * verify.c (do_unbox_any): added, verify opcode unbox.any.
11328         * verify.c (do_load_function_ptr): accept method spec tokens.
11330 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
11332         * marshal.c (mono_class_native_size): Always set *align even if this is called
11333         recursively.
11335 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
11337         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
11338         out-of-date.
11340 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
11342         * verify.c: removed some old unused tables. A huge bunch of small fixes
11343         to things found while testing the verifier with mono basic.
11345         * verify.c (dump_stack_value): dump null literal flag to.
11347         * verify.c (verify_type_compatibility_full): fix comparison
11348         for types that have a generic super type.
11350         * verify.c (verify_stack_type_compatibility): fix compatibility
11351         between null literals and reference types. fix compatibility between
11352         boxed valuetypes and object. fix corner case test for enums.
11354         * verify.c (do_cmp_op): proper verification of cgt.un in case
11355         of reference types.
11357         * verify.c (do_invoke_method): fix error message.
11359         * verify.c (do_store_indirect
11361         * verify.c (check_is_valid_type_for_field_ops): proper verification
11362         of managed pointers to valuetypes and boxed valuetypes. proper verification
11363         of null literals.
11365         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
11366         allow token to be a reference type.
11368         * verify.c (do_cast): proper handling of boxes valuetypes.
11370         * verify.c (do_stelem): proper handling of storing a boxed valuetype
11371         in object[].
11373         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
11374         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
11375         fixed the decoding of unbox_any
11377 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
11379         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
11381 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
11383         * verify.c (do_newobj): do delegate verification.
11385         * verify.c (verify_delegate_compatibility): perform delegate
11386         verification.
11388         * verify.c (verify_ldftn_delegate): perform tests related to
11389         ldftn delegates.
11391         * verify.c (mono_delegate_signature_equal): perform the
11392         slightly diferent signature comparison required by delegates.
11394         * metadata.c (mono_metadata_type_equal_full): added and exported
11395         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
11396         allows signature only comparison.
11398         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
11399         as MONO_INTERNAL.
11401 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
11403         * verify.c: added a bunch of stack_slot_* functions to
11404         make access to stack slot type easier. This is required to
11405         allow optional flags, like null literal, boxed value and
11406         this pointer.
11407         All access paths to IlStackDesc::stype have been changed 
11408         to use these new funcions.
11409         Removed a bunch of unused functions and cleared all warnings.
11410         This patch introduces the usage of the this pointer and 
11411         boxed value flags.
11413 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
11415         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
11417 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
11419         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
11420         match managed version.
11422         * appdomain.c: Bump corlib version.
11423         
11424         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
11425         argument.
11427 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
11429         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
11430         Set public key token to zero-length byte array if assembly is not
11431         strongnamed.
11433 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
11435         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
11436         writing a vtype array elem.
11438 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
11440         * assembly.c (build_assembly_name): return FALSE if length of token is
11441         not 16 (if not "null").
11442         (mono_assembly_name_parse_full): return FALSE if value of version,
11443         culture, token or key is 0.
11444         * icall.c (fill_reflection_assembly_name): add boolean arguments to
11445         specify whether public key and public key token must be set to default
11446         value (zero-length byte array) if not available. Set versioncompat to
11447         SameMachine. If public key is available or the default is set, then
11448         set PublicKey flag.
11449         (ves_icall_System_Reflection_Assembly_FillName): if no public key
11450         is available, use empty byte array as default value. On the 2.0
11451         profile, use default value for public key token if not set.
11452         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
11453         profile, use default value for public key if not set. On the 2.0
11454         profile, use default value for public key token if not set.
11455         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
11456         default values for public key and public key token.
11458 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
11460         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
11461         field to keep it in synch with the managed object.
11463         * marshal.c (emit_marshal_object): Add support for byref marshalling of
11464         delegates. Fixes #351520.
11466         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
11467         contains defined memory.
11468         
11469         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
11471         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
11472         
11473         * sgen-gc.c (check_consistency): New helper function to do a consistency check
11474         of the GC data structures.
11476         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
11478         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
11479         
11480         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
11481         barrier.
11482         (mono_array_clone_in_domain): Ditto.
11483         (mono_array_clone_in_domain): Ditto.
11485         * threads.c (start_wrapper): Register the thread start argument as a GC root.
11486         (cache_culture): Use a write barrier.
11488         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
11489         (ves_icall_get_property_info): Ditto.
11491         * object.h (MONO_STRUCT_SETREF): New macro.
11493         * class-internals.h (MonoStats): Add some GC statistics.
11495         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
11497 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
11499         * exception.c (mono_exception_from_name_two_strings):
11500         Break from loop after method is found.
11502 2008-01-04  Dick Porter  <dick@ximian.com>
11504         * process.c (process_module_string_read): Rename variable to
11505         reflect correct usage, after fixing bug 345972.
11507 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
11509         * verify.c (mono_type_create_fnptr_from_mono_method): 
11510         created a MonoType function pointer instance to be used during
11511         verification. The verifier releases this memory at end.
11513         * verify.c (mono_method_is_constructor): extracted repeated
11514         checks for constructor into a single class.
11516         * verify.c (do_push_field): use new extracted method
11517         for constructor check.
11519         * verify.c (do_newobj): same.
11521         * verify.c (do_ldftn): renamed to do_load_function_ptr
11522         and make it verify ldvirtftn too.
11524         * verify.c (mono_method_verify: proper verification
11525         of ldvirtftn. release created MonoMethod instances.
11527 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
11529         * verify.c (token_bounds_check): added.
11531         * verify.c (do_ldftn): added.
11533         * verify.c (mono_method_verify): proper verificartion of ldftn.
11535 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
11537         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
11538         than the table row count. It's the resposibility of the caller to
11539         make the bounds check and raise the correct error.
11541         * metadata.c (mono_metadata_decode_row_col): Same.
11543         * loader.c (mono_get_method_from_token): perform bounds check
11544         on token for methoddef table.
11546 2007-12-29  Miguel de Icaza  <miguel@novell.com>
11548         * icall.c
11549         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
11550         assert into a negative result, the managed code already coped with
11551         that.
11553         Some folks on Windows reported this error. 
11555 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
11557         * appdomain.c: Bump corlib version.
11558         * icall.c:
11559         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
11560         CultureInfo.CreateCulture to create CultureInfo for name.
11561         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
11562         create CultureInfo for name. Fixes bug #347174.
11564 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
11566         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
11567         flags.
11569         * verify.c (is_valid_branch_instruction): allow branching to the
11570         first instruction of the protected block.
11572         * verify.c (is_valid_cmp_branch_instruction): same.
11574         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
11575         avoid double initialization.
11577         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
11578         detect which cases the eval stack should just be copied.
11580         * verify.c (mono_method_verify): check if the eval stack
11581         is empty when entering a protected block.
11583 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
11585         * verify.c: added is_clause_in_range, is_clause_inside_range,
11586         is_clause_nested and verify_clause_relationship. They perform
11587         the verifications stated in P1 12.4.2.7.
11589         * verify.c (mono_method_verify): remove some unused variables,
11590         add the new exception clause checks, add instruction border
11591         checks for protected block start/end, improved some error 
11592         messages and fixed a bug in the way invalid instruction access
11593         is detected.
11595 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
11597         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
11598         from GC 7.0 if available.
11600         * object.c: Remove an unused define.
11601         
11602         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
11604         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
11606         * null-gc.c (mono_gc_make_descr_for_array): Implement.
11608         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
11610         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
11611         to take the same arguments as the other make_descr functions.
11613         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
11615         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
11616         directly.
11618         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
11619         mini.c.
11621         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
11622         call to boehm-gc.c.
11624         * boehm-gc.c (mono_gc_register_root): Fix a warning.
11626         * null-gc.c (mono_gc_register_root): Fix a warning.
11628         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
11630         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
11631         (mono_gc_base_init): Call GC_init ().
11633         * null-gc.c: Define mono_gc_register_root () as a no-op.
11635         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
11637 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
11639         * verify.c: add prototype for merge_stacks at top
11641         * verify.c (do_switch): added.
11643         * verify.c (merge_stacks): on some cases the stack merging
11644         was not happening properly. Unequal stack sizes at merge
11645         points should be invalid.
11647         * verify.c (mono_method_verify): added more debug info on stack state.
11648         verify switch properly.
11650 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
11652         * method-builder.h: New file, moved the mono_mb_ declarations here from 
11653         marshal.h.
11655         * boehm-gc.c marshal.c: Include method-builder.h.
11657         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
11659         * marshal.c: Remove some code which is now in method-builder.c.
11661 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
11663         * method-builder.c: New file, extraction of the method builder functionality 
11664         from marshal.c.
11666         * marshal.c: Move the mb functions into method-builder.c.
11668         * marshal.h marshal.c: Export some mono_mb_... functions.
11670         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
11672         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
11673         the caller.
11675         * class.c (mono_class_get_full): Check the token type in the dynamic case.
11677         * loader.c (mono_field_from_token): Ditto.      
11679         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
11680         type as well.
11681         
11682         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
11683         Fixes #342565.
11685         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
11686         a helper function for setting it.
11688         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
11690         
11691         * assembly.c: Significally simplify code now that referenced assemblies are 
11692         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
11694         * threads.h: Don't include  the internal threads-types.h header file. Fixes
11695         #349952.
11697 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
11699         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
11700         instructions that were target of branches or are at protected block boundaries.
11702         * verify.c (in_same_block): handle filter clauses.
11704         * verify.c (is_valid_branch_instruction): added. checks the target of
11705         instructions br or brtrue/false.
11707         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
11708         binary branch instructions such as beq and bge.
11710         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
11711         and made it pin the instruction as been part of the exception block.
11713         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
11714         of in_same_block.
11716         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
11717         of in_same_block.
11719         * verify.c (do_ret): ret from a protected block is unverifiable and
11720         not invalid.
11722         * verify.c (do_static_branch): verify br and br.s instructions.
11724         * verify.c (merge_stacks): add extra param to support detection
11725         of branches in the middle of instructions.
11726         
11727         * verify.c (mono_method_verify): verify branches and exception blocks
11728         that target the middle of instructions. Proper verification of br and br.s.
11730 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
11732         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
11733         skip_visibility field.
11734         (reflection_methodbuilder_from_dynamic_method): Ditto.
11736         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
11737         registrations. Fixes #348193.
11739         * threads.h: Move the internal mono_thread_get_pending_exception () to
11740         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
11742 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
11744         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
11745         icall registration. Fixes #348193.
11747         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
11748         for corlib classes into object. Fixes #349621.
11750 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
11752         * icall.c (property_accessor_nonpublic): new function to determine
11753         whether an accessor allows a property to be considered non-public.
11754         Returns false for private accessor(s) from parent class, and internal
11755         accessor(s) from parent on 2.0 profile (and higher).
11756         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
11757         to determine whether property should be included if NonPublic flag
11758         is set. Fixes bug #349078.
11760 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
11762         * verify.c (init_stack_with_value): added.
11764         * verify.c (mono_method_verify): extracted common
11765         code for exception initialization into init_stack_with_value.
11767         * verify.c (mono_method_verify): initialize the exception
11768         for handler clauses as well.
11770         * verify.c (mono_method_verify): fix the exception clause
11771         ordering rules, it should use handler end offset and not
11772         start offset.
11774 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
11776         * rawbuffer.c: remove useless warning.
11778 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
11780         * threads.h, threads-types.h: move functions to the correct header
11781         (fixes bug#349952).
11783 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11785         * verify.c (mono_method_verify): proper verification
11786         of exception handling clauses ranges and fallthru in
11787         and out of protected blocks.
11789 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11791         * verify.c (mono_method_verify): fixed compilation issue.
11793 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
11795         * verify.c (mono_method_verify): a printf slipped in, changed
11796         to use verifier debug macro.
11798 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
11800         * verify.c (is_correct_leave): check for filter clauses.
11802         * verify.c (do_filter): added.
11804         * verify.c (mono_method_verify): property verification of leave.
11807 2007-12-18  Mark Probst  <mark.probst@gmail.com>
11809         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
11810         Win32 build, until we figure out how to do the proper thing on
11811         Win32.
11813 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
11815         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
11816         by the previous patch.
11817         
11818         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
11819         the assembly resolve handler for refonly assemblies.
11821 2007-12-17  Mark Probst  <mark.probst@gmail.com>
11823         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
11824         Make sure only one thread is allowed to commence shutdown, and
11825         don't allow new threads to be started once shutdown is in
11826         progress.
11828 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
11830         * verify.c (is_correct_endfilter): added.
11832         * verify.c (is_unverifiable_endfilter): added.
11834         * verify.c (do_endfilter): added.
11836         * verify.c (mono_method_verify): property verification of endfilter
11837         and fixed a corner case or endfinally.
11839 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
11841         * verify.h: new flags to support fail fast of unverifiable code and
11842         do non-strict verification. Non-strict verification is required to
11843         have MS runtime compatibility. There are a huge amount of unverifiable
11844         code that it accepts as verifiable. The strict mode verifies the code
11845         as the specs says.
11846         Non-strict mode will be required in cases where code needs to be
11847         accepted as verifiable but fails under strict mode.
11849         * pedump.c: added support to fail fast and non-strict verification.
11851         * verify.c: added support for both fail fast and non-strict verification.
11853 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
11855         * verify.c (is_correct_endfinally): added.
11857         * verify.c (mono_method_verify): property verification of endfinally.
11859 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
11861         * verify.c (in_any_block): check for filter clauses.
11863         * verify.c (is_correct_rethrow): added.
11865         * verify.c (mono_method_verify): property verification of rethrow.
11867         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
11869 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
11871         * verify.c (do_throw): added.
11873         * verify.c (mono_method_verify): property verification of throw
11875 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
11877         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
11878         assemblies. Fixes #346425.
11880 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
11882         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
11883         FieldBuilders.
11885         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
11887         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
11888         prevent asserts when this is called with a token which might not be valid.
11890         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
11891         lookup_dynamic_token_class with valid_token == FALSE.
11893         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
11895         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
11897         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
11898         
11899 2007-12-10  Mark Probst  <mark.probst@gmail.com>
11901         * gc.c: Don't delay threadpool thread finalization unless Mono is
11902         shutting down.
11904 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
11906         * threads.c: turn an assert into a non-fatal warning.
11908 2007-12-09  Robert Jordan  <robertj@gmx.net>
11910         * icall.c (GetVirtualMethod): Add missing argument validation.
11912 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11914         * verify.c (do_cast): added.
11916         * verify.c (mono_method_verify): property verification of castclass and isinst.
11919 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11921         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
11923         * verify.c (do_stelem): added.
11925         * verify.c (mono_method_verify): property verification of stelem.X.
11927 2007-12-07  Mark Probst  <mark.probst@gmail.com>
11929         * class.c, class-internals.h: Introduce an environment variable
11930         (MONO_GENERIC_SHARING) through which the extent of generic code
11931         sharing can be controlled (share all classes, share only corlib
11932         classes, or share nothing).
11934         * object.c: Only create runtime generic context for classes for
11935         which sharing is enabled.
11937 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11939         * verify.c (do_ldelem): refactor it to work with ldelem.any.
11941         * verify.c (mono_method_verify): property verification of ldelem.any.
11943 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
11945         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
11946         added ldelem.X opcodes.
11948         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
11950         * verify.c: proper verification of ldelem.X 
11952 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
11954         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
11956 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
11958         * verify.c (mono_method_verify): null literal requires special handling,
11959         the value pushed on stack need to be flagged as so.
11961         * verify.c (do_ldelema): Verify ldelema properly.
11963 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
11965         * verify.c: Verify ldlen properly.
11967 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
11969         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
11970         to the target object's type. Fixes #346160.
11972 2007-12-05  Dick Porter  <dick@ximian.com>
11974         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
11975         Solaris needs the same workaround as BSD-derived systems.  Fixes
11976         bug 323524, patch by Burkhard Linke
11977         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
11979 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
11981         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
11982         handle to use when error dialog is shown; otherwise, update mask
11983         to show no error dialog when an error occurs.
11985 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
11987         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
11989         * class.c (mono_class_get_field_default_value): New helper function to initialize
11990         field->def_type and field->data.
11992 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
11994         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
11995         the general one.
11997         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
11999         * marshal.c: Avoid depending on delegate->method_info being set.
12001         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
12002         
12003         * object.c (mono_delegate_ctor): Set delegate->method.
12005         * object-internals.h (struct _MonoDelegate): Add 'method' field.
12007         * appdomain.c: Bump corlib version.
12009 2007-11-27  Raja R Harinath  <harinath@gmail.com>
12011         * metadata.c (mono_generic_inst_equal_full): Short-circuit
12012         equality check if we're comparing canonicalized MonoGenericInsts.
12014 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
12016         * class.c (generic_array_methods): Call mono_class_setup_methods () before
12017         accessing class->methods.
12019 2007-11-22  Dick Porter  <dick@ximian.com>
12021         * threads.c: Ensure that the synch_cs is set before trying to use
12022         it.
12024 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
12026         * profiler.c: r89126 broke the statistial profiler, unbreak.
12028 2007-11-22  Martin Baulig  <martin@ximian.com>
12030         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
12032         * mono-debug.c
12033         (mono_debug_debugger_version): Bump to 3.
12034         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
12035         -> mono_debugger_class_initialized().
12037         * mono-debug-debugger.c
12038         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
12040         * class.c
12041         (mono_debugger_start_class_init_func): Removed.
12042         (mono_debugger_class_loaded_methods_func): Added.
12043         (mono_class_setup_methods): Call it here.
12045 2007-11-22  Martin Baulig  <martin@ximian.com>
12047         * mono-debug.c
12048         (mono_debug_add_delegate_trampoline): New public method.
12049         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
12051         * mono-debug.h
12052         (MonoSymbolTable): Added `global_data_table'.
12053         (MonoDebuggerTypeKind): Removed.
12055 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
12057         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
12058         these methods.
12060         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12061         
12062 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
12064         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
12066 2007-11-20  Martin Baulig  <martin@ximian.com>
12068         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
12070         * mono-debug-debugger.c
12071         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
12072         (mono_debugger_remove_breakpoint): Likewise.
12073         (mono_debugger_check_breakpoints): Likewise.
12074         (mono_debugger_register_class_init_callback): New public method.
12075         (mono_debugger_remove_class_init_callback): Likewise.
12076         (mono_debugger_add_type): Likewise.
12078         * mono-debug-debugger.h
12079         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
12081 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
12083         * class.c: more interface implementations needed for the
12084         array enumerator (fixes bug #341112).
12086 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
12088         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
12089         fix ParamName of ArgumentNullExceptions.
12091 2007-11-17  Miguel de Icaza  <miguel@novell.com>
12093         * reflection.c (mono_reflection_encode_sighelper): Generate the
12094         modopts and modreqs.   I have a useless test that crashes monodis,
12095         but that shows the code working.
12097 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
12099         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
12100         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
12102 2007-11-15  Dick Porter  <dick@ximian.com>
12104         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
12105         When joining a thread, it's the thread that's calling Join that
12106         gets WaitSleepJoin state not the target.  Fixes the standalone
12107         test case in bug 334740, and hopefully the whole bug too.
12109 2007-11-15  Dick Porter  <dick@ximian.com>
12111         * process.c: Read file version info from the files pointed at by
12112         process modules, not the current process.  Fixes bug 315969.
12114         Use windows typedef names in some places to fix warnings on the
12115         windows build.
12117 2007-11-15  Mark Probst  <mark.probst@gmail.com>
12119         * image.c, metadata-internals.h: Added a generic_class_cache hash
12120         to MonoImage for looking up generic classes when sharing generics.
12122 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
12124         * sgen-gc.c: warning cleanups.
12126 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
12128         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
12129         inherited properties.
12131 2007-11-14  Mark Probst  <mark.probst@gmail.com>
12133         * object.c, class-internals.h: Added more information to the
12134         runtime generic context.
12136 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
12138         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
12139         instead of just the target method. Generalize the abstract method handling to
12140         handle any non-static method.
12142         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
12143         mono_marshal_get_delegate_invoke () signature change.
12145 2007-11-13  Mark Probst  <mark.probst@gmail.com>
12147         * class.c, class-internals.h: Made
12148         mono_type_get_basic_type_from_generic () public.  Fixed member
12149         access check for shared generics.
12151         * loader.c: Don't insert field into field cache if it's part of a
12152         non-inflated generic class.
12154         * domain.c, domain-internals.h: The generic sharing context is now
12155         part of the jit info data structure.  Added two accessor
12156         functions.
12158 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
12160         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
12161         the array Get/Set/Address methods, since the JIT inlines them.
12163         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
12165         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
12166         (mono_image_init): Initialize runtime_invoke_direct_cache.      
12168         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
12169         mono_marshal_get_delegate_invoke signature change.
12171         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
12172         an additional argument. Add support for invoking abstract methods.
12174         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
12176         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
12178 2007-11-09  Mark Probst  <mark.probst@gmail.com>
12180         * class.c: Do field layout for open generic classes as well.
12182 2007-11-09  Mark Probst  <mark.probst@gmail.com>
12184         * gc.c, gc-internal.h: Don't finalize threadpool threads with
12185         other objects, because the threadpool is still around.  Put them
12186         in a list instead and after finalizing all other objects in the
12187         root domain shut down the thread pool and then finalize the
12188         threads.  Fixes bug #337383.
12190         * threads.c, thread-types.h: New mono_thread_create_internal()
12191         function for marking a thread with the threadpool flag before it
12192         started.  Set synch_cs to NULL after freeing it.
12194         * threadpool.c: Mark threadpool threads before they start.
12196 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
12198         * reflection.h, reflection.c: don't export random functions
12199         and lazy load dbnull and missing objects.
12201 2007-11-07  Jonathan Chambers <joncham@gmail.com>
12203         * class.c: Initialize COM types if COM interfaces
12204         are present (not just COM classes).
12205         
12206         Code is contributed under MIT/X11 license.
12208 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
12209         * reflection.c:
12210         create_dynamic_mono_image: hook module profiler events (dynamic case).
12211         mono_image_basic_init: hook assembly profiler events (dynamic case).
12213 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
12214         * profiler.c:
12215         simple_appdomain_unload: completely terminate the profiler
12216         instead of only processing the statistical samples.
12217         simple_shutdown: make sure this is really called exactly once,
12218         even in multithreaded applications, and always listen to
12219         appdomain events.
12220         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
12221         here, the "[un]load" functions will do it.
12222         Fixes bugs #333791 and #325261.
12224 2007-11-07  Geoff Norton  <gnorton@novell.com>
12226         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
12227         rather than depend on __APPLE__.
12229 2007-11-07  Mark Probst  <mark.probst@gmail.com>
12231         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
12233 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
12235         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
12236         UTF16 MonoString. Fix the crash from bug #335488
12238 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
12240         * marshal.c: Correct (for non-Win32 OS) length != size in 
12241         mono_string_from_bstr. Fix #339530.
12243 2007-11-06  Geoff Norton  <gnorton@novell.com>
12245         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
12246         to succeed
12248 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
12250         * process.c: Added run-time GetProcessId API detection for Windows.
12252 2007-11-04  Miguel de Icaza  <miguel@novell.com>
12254         * reflection.c  (mono_param_get_objects): If a parameter has the
12255         attribute [System.Runtime.InteropServices.Optional] we should
12256         set the DefaultValue of the ParameterInfo to be
12257         System.Reflection.Missing instead of DBNull.
12259         See bug #339013.
12261         (mono_get_reflection_missing_object): New method,
12262         returns the System.Reflection.Missing.Value singleton instance.
12264 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
12266         * culture-info-table.h : regenerated.
12268 2007-11-02  Jonathan Chambers <joncham@gmail.com>
12270         * icall.c: Use GetEnvironmentStrings on windows
12271         so we are using the same environment block as 
12272         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
12273         #333740.
12274         
12275         Code is contributed under MIT/X11 license.
12277 2007-10-31  Martin Baulig  <martin@ximian.com>
12279         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
12281         * mono-debug-debugger.h
12282         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
12284 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
12286         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
12287         classes.
12289 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
12291         * culture-info-table.h : regenerated.
12293 2007-10-30  Robert Jordan  <robertj@gmx.net>
12295         * icall-def.h, icall.c:
12296         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
12298         Code is contributed under MIT/X11 license.
12300 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
12302         * class.c (mono_class_setup_vtable): Find the inflated methods in the
12303         inflated class instead of inflating them again.
12304         
12305         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
12306         dynamic case.
12308         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
12309         Call setup_supertypes () after klass->parent is set.
12310         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
12312         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
12313         for inflated instances of not yet created dynamic generic classes.
12314         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
12315         times from inflated_method.
12316         (methodbuilder_to_mono_method): Ditto.
12318 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
12320         * gc.c: code cleanup and removed old untested option of not creating the
12321         finalizer thread.
12323 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
12325         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
12326         creating a jump trampoline for dynamic methods.
12328 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
12330         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
12331         generic TypeBuilders when called from another method of the same type (bug #335131).
12334 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
12336         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
12337         doesn't seem to work perfectly.
12338         
12339         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
12340         called multiple times.
12341         (methodbuilder_to_mono_method): Ditto.
12342         (resolve_object): Inflate FieldBuilder's.
12344 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
12346         * string-icalls.c, string-icalls.h, appdomain.c: patch from
12347         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
12348         RemoveEmptyEntries in the string.Split implementation (bug #322375).
12350 2007-10-26  Dick Porter  <dick@ximian.com>
12352         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
12353         Thread initialisation changes
12355 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
12357         * verify.c: fix compatibility check between arrays and System.Array
12359 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
12361         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
12362         too. Fixes #336999.
12364 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
12366         * object.c (mono_value_box): Use typed allocation here.
12368 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
12370         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
12371         trampoline instead of compiling the method right away.
12373         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
12375 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
12377         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
12378         related fields for dynamic classes. Fixes #334493.
12380 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
12382         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
12383         
12384         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
12386         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
12387         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
12389         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
12391         * reflection.c (create_generic_typespec): Initialize klass->generic_container
12392         if needed.
12393         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
12395 2007-10-18  Jonathan Chambers <joncham@gmail.com>
12397         * marshal.c: Use correct key when removing item
12398         from ccw_hash.
12399         
12400         Code is contributed under MIT/X11 license.
12402 2007-10-17  William Holmes  <billholmes54@gmail.com>
12404         *marshal.c: Adding a case to marshal booleans to U1
12406         Code is contributed under MIT/X11 license.
12408 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
12410         * class.c (mono_class_from_name): Search the modules compromising dynamic
12411         assemblies. Fixes #331601.
12413 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
12415         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
12416         exception if the type name contains an assembly component. Fixes #334203.
12418         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
12419         modules inside dynamic assemblies. Fixes #334200.
12420         
12421         * reflection.c: Set image->public_key and image->public_key_length;
12423         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
12424         fields.
12426         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
12427         
12428 2007-10-16  Mark Probst  <mark.probst@gmail.com>
12430         * metadata.c: Implemented correct comparing of generic classes.
12431         An inflated generic class can be equal to a non-inflated one if it
12432         is inflated with generic type variables as type arguments.  Fixes
12433         bug #333798.
12435 2007-10-15  Dick Porter  <dick@ximian.com>
12437         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
12438         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
12439         81646.
12441         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
12442         instead of a monitor lock.  This means that monitor_try_enter and
12443         co can set the thread state safely.
12444         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
12445         thread_interrupt_requested, so interrupt actually works.
12447         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
12448         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
12449         state accessor function
12451 2007-10-15  Martin Baulig  <martin@ximian.com>
12453         * mono-debug.h
12454         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
12455         the debugger with the current runtime.
12457 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
12459         * object.c, object-internals.h: added the ability to set a single
12460         trampoline for all the slots in a vtable.
12462 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12464         * marshal.c: deal with a possible race condition during multicast
12465         delegate invocation.
12467 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12469         * class.c: ensure value type methods don't have the synchronized
12470         flag set.
12472 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
12474         * string-icalls.c, string-icalls.h: reverted unapproved patch that
12475         breaks the build.
12477 2007-10-11  Joel Reed  <joelwreed@comcast.com>
12479         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
12480         to take an options parameter so that empty entries can be removed during
12481         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
12483 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12485         * marshal.c: make sure we don't store the signature from a dynamic
12486         method into the runtime invoke cache (bug #327189).
12488 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12490         * marshal.c: make sure the wrapper methods are properly initialized.
12492 2007-10-11  Mark Probst  <mark.probst@gmail.com>
12494         * metadata.c, metadata-internals.h: Generalized
12495         mono_type_stack_size() to mono_type_stack_size_internal() which
12496         takes an additional argument specifying whether it allows open
12497         types.
12499 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
12501         * verify.c (do_invoke_method): handle typedbyref params
12502         correctly and check for unverifiable return values.
12504         * verify.c (do_newobj): fix a warning.
12506 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
12508         * verify.c: don't tread typedbyref as allways unverifable,
12509         so uses, like (ld/st)loc.0 are valid. verify for the cases
12510         that it matters, like boxing related operations.
12512 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
12514         * verify.c: add verification of the newobj opcode. verification
12515         of delegate instantation still missing due ldftn and virldftn not
12516         pushing the function type on stack
12518 2007-10-08  Mark Probst  <mark.probst@gmail.com>
12520         * class-internals.h: Runtime generic context data structure
12521         definition.
12523         * object.c: Initialization of runtime generic context at runtime
12524         vtable creation time.
12526 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
12527         * class.c (mono_class_create_from_typedef,
12528         mono_class_from_generic_parameter, mono_ptr_class_get,
12529         mono_fnptr_class_get, mono_bounded_array_class_get)
12530         * domain.c (mono_domain_create, mono_domain_free)
12531         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
12532         * image.c (do_mono_image_load, mono_image_close):
12533         Hooked up load-unload profiler events.
12535 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
12537         * domain.c: track statistics about the actual amount of native code
12538         allocated.
12540 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
12542         * class.c: the valuetype enumerators don't have the additional
12543         supertypes interfaces.
12545 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12547         * class.c: need more interfaces setup for the IEnumerator<T>
12548         object created for arrays (tests/ienumerator-interfaces.2.cs).
12550 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
12552         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
12554 2007-10-05  Alp Toker  <alp@atoker.com>
12556         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
12557         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
12558         #315863.
12560 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
12562         * verify.c (verify_type_compatibility_full): verification of
12563         compatibility improved, validates correctly non-strict checks between
12564         native int and I4 types different than (unsigned)int32.
12566         * verify.c (do_store_indirect): added, do all verification of
12567         ldind.X opcodes. 
12569         * verify.c (get_load_indirect_mono_type): renamed to
12570         get_indirect_op_mono_type, as it now returns the MonoType for 
12571         ldind.X and stind.X opcodes.
12573 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
12575         * reflection.c: Fix the encoding of generic type definition for
12576         TypeBuilders.
12578         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
12579         mono_image_typedef_or_ref but allows to specify if typespec lookups should
12580         be made. Typespec check is done prior to typeref cache lookup.
12582         * reflection.c (mono_image_typedef_or_ref): now just delegate to
12583         mono_image_typedef_or_ref_full.
12585         * reflection.c (encode_generic_class): encode the generic class
12586         directly instead of calling encode_type.
12588         * reflection.c (encode_type): encode the generic type definition
12589         MonoClass as a generic instantiation.
12591         * reflection.c (create_typespec): cache typespec tokens in
12592         the assembly->typespec cache. Don't create typespec for a generic
12593         instance MonoClass. Create typespec for the generic type defintion.
12595         * reflection.c (create_generic_typespec): encode the generic
12596         class directly instead of calling encode_type.
12598         * reflection.c (mono_image_create_token): encode the generic
12599         type definition not using a typespec for MonoType instances.
12602 2007-10-04  Raja R Harinath  <rharinath@novell.com>
12604         Fix #328812
12605         * class.c (mono_image_init_name_cache): Don't return nested
12606         'protected internal' classes.
12607         (mono_class_from_name_case): Likewise.
12609 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
12611         * icall-def.h, icall.c : get_bundled_machine_config() is now the
12612           common function used by both DefaultConfig in System.dll and
12613           InternalConfigurationHost in System.Configuration.dll.
12615 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
12617         * class.c: automatically add to vectors only a few essential explicit
12618         generic interfaces. The rest of the interfaces that arrays should
12619         provide are currently implicitly added (but still not lazily, see the
12620         design in the discussion of bug#325495 for the details of what is
12621         needed for that). Additionally, implicit interfaces are assigned the
12622         same vtable slot as the explicit interfaces (as they are compatible):
12623         this enables huge memory savings since we don't need to instantiate
12624         as many memthods and as large vtables anymore. Also, Since
12625         GetEnumerator<T> returns an instance of a type that is required to
12626         support a similarly large set of interfaces as arrays, we add
12627         implicit interfaces and interface offset sharing support to those
12628         types, too. This change adds all the required interfaces so that
12629         the anonarray.cs test case in the bug report works (we don't add
12630         all the interfaces to arrays of arrays 3-level deep and more because
12631         of the memory requirements explained in the bug and since they are much
12632         less common: the lazy-loading support will enabled them to work, too).
12634 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
12636         * verify.c (merge_stacks): major clean up, all type compatibility
12637         checks are done by verify_type_compatibility. This fix my earlier lack
12638         of understanding of the CLR type system and merge_stacks no longer looks
12639         scary.
12641         * verify.c: fixed some bad spelling.
12643 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
12645         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
12646         a given stack slock.
12647         
12648         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
12649         verify_type_compatibility_full. This removed a near indentical function and fixed
12650         handling of Int32 and IntPtr across all opcodes.
12652 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
12654         * class.c: only vectors have the additional generic interfaces.
12656 2007-10-01  Jonathan Chambers <joncham@gmail.com>
12658         * mono-config.c: Use g_strcasecmp instead of
12659         strcasecmp like everywhere else to fix
12660         compilation with MSVC.
12661         
12662         Code is contributed under MIT/X11 license.
12664 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12666         * object.c, object-internals.h: refactored the IMT code to enable
12667         building a single slot at a time and lazily creating the IMT trampolines
12668         and thunks.
12670 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
12672         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
12674         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
12675         Fixes #328501.
12676         
12677 2007-09-29  Raja R Harinath  <harinath@gmail.com>
12679         * loader.c (method_from_methodspec): Rearrange to avoid
12680         un-necessary exposition.  Don't assert out if the method's
12681         declaring type is a generic type definition.
12683 2007-09-28  Martin Baulig  <martin@ximian.com>
12685         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
12687 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
12689         * class-internals.h: optimize field layout of MonoClass to
12690         requires less cachelines at runtime and save a few bytes on 64 bit
12691         systems.
12693 2007-09-28  Jb Evain  <jbevain@novell.com>
12695         * reflection.c: when encoding type names in custom attributes,
12696         if the type is a closed generic type, its generic arguments
12697         have to be serialized as AssemblyQualifiedName, so that when
12698         they are deserialized, it's possible to re-create them properly.
12699         Fixes #329450.
12702 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
12704         * object.c, class-internals.h: added delegate-creation counter.
12706 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
12708         * class.c: cleanup of the code that synthetizes interfaces for
12709         arrays in 2.0: saves quit a bit of corlib mempool memory.
12710         Code to fix bug #325495 ifdeffed out for now until the issues
12711         with memory usage and O(n^2) behaviour are fixed.
12713 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
12715         * marshal.c: when possible, do not duplicate the name of the methods
12716         in the method builder and in the generated MonoMethod.
12718 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
12719         * verify.c: added support for type checking ldind_* opcodes.
12721 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
12723         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
12724         which is used to distinguish the fully open instantiation of a TypeBuilder
12725         with the rest. This temporary hack is required to restore the property that
12726         the fully open instantiation is the same type of the generic type definition.
12728         * class-internals.h (mono_generic_class_is_generic_type_definition):
12729         new function as part of the internal API.
12731         * class.c (inflate_generic_type): return NULL when the generic inst is
12732         fully open. The fully open generic type is now the same as the generic type
12733         definition for non TypeBuilder types.
12735         * class.c (mono_generic_class_get_class): removed assert since it is
12736         no longer valid, gklass->cached_class can point to the generic type definition.
12738         * class.c (mono_generic_class_is_generic_type_definition): new.
12740         * metadata.c (mono_generic_class_hash): added is_tb_open field
12741         to the hash calculation.
12743         * metadata.c (free_generic_class): if the generic class is associated
12744         with the generic type definition, its field will come from the mempool and
12745         must not be freed.
12747         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
12748         new, this function identifies the corner case of a TypeBuilder fully open
12749         instantiation.
12751         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
12752         for lookup. Set gclass->cached_class to be the container class in case of
12753         the fully open instantiation of non TypeBuilder types.
12755         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
12756         to compare generic classes.
12758         * reflection.c (method_encode_methodspec): remove assert that
12759         no longer is valid.
12761         * reflection.c (mono_reflection_generic_class_initialize): add
12762         an aditional assert to ensure the proper type is used.
12764 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
12766         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
12767         to enjoy it.
12769 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
12771         * verify.c (push_arg): Fixed support for ldarga
12772         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
12773         MonoType used as first arg in case of instance calls.
12775 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
12777         * verify.c: Support for verifying VAR and MVAR types, 
12779 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
12781         * icall.c (ves_icall_get_property_info): Set the reflected type of the
12782         accessors correctly.
12784 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
12786         * threads.c: support OSX and other systems in
12787         mono_thread_get_stack_bounds (bug #328026).
12789 2007-09-25  Martin Baulig  <martin@ximian.com>
12791         * mono-debug.h
12792         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
12794 2007-09-24  Martin Baulig  <martin@ximian.com>
12796         * mono-debug.h
12797         (MonoDebugClassEntry): Moved the definition of this struct into
12798         mono-debug.c to make it private.
12800         * mono-debug.c
12801         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
12802         type table per symbol file, we don't need to store the symfile id
12803         any longer.
12805 2007-09-24  Martin Baulig  <martin@ximian.com>
12807         Create one type table per symbol file, since a `MonoClass *' gets
12808         invalid when its image is unloaded.
12810         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
12811         (MonoDebugHandle): Added `type_table'.
12813 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
12815         * mempool.c, mempool.h: added mono_mempool_new_size () API
12816         to be able to specify a smaller initial size for the pool.
12817         Adjusted the code to slowly increase pool size before using
12818         the previous default size.
12819         * image.c: use a small initial size for image mempools.
12821 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
12823         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
12824         Fixes ##320990.
12826         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
12827         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
12829 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
12831         * metadata.c (mono_type_create_from_typespec): Remove an invalid
12832         free. Fixes #327438.
12834 2007-09-21  Raja R Harinath  <harinath@gmail.com>
12836         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
12837         generic instantiations, etc.
12838         <MONO_TYPE_ARRAY>: Likewise.
12840 2007-09-21  Martin Baulig  <martin@ximian.com>
12842         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
12843         these structs were never defined.
12844         (MonoDebugHandle): Removed the `_priv' field, it was never used.
12846 2007-09-21  Martin Baulig  <martin@ximian.com>
12848         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
12850 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
12852         * image.c: removed the guid hash tables: we can get the same info
12853         without the additional memory usage hit (partially fixes also bug #327052).
12855 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
12857         * profiler.h, profiler-private.h, profiler.c: add a new profiler
12858         event to handle unloading methods. After the event is called, the
12859         corresponding MonoMethod* must be considered invalid.
12860         * loader.c (mono_free_method): call the new mono_profiler_method_free
12861         event.
12863 2007-09-20  Mark Probst  <mark.probst@gmail.com>
12865         * domain-internals.h: New flag in MonoJitInfo which marks shared
12866         generic methods.  New hash table (shared_generics_hash) in
12867         MonoDomain to keep track of shared generic methods.  Prototypes
12868         for functions to register and lookup shared generic methods.
12870         * domain.c: Support for registering and looking up shared generic
12871         methods via a hash table (shared_generics_hash) in MonoDomain.
12873         * class-internals.h: New exception to signal failure of shared
12874         compilation of a generic method.  New counters for generics
12875         sharing in MonoStats.
12877 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
12879         * image.c, metadata-internals.h: don't keep a file descriptor open
12880         for loaded assemblies (bug#325988).
12882 2007-09-19  Raja R Harinath  <rharinath@novell.com>
12884         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
12885         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
12886         use the corresponding datatypes.
12887         (type_in_image): Update to changes.
12888         (CleanForImageUserData): Simplify.
12889         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
12890         Avoid quadratic behaviour in handling the "stolen" list by
12891         separating the filter predicate out, and by prepending the stolen
12892         items rather than appending them.
12893         (steal_ginst_in_image): Likewise.
12894         (mono_metadata_clean_for_image): Update to changes.
12896 2007-09-19  Martin Baulig  <martin@ximian.com>
12898         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
12900 2007-09-19  Martin Baulig  <martin@ximian.com>
12902         * mono-debug.c (mono_debug_cleanup): Don't call
12903         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
12905 2007-09-19  Raja R Harinath  <harinath@gmail.com>
12907         Fix crash on 'make run-test' in mcs/errors
12908         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
12909         Avoid more potential allocations in mono_class_from_mono_type.
12910         (ginst_in_image): Update to changes.
12911         (gclass_in_image): Rearrange slightly.
12913 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
12915         * class.c (mono_class_init): Move the code that sets up class->methods to 
12916         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
12918         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
12919         canonical instance of an inflated generic signature.
12920         (mono_type_create_from_typespec): Remove an invalid free.
12922         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
12924 2007-09-18  Marek Habersack  <mhabersack@novell.com>
12926         * domain-internals.h: added a declaration of the
12927         mono_assembly_load_full_nosearch internal function.
12929         * assembly.c (mono_assembly_load_with_partial_name): use
12930         mono_try_assembly_resolve return value properly.
12931         (mono_assembly_load_full_nosearch): copied the function body from
12932         mono_assembly_load_full, without the code to invoke assembly
12933         search hooks.
12934         (mono_assembly_load_full): calls the above new function and if the
12935         assembly is not resolved, invokes the search hooks.
12937         * appdomain.c (mono_runtime_init): restore the global postload
12938         assembly search handlers.
12940 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
12942         * class.c (mono_class_init): Make sure class->methods and class->properties
12943         are never NULL in the generics case.
12945         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
12947 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
12949         * metadata.c (free_generic_class): Disable some code to fix the build.
12951         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
12953         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
12954         from the image mempool.
12956         * metadata.c (free_generic_class): Free more data from the inflated class.
12958         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
12960         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
12961         mempool.
12962         (mono_type_create_from_typespec): Ditto.
12964         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
12965         MonoImage to the caller.
12966         (mono_init_internal): Save the opened image in a global variable.
12967         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
12969         * reflection.c (resolve_object): Fix a leak.
12971         * metadata.c: Fix the freeing of data in the generics caches.
12972         
12973         * metadata.c (free_generic_inst): Comment this out to fix the build.
12974         (free_generic_class): Ditto.
12976         * metadata.c: Free cached generic methods, instantinations and classes when
12977         they are removed from the caches.
12978         (mono_metadata_free_type): Free the type itself.
12980         * class.c: Free the result of mono_class_inflate_generic_type () in a few
12981         places.
12983 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12985         * boehm-gc.c: restrict managed allocs to __thread supporting
12986         architectures.
12988 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
12990         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
12991         (mono_generic_class_get_class): Fix a leak.
12993         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
12994         mono_metadata_free_type ().
12995         (mono_metadata_inflate_generic_inst): Fix a leak.
12997 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
12999         * mono-debug.c (free_header_data): Fix a leak missed earlier.
13001         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
13002         mempool.
13004         * mono-debug.c (mono_debug_close_image): Fix call to 
13005         g_hash_table_remove ().
13007 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
13009         * icall-def.h: redirect all the string ctor to the managed
13010         CreateString () methods.
13011         * string-icalls.c, string-icalls.h: removed dead code for string
13012         ctors and icalls.
13014 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
13016         * mono-debug.c: Fix memory leaks.
13018 2007-09-14  Jonathan Chambers <joncham@gmail.com>
13020         * threads-types.h: Implement mono_hazard_pointer_set and 
13021         mono_hazard_pointer_clear macros using do/while(0) to fix
13022         compilation with MSVC.
13023         
13024         Code is contributed under MIT/X11 license.
13026 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
13028         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
13029         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
13031 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13033         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
13034         icalls.
13036 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13038         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
13039         managed-code allocated as well.
13041 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
13043         * class.c (mono_class_is_assignable_from): Add support for generic variance.
13045 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
13047         * boehm-gc.c: fixed the build after the AOT changes.
13049 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
13051         * wrapper-types.h: Add an ALLOC wrapper type.
13053         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
13054         reference managed allocator methods.
13056 2007-09-12  Marek Safar  <marek.safar@gmail.com>
13058         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
13059         of Type array and not MonoType, a fix suggested by Hari.
13060         
13061 2007-09-12  Jonathan Chambers <joncham@gmail.com>
13063         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
13064         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
13065         
13066         Code is contributed under MIT/X11 license.
13068 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
13070         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
13072 2007-09-12  Marek Habersack  <mhabersack@novell.com>
13074         * image.c (do_mono_image_open): if assembly file fails to open and
13075         MONO_IOMAP is in effect, try to find the path in a
13076         case-insensitive way.
13078         * appdomain.c (mono_runtime_init): do not install postload hooks -
13079         tests show that MS.NET doesn't use anything of that sort to
13080         trigger the AppDomain.AssemblyResolve event.
13081         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
13082         made non-static.
13083         (mono_runtime_init): init portability helpers here.
13085         * assembly.c (mono_assembly_load_with_partial_name): if other   
13086         attempts fail, trigger the AppDomain.AssemblyResolve event handler
13087         to resolve the assembly.
13089         * domain-internals.h: added mono_try_assembly_resolve and marked
13090         it as internal.
13092 2007-09-11  Jb Evain  <jbevain@novell.com>
13094         * object-internals.h (MonoReflectionDynamicMethod): add
13095         a `MonoReflectionType *owner` field. The owner is used
13096         * reflection.c:
13097         (mono_reflection_create_dynamic_method): use the owner of the dynamic
13098         method as the class declaring the dynamic method.
13099         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
13100         dynamic method to the declaring type of the methodbuilder.
13102 2007-09-11  Mark Probst  <mark.probst@gmail.com>
13104         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
13105         rules for calling methods via reflection.
13107 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
13109         * reflection.c (resolve_object): Add support for MonoGenericClass. 
13110         Inflate MonoType's.
13112 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
13114         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
13115         provide a managed method that does fast allocations without needing
13116         a managed->unmanaged transition. Boehm GC implementation currently
13117         enabled for ptrfree objects on sane architectures.
13119 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
13121         * marshal.c, marshal.h: exported a couple of useful functions and
13122         added mono_mb_get_label () to easily handle backward branches.
13124 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
13126         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
13128 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
13130         * loader.c (find_method): Fixed the regression introduced while
13131         fixing bug #81466.
13133 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
13135         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
13136         well.
13137         
13138         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
13139         icall.c reflection.c: Pass a MonoGenericContext argument to 
13140         mono_lookup_dynamic_token ().
13142         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
13143         #82744.
13144         
13145 2007-09-09  Robert Jordan  <robertj@gmx.net>
13147         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
13148         for generic methods.
13150         * object.c (mono_object_get_virtual_method): Handle generic methods.
13151         Fixes bug #78882.
13153         Code is contributed under MIT/X11 license.
13155 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
13157         * image.c: fix locking in mono_image_load_file_for_image ().
13159 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
13161         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
13162         used only as a cache: added an icall to fill it.
13164 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
13166         * reflection.h: exposed mono_reflection_free_type_info
13167         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
13168         since mono_reflection_bind_generic_parameters makes a copy of it.
13169         * reflection.c (free_type_info): subinfos should be freed.
13170         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
13171         made non static.
13172         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
13173         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
13174         this fixes #82695 and #81726.
13175    
13177 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
13179         * process.h, process.c:  added support for user profile/info in
13180           ProcessStartInfo. For now only Windows works.
13182 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
13184         * metadata.c: consider the generic arguments when comparing
13185         signatures (bug #82614).
13187 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
13189         * cil-coff.h, image.c: updated assembly loader to cope with the
13190         PE32+ 64 bit file format.
13192 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
13194         * assembly.c, class.c, domain.c, loader.c: remove useless
13195         inclusion of cil-coff.h.
13197 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
13199         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
13200         if interface is marked with CoClassAttribute. 
13201    
13202         Code is contributed under MIT/X11 license.
13204 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
13206         * sgen-gc.c: ensure no object from the to space is copied again or finalized
13207         if it's seen twice in major collections.
13209 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
13211         * sgen-gc.c: big objects are not copied to the gray area, but they
13212         need to be considered for scanning, too, if they are brought alive
13213         by an object ready for finalizations or a survived one.
13215 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13217         * sgen-gc.c: properly account the number of disappearing links when
13218         they are nullified.
13220 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
13222         * sgen-gc.c: share the code to scan the registered roots between the
13223         different types of collections.
13225 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
13227         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
13229 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
13231         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
13232         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
13234 2007-08-28  Mark Probst  <mark.probst@gmail.com>
13236         * security-manager.c (mono_security_manager_get_methods):
13237         LinkDemandSecurityException now has 2 arguments instead of 3.
13239 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
13241         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
13242         platforms which need it.
13244 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
13246         * sgen-gc.c: unregister thread data structures with a pthread_key_t
13247         dtor.
13249 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
13251         * threads.c: free the thread static data on thread exit.
13253 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
13255         * class.c: walk the hierarchy to find the generic definition for
13256         a class (fixes runtime part of bug #82498).
13258 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
13260         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
13261         ...
13263         * image.c (mono_image_close): Here. Hopefully fixes #82510.
13265 2007-08-24  Mark Probst  <mark.probst@gmail.com>
13267         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
13269 2007-08-24  Robert Jordan  <robertj@gmx.net>
13271         * appdomain.c: don't perform the ':'->';' substitution on Win32.
13273 2007-08-24  Jb Evain  <jbevain@novell.com>
13275         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
13276         for byref types.
13278 2007-08-24  Mark Probst  <mark.probst@gmail.com>
13280         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
13281         #82286.
13283 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
13285         * assembly.c: Fix a warning.
13286         
13287 2007-08-23  Marek Habersack  <mhabersack@novell.com>
13289         * appdomain.c: parse the <runtime> section looking for the probing
13290         element with the 'privatePath' attribute, which sets additional
13291         directories in which the runtime should look for assemblies.
13293 2007-08-23  Robert Jordan  <robertj@gmx.net>
13295         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
13296         Fixes #82499.
13298 2007-08-23  Martin Baulig  <martin@ximian.com>
13300         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
13301         _mono_debug_init_corlib() and remove it from the header file.
13303 2007-08-23  Martin Baulig  <martin@ximian.com>
13305         * mono-debug-debugger.c
13306         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
13307         don't notify the debugger about it.
13309         * mono-debug-debugger.h
13310         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
13312 2007-08-23  Robert Jordan  <robertj@gmx.net>
13314         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
13315         Code is contributed under MIT/X11 license.
13317 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
13319         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
13321 2007-08-22  Martin Baulig  <martin@ximian.com>
13323         * mono-debug.c: Store debugging info on a per-domain basis and
13324         free it on domain unload.  Add support for unloading symbol files.
13326         * mono-debug.h
13327         (MonoDebugList): New typedef.
13328         (MonoSymbolTable):
13329         - add `data_tables and `type_table'.
13330         - replace 'symbol_files' and `num_symbol_files' with a
13331           `MonoDebugList *'.
13332         (mono_debug_data_table): Removed.
13333         (mono_debug_list_add): New public function.
13334         (mono_debug_list_remove): New public function.
13335         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
13336         (mono_debug_init_2_memory): Renamed into
13337         mono_debug_open_image_from_memory().
13338         (mono_debug_close_image): New public function.
13339         (mono_debug_domain_create): Likewise.
13340         (mono_debug_domain_unload): Likewise.
13341         (MONO_DEBUGGER_VERSION): Bump to 60.
13343         * mono-debug-debugger.h
13344         (MonoDebuggerEvent):
13345         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
13346         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
13347         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
13348         - rename `THREAD_CREATED' and `THREAD_EXITED' into
13349           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
13350         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
13351           meaning.
13352         (mono_debugger_add_symbol_file): Removed.
13353         (mono_debugger_add_type): Removed.
13354         (mono_debugger_lookup_type): Removed.
13355         (mono_debugger_lookup_assembly): Removed.
13357         * domain.c
13358         (mono_domain_create): Call mono_debug_domain_create().
13359         (mono_init_internal): Call mono_debug_init_corlib().
13361         * assembly.c
13362         (mono_assembly_close): Call mono_debug_close_image().
13364 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
13366         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
13367         mmap call.
13369 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
13371         * sgen-gc.c: ensure section->pin_queue_end is initialized
13372         correctly when non pinning objects in the section have been found.
13374 2007-08-22  Marek Habersack  <mhabersack@novell.com>
13376         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
13377         containing a list of directories separated by ':'. MSDN docs say
13378         the directories should be separated with ';'. Part of a bugfix for
13379         bug #81446
13381 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
13383         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
13384         it should MonoType and not MonoClass.
13386 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
13388         * culture-info-table.h : regenerated.
13390 2007-08-20  William Holmes  <billholmes54@gmail.com>
13392         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
13393          to call ReplaceFile Kernel32 on windows or in io-layer.
13394         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
13395         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
13396          as an internal call.
13398         Code is contributed under MIT/X11 license.
13400 2007-08-20  Jb Evain  <jbevain@novell.com>
13402         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
13403         and MONO_EXCEPTION_FIELD_ACCESS.
13405         * debug-helpers.[c|h]: new mono_field_full_name function.
13407 2007-08-20  Mark Probst  <mark.probst@gmail.com>
13409         * class.c: Removed class_security_level() and moved it to
13410         security-core-clr.c.
13412         * security-core-clr.c, security-core-clr.h: class_security_level()
13413         is now public and renamed to mono_security_core_clr_class_level().
13414         It also looks for security attributes in the classes a class is
13415         nested in.
13417 2007-08-20  Mark Probst  <mark.probst@gmail.com>
13419         * security-core-clr.c, security-core-clr.h: CoreCLR security
13420         utility functions.
13422         * Makefile.am: Added security-core-clr.[ch].
13424         * security-manager.c, security-manager.h: Functions and enum for
13425         setting and getting the security mode.
13427         * class.c: CoreCLR security checks.
13429 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
13431         * icall-def.h, process.c, process.h: implemented icall to get
13432         user/system processor times.
13434 2007-08-17  Mark Probst  <mark.probst@gmail.com>
13436         * domain.c, threads.c, class-internals.h, domain-internals.h: New
13437         reader-lock-free jit_info_table.
13439 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
13441         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
13443         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
13445         * object-internals.h (MonoException): Add missing _data member.
13447 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
13449         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
13450         checking that only methods with matching qname or fqname are picked
13451         from implemented interfaces.
13453 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13455         * verify.c (do_newarr):added, do type verification of
13456         newarr ops, push the right value on the eval stack.
13457         * verify.c (mono_method_verify): use do_newarr
13460 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13462         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
13463         factored the common code into get_boxable_mono_type, which
13464         is now using mono_type_get_full, this fixed byref related tests.
13466 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
13468         * class.c: added mono_type_get_full, this function has the same
13469         behavior of mono_class_get_full but the returned MonoType has
13470         all metadata of the associated token in case of a typespec token.
13471         * class.c: added mono_type_retrieve_from_typespec, used by 
13472         mono_type_get_full to retrieve the token type.
13473         * class.c (mono_class_create_from_typespec): changed to use
13474         mono_type_retrieve_from_typespec.
13475         * class.c (mono_ldtoken): changed to use mono_type_get_full
13476         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
13477         * class-internals.h: exported mono_type_get_full for internal use.
13479 2007-08-16  Jb Evain  <jbevain@novell.com>
13481         * domain.c (supported_runtimes): add entry for
13482         the 'moonlight' runtime version.
13484 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13486         * verify.c (mono_method_verify): small typo sliped in.  
13488 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13490         * verify.c (do_unbox_value): added, do type verification of
13491         unboxing ops
13492         * verify.c (mono_method_verify): use do_unbox_value
13495 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13497         * verify.c (dump_stack_value): fixed typo, was printing string
13498         instead of object on stack.
13499         * verify.c (do_box_value): moved the byref check up as it leads
13500         to invalid code and should be done earlier.
13501         * verify.c: improved error messages for and ldobj
13503 2007-08-15  William Holmes  <billholmes54@gmail.com>
13505         * marshal.c (emit_marshal_custom): Omit the call to 
13506           marshal_native_to_managed when calling native to managed 
13507           and the argument is specified as an out argument.
13509         Code is contributed under MIT/X11 license.
13511 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
13513         * verify.c: fixed the type checks for generics, function pointers and vectors.
13514         Added type verification for ldobj and ldtoken. The verifier
13515         would segfault if header or signature of a method contained references
13516         to non-existant types.
13518 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
13520         * marshal.c (cominterop_get_ccw): Patch from
13521         Bill Holmes to no walk up interface hierarchy. 
13522         All parent methods should be present in the interface for COM.
13523    
13524         Code is contributed under MIT/X11 license.
13526 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
13528         * marshal.c (emit_marshal_com_interface): Patch from
13529         Bill Holmes to handle COM Interfaces as return values
13530         for native->managed calls.
13531    
13532         Code is contributed under MIT/X11 license.
13534 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
13536         * marshal.c (cominterop_get_idispatch_for_object): Implement
13537         for runtime callable wrappers.
13538    
13539         Code is contributed under MIT/X11 license.
13541 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
13543         * pedump.c (main): changed from mono_init to mono_init_from_assembly
13544         so 2.0 types are accessible
13547 2007-08-13  Miguel de Icaza  <miguel@novell.com>
13549         * domain.c (mono_init_internal): Call mono_assembly_load_friends
13550         once we load mscorlib.   Due to the order in which we initialize,
13551         the mono_assembly_load_full routine that loads mscorlib did not
13552         load friends.   We now load it once we load the
13553         mono_defaults.internals_visible_class class. 
13555         * assembly.c: Expose the mono_load_friend_assemblies method.
13557 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
13559         * verify.c: improved the handling of boxing, better
13560         type checking for unary ops and conversion. Fix bug
13561         regarding managed pointer compatibility checking
13563 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
13565         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
13567         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
13569 2007-08-09  Raja R Harinath  <rharinath@novell.com>
13571         * reflection.c (dup_type): Remove.
13572         * class.c (dup_type): Remove.
13573         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
13574         instead of the dodgy 'dup_type'.
13575         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
13576         handle the case where 'dup_type' needed the second argument.
13578 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
13580         * domain.c: Fix a warning.
13582 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
13584         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
13585         checking that methods with the same fqname are not overridden
13586         with a method from an ancestor.
13588 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
13590         * threads.c (free_thread_static_data_helper): Avoid a crash if
13591         thread->static_data is not yet set.
13593 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
13595         * marshal.c: Use correct image when emitting
13596         native wrapper for COM calls.
13597    
13598         Code is contributed under MIT/X11 license.
13600 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
13602         * icall-def.h, security.c, security.h :
13603           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
13605 2007-08-07  Martin Baulig  <martin@ximian.com>
13607         * mono-debug-debugger.h
13608         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
13610         * domain.c (mono_domain_free): Call
13611         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
13613 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
13615         * verify.c (check_underflow, check_overflow): error message now returns IL offset
13616         * verify.c (in_same_block): code should test if either offset is inside the clauses
13617         * verify.c (mono_method_verify): push the exception into the eval stack of exception
13618         and filter blocks
13620 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
13622         * image.c (mono_image_close): Fix a leak.
13624         * object.c (mono_runtime_invoke_array): Avoid using alloca.
13626         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
13628 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
13630         * domain.c, threads.c, threads-types.h: fix memory retention issue
13631         with thread static variables not being cleared on domain unload.
13632         Reuse thread static slots after domain unload.
13634 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
13636         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
13637         nullable type.
13639         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
13640         now done in mono_runtime_invoke_array.
13642         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
13643         receiver is a nullable type.
13645         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
13646         generic parameter.
13648 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
13650         * marshal.c: Implement COM Objects as return type for 
13651         managed->unmanaged calls. Added Release calls for COM Object
13652         out/return values in managed->unmanaged calls.
13654         Code is contributed under MIT/X11 license.
13656 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
13658         * threads.h, threads-type.h: move the hazard pointer declarations
13659         to the private header.
13661 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
13663         * file-io.c, appdomain.c: memory leak fixes.
13665 2007-08-02  Dick Porter  <dick@ximian.com>
13667         * socket-io.c
13668         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
13669         SO_REUSEADDR setting into io-layer/sockets.c.
13671 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
13673         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
13674         from Object when called on a generic parameter. Fixes #82211.
13676 2007-08-01  Dick Porter  <dick@ximian.com>
13678         * file-io.c (convert_share): Test FileShare values bit-by-bit.
13679         Fixes bug 79250 yet again.
13681 2007-07-30  Martin Baulig  <martin@ximian.com>
13683         Merged the `debugger-dublin' branch.
13685         * mono-debug.h
13686         (MonoDebugDataTable): New typedef.
13687         (MonoDebugMethodAddressList): New typedef.
13688         (MonoDebugWrapperData): Removed.
13689         (MonoDebugSymbolTable): Removed `current_data_table',
13690         `current_data_table_size', `current_data_table_offset'.
13691         (MonoDebugDataItemType): Moved into mono-debug.c.
13692         (MonoDebugMethodJitInfo): Remove `address'.
13693         (mono_debug_data_table): New global variable.
13694         (mono_debug_lookup_method_addresses): New public function.
13695         (mono_debug_find_method): Take a `MonoMethod *', not a
13696         `MonoDebugMethodInfo *'.
13698         * mono-debug.c: Drop support for the old symbol tables.
13700 2007-06-28  Martin Baulig  <martin@ximian.com>
13702         * mono-debug.c (mono_debug_debugger_version): New public variable.
13704 2007-07-31  William Holmes  <billholmes54@gmail.com>
13706         * metadata.c Changed mono_type_create_from_typespec to not insert
13707           the type into the hash map until after
13708           do_mono_metadata_parse_type has completed.
13709         Fixes Bug #82194
13710         Code is contributed under MIT/X11 license.
13712 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
13714         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
13715         generic parameter. Fixes #82211.
13717 2007-07-27  Jb Evain  <jbevain@novell.com>
13719         * pedump.c (dump_metadata, dump_metadata_header): dump
13720         versions contained in the metadata header.
13722 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13724         * threads.c: register small_id_table with the GC.
13726 2007-07-27  Mark Probst  <mark.probst@gmail.com>
13728         * threads.c, threads.h, class-internals.h, object-internals.h:
13729         Hazard pointers, to be used by lock-free parallel algorithms.
13731 2007-07-26  Dick Porter  <dick@ximian.com>
13733         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
13734         routine on non-windows platforms, as I've not managed to think of
13735         a non-kludgy way of doing this.  Finishes off bug 78739.
13737 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
13739         * object.c: properly setup interface_bitmap in proxy vtables.
13741 2007-07-25  Marek Habersack  <mhabersack@novell.com>
13743         * appdomain.c (get_shadow_assembly_location): do not use TickCount
13744         to create unique shadow copy target directories, use the domain's
13745         serial number instead. Each domain gets a unique target directory
13746         that way.
13748         * domain.c (mono_domain_create): added code to increment domain
13749         shadow copy serial number and cache the value in the current
13750         domain structure.
13752         * domain-internals.h (struct _MonoDomain): added a new field -
13753         shadow_serial to hold the serial number used in generation of
13754         shadow-copy directories. This is to make sure that the directory
13755         name is unique for each and every domain created. We avoid a race
13756         condition with overriding assemblies already in use by other app
13757         domains.
13759 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
13761         * class.c (mono_bounded_array_class_get): fixed memory leak when 
13762         binding generic parameters.
13764 2007-07-24  Raja R Harinath  <rharinath@novell.com>
13766         * metadata.c (do_mono_metadata_parse_generic_class): Use
13767         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
13768         error.
13770 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
13772         * loader.c, class-internals.h, reflection.c: removed the per-method
13773         generics hashtable: we use the global one through the call of
13774         mono_class_inflate_generic_method ().
13776 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
13778         * class.c, metadata.c, class-internals.h: introduce yet another
13779         generics global cache for inflated methods (fixes 98% of the perf
13780         issue in bug #81806).
13782 2007-07-23  Raja R Harinath  <rharinath@novell.com>
13784         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
13785         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
13786         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
13787         return a MonoGenericInst containing (a copy) of those types.
13788         (mono_metadata_inflate_generic_inst): Update to changes.
13789         (mono_metadata_parse_generic_inst): Likewise.
13790         (mono_get_shared_generic_inst): Likewise.
13791         * reflection.c (mono_class_bind_generic_parameters): Likewise.
13792         (mono_reflection_bind_generic_method_parameters): Likewise.
13793         * metadata-internals.h: Likewise.
13794         * icall.c (free_generic_context): Kill.
13795         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
13797         * reflection.c (reflection_methodbuilder_to_mono_method): Use
13798         mono_metadata_type_dup.
13799         * marshal.c (mono_mb_create_method): Likewise.
13801         * metadata.c (mono_metadata_type_dup): Rename from
13802         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
13803         MonoImage.  Handle a few more cases, esp. when no mempool is given.
13804         * marshal.c, metadata-internals.h: Update to changes.
13806 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13808         * class.c: fixed a small leak for array classes and removed warning.
13810 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
13812         * loader.c (mono_method_get_param_token): Make this work on generic methods.
13813         Return 0x8000000 for return parameters. Fixes #82161.
13815 2007-07-21  Marek Habersack  <grendello@gmail.com>
13817         * appdomain.c (get_shadow_assembly_location): append the current
13818         ticks value to the path. Avoids overwriting the same assemblies by
13819         several threads at the same time.
13821 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
13822         and Raja R Harinath  <rharinath@novell.com>
13824         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
13825         Simplify slightly.
13826         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
13827         property for testing if a method is a generic method definition.
13829 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
13831         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
13833 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13835         * verify.c: used function from private branch, reverted to the one in class.h 
13837 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13839         * verify.c: a typo slipped in and the code wont compile
13841 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13843         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
13844         disabled box instruction as it is doing the wrong thing
13845         improved stack dump messages, now it is easier to debug type related issues
13848 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
13850         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
13852 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13854         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
13855         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
13856         grouped with class and valuetype. This change will simply 
13857         the code as it should be handled just like unmanaged pointers.
13859 2007-07-19  Mark Probst  <mark.probst@gmail.com>
13861         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
13863 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
13865         * verify.c: several stack merge issues fixed, reference comparisons now
13866         check the type size. strict type check now works correctly.
13867         added more uses of IS_MANAGED_POINTER macro.
13868         fixed issues pointed by running the test suite against .net.
13869         
13871 2007-07-19  Mark Probst  <mark.probst@gmail.com>
13873         * class.c, loader.c, class-internals.h: Removed the
13874         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
13875         defines.
13877         * icall.c: Better error checking in some internal reflection
13878         methods.
13880 2007-07-18  William Holmes  <billholmes54@gmail.com>
13882         * filewatcher.c : removed unused variable 'filename' in 
13883           ves_icall_System_IO_FSW_SupportsFSW
13885 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
13887         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
13888         obsolete, removed.
13890 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
13892         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
13893         
13894         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
13896 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
13898         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
13899         Implement generics support.
13900         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13902         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
13903         type_args and method_args arguments.
13904         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
13905         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13906         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
13908 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
13910         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
13911           It adds a rootimage parameter to mono_reflection_get_type_internal,
13912           adds new function mono_reflection_get_type_with_rootimage and use
13913           the rootimage to resolve the types instead of the current image
13915 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
13917         * culture-info-table.h: Forgot to update after r78304.
13919 2007-07-13  Raja R Harinath  <rharinath@novell.com>
13921         * class.c (mono_class_is_open_constructed_type)
13922         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
13924 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
13926         * class.c (mono_bounded_array_class_get):  method fails if used with
13927         an incomplete TypeBuilder enum (no basetype field), fixed it by 
13928         avoiding calculating the size for such array as it cannot be instantiated.
13929         Fix bug #82015
13931 2007-07-12  Raja R Harinath  <rharinath@novell.com>
13933         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
13934         field.
13935         * metadata.c, reflection.c: Update to changes.
13937 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
13939         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
13940         mono_class_is_valid_enum, they are used to valide a enum when loading.
13941         * reflection.c: used new functions to throw TypeLoadException when and
13942         invalid enum is build with TypeBuilder. Fixes #82018
13943   
13944 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
13946         * object.c: forgot commit of mono_class_setup_methods () to access
13947         iface->methods.
13948         * object-internals.h: added a few more handy fields to
13949         MonoIMTCheckItem.
13951 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
13953         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
13954         iface->methods.
13956 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
13958         * class-internals.h, object-internals.h, object.c: IMT-based
13959         interface invocation core from Massimiliano Mantione
13960         (massi@ximian.com) with a reworked arch-specific interface,
13961         bsearch implementation and a few bugfixes and memory savings by me.
13963 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
13965         * class.c (mono_class_create_from_typedef): mono would segfault if 
13966         an enum did not have a __value field. It now throws a TypeLoadException
13967         for such cases. Fix bug #82022
13969 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
13971         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
13973 2007-07-09  Mark Probst  <mark.probst@gmail.com>
13975         * class.c (mono_class_init): If a class is already inited but has
13976         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
13978 2007-07-09  Mark Probst  <mark.probst@gmail.com>
13980         * class.c: Properly handle the case of an unimplemented interface
13981         method.  Fixes: 81673.
13983 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
13985         * class-internals.h, object.c: cleanup patch from massi: use
13986         MonoVTable->interface_bitmap since the vtable interfaces offset array
13987         is going away.
13989 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
13991         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
13992         GetMDStreamVersion icall instead.
13994 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
13996         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
13997         not use mono_dl_build_path() with a full library name: makes
13998         fallbacks to libgaim and libfam work.
14000 2007-07-06  William Holmes  <billholmes54@gmail.com>
14002         * assembly.c: Added a continue statement in probe_for_partial_name when
14003          parse_assembly_directory_name fails.  Fixes : 82002
14005 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
14007         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
14008         and added a verification  for TYPEDBYREF.
14009         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
14010         make native int interchangeable with int32 and some small cleanup and formating.
14011         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
14012         handle byref of byref.
14013         * verify.c (push_local): handle byref of byref.
14014         * verify.c (do_binop): invalid mix of values is unverifiable
14015         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
14016         added visibility checks
14017         * verify.c (field related method): added visibility checks
14018         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
14020 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
14022         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
14023         string.
14025 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
14027         * profiler.c (mono_profiler_load): Fix an off-by-one error.
14029         * marshal.c (emit_marshal_string): When returning a string from managed code,
14030         allways make a copy even for unicode strings. Fixes #81990.
14032 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
14034         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
14035         of byref generic inst types (bug #81997).
14037 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
14039         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
14040         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
14042 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
14044         * marshal.c (emit_marshal_string): Add support for unicode strings in
14045         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
14047 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
14049         * verify.c: field load/store are now verified, missing only access checks now
14051 2007-06-28  Martin Baulig  <martin@ximian.com>
14053         * mono-debug.c (mono_debug_debugger_version): New public variable.
14055 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
14057         * locales.c: When constructing DateTimeFormat or NumberFormat for
14058         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
14059         MonoCultureInfo contructed from the current locale is always
14060         read-only and has UseUserOverride set to true. All MonoCultureInfo
14061         instances returned for GetCultures have both IsReadOnly and
14062         UseUserOverride set to true. Fixes part of bug #81930.
14064 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
14066        * icall-def.h: Update System.__ComObject icalls
14067        * marshal.c: Avoid managed transition (and object creation)
14068        when looking up COM interface in RCW.
14069        * marshal.h: Ditto.
14070        
14071        Code is contributed under MIT/X11 license.
14073 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
14075         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
14076         to avoid crashes during assembly unloading.
14078 2007-06-22  Raja R Harinath  <rharinath@novell.com>
14080         Fix MethodInfo.IsGenericMethodDefinition
14081         * reflection.c (mono_reflection_bind_generic_method_parameters):
14082         Rearrange code to ensure we always uses a generic method definition.
14083         * class.c (mono_class_inflate_generic_method_full): Set
14084         'generic_container' field only for generic method definitions.
14085         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
14086         Use presense of 'generic_container' field as indication of being a
14087         generic method definition.
14089 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
14091         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
14093         * object-internals.h: Reflect changes in the layout of the managed Delegate
14094         class.
14095         
14096         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
14097         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
14098         runtime memory used by the dynamic method. Fixes #77146.
14100 2007-06-21  Dick Porter  <dick@ximian.com>
14102         * file-io.h: 
14103         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
14104         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
14105         81767.
14107 2007-06-21  Raja R Harinath  <rharinath@novell.com>
14109         * reflection.c (method_encode_methodspec): Add a tripwire.
14110         * class.c (inflate_generic_type): The fully open generic type is
14111         not the same as the generic type definition.
14113 2007-06-21  Martin Baulig  <martin@ximian.com>
14115         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
14117         * mono-debug-debugger.h
14118         (MonoDebuggerBreakpointInfo): Removed.
14119         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
14120         (mono_debugger_remove_breakpoint): Likewise.
14121         (mono_debugger_breakpoint_callback): Likewise.
14122         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
14124 2007-06-21  Raja R Harinath  <rharinath@novell.com>
14126         * metadata.c (mono_metadata_lookup_generic_class): The fully open
14127         generic type is not the same as the generic type definition.
14128         * class.c (mono_generic_class_get_class): Likewise.
14130 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
14132         * icall.c: The second argument to 
14133         System.Reflection.MethodBase.GetMethodFromHandleInternalType
14134         is a MonoType not a MonoClass.
14136 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
14138         * verify.c: support for function pointers in the verifier
14140 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
14142         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
14144 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
14146         * assembly.c: removed Mono.Data.SqliteClient from the list of
14147         forward-compatible assemblies as it breaks the ABI (bug #81899).
14149 2007-06-19  Raja R Harinath  <rharinath@novell.com>
14151         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
14152         lookup/update with the loader lock.
14153         * reflection.c (mono_class_bind_generic_parameters): No need to
14154         protect mono_metadata_lookup_* with the loader lock.
14155         * class.c (inflate_generic_type): Likewise.
14156         
14157         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
14158         on a generic instantiated type.
14160 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
14162         *verify.c: produce meanfull error messages on verification error
14163         *verify.c: fixed some cases of verification errors reported as validation errors
14164         *pedump.c: fixed the error name array, now it shows validation errors properly
14165         *verify.h: fixed the contant that should be used for verification errors
14167 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
14169         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
14170         for bug #77596, 81858 and 80743 (generics data structures on domain
14171         unload).
14173 2007-06-15  Raja R Harinath  <rharinath@novell.com>
14175         Avoid allocating 'MonoGenericContext' on the heap.
14176         * class-internals (_MonoMethodInflated::context): Make field
14177         inline, not a pointer.
14178         * loader.c (method_from_methodspec): Allocate 'new_context' on the
14179         stack.  Use the context embedded within the inflated method as the
14180         hash key, rather than 'new_context'.
14181         * class.c (inflate_generic_context): Simplify.  Return a struct
14182         rather than allocating on the heap.
14183         (mono_class_inflate_generic_method_full): Update to changes.  Now,
14184         doesn't salt away a copy of the context -- simplifying the
14185         lifetime rules of a 'MonoGenericContext *'.
14186         (mono_method_get_context): Return pointer to embedded context.
14187         (setup_generic_array_ifaces): Allocate temporary context on stack.
14188         * reflection.c (inflate_mono_method): Likewise.
14189         (mono_reflection_bind_generic_method_parameters): Likewise.
14190         Use the context embedded within the inflated method as the hash key.
14192         Avoid a source of allocation of 'MonoGenericContext'.
14193         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
14194         and 'cached_context' fields into embedded 'MonoGenericContext' field.
14195         * class.c: Update to changes.
14196         (mono_generic_class_get_context): Simplify drastically.  Now just
14197         returns a pointer to the field.
14198         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
14199         argument as a const pointer.
14200         (mono_metadata_generic_context_equal): Likewise.
14201         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
14202         Update to changes.
14204 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
14206         * verify.c improved the handling of brtrue/brfalse, factored out common code
14208 2007-06-14  Raja R Harinath  <rharinath@novell.com>
14210         Kill MonoGenericMethod.
14211         * class-internals.h (MonoGenericContext::method_inst): Rename from
14212         'gmethod' and convert to a MonoGenericInst.
14213         (MonoGenericMethod): Remove.
14214         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
14215         * loader.c (method_from_methodspec): Update to changes.  Use a
14216         MonoGenericContext as the key to the hashtable.
14217         * metadata.c (mono_metadata_generic_context_equal): Rename from 
14218         'mono_metadata_generic_method_equal' and take MonoGenericContext.
14219         (mono_metadata_generic_context_hash): Likewise from
14220         'mono_metadata_generic_method_hash'.  Change hash function.
14221         (mono_metadata_load_generic_params): Update to changes.
14222         (mono_get_shared_generic_method): Remove.
14223         * metadata-internals.h (mono_get_shared_generic_method): Remove.
14224         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
14225         (inflate_generic_context): Likewise.
14226         (mono_class_inflate_generic_method_full): Likewise.
14227         (setup_generic_array_ifaces): Likewise.
14228         (mono_class_create_from_typespec): Likewise.
14229         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
14230         (method_encode_methodspec): Update callsite.
14231         (reflection_methodbuilder_to_mono_method): Update to changes.
14232         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
14233         MonoGenericContext as the key to the hashtable.
14234         (inflate_mono_method): Update to changes.
14236         * class-internals.h (MonoGenericMethod::container): Remove.
14237         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
14239 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
14241         * profiler-private.h, profiler.c, profiler.h: added API to profile
14242         exception events.
14244 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
14246         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
14248 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
14250         * verify.c: method invocation is now validated, now we verify parameter types on stack.
14251         Fixed overflow and underflow not aborting the verification process.
14253 2007-06-13  Mark Probst  <mark.probst@gmail.com>
14255         * class-internals.h (MonoStats): Added stats entries for dynamic
14256         code allocations.
14258 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
14260         * loader.c (mono_free_method): Free header->locals and header->clauses.
14262         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
14263         dynamic case.
14265         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
14267         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
14269 2007-06-12  Raja R Harinath  <rharinath@novell.com>
14271         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
14272         the tables.
14274 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
14276         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
14278 2007-06-11  Raja R Harinath  <harinath@gmail.com>
14280         MonoGenericMethod on a diet
14281         * class-internals.h (_MonoMethodInflated::reflection_info): Move
14282         here ...
14283         (_MonoGenericMethod::reflection_info): ... from here.
14284         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
14285         Update to changes.
14286         * reflection.c (inflate_mono_method): Likewise.
14287         (mono_reflection_bind_generic_method_parameters): Likewise.
14289 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
14291         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
14292         *verify.c: factored long ldarg forms to share code with short forms
14294 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
14296         *verify.c: fixed code formating factored some duplicate code
14297         into a new function
14299         *verify.h: fixed binary incompatibility introduced earlier
14301         *pedump.c: fixed formating
14303 2007-06-11  Raja R Harinath  <harinath@gmail.com>
14305         Fix assertion when disassembling Mono.C5.dll
14306         * loader.c (method_from_methodspec): Avoid inflating a method
14307         twice with the same context.  If the methodref is inflated, use
14308         the declaring method instead.
14310         * class.c (mono_class_from_generic_parameter): Fix case similar to
14311         bug #81830 handled below, but for method containers.
14313 2007-06-10  Raja R Harinath  <harinath@gmail.com>
14315         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
14316         get_shared_generic_class.  Directly inflate the instance.
14317         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
14318         (inflate_generic_class): Delete.
14319         (get_shared_generic_class): Delete.  Move setting of
14320         'cached_class' and 'cached_context' ...
14321         * metadata.c (mono_metadata_lookup_generic_class): ... here.
14323         * metadata.c (mono_metadata_lookup_generic_class): Change
14324         signature to take the components of a MonoGenericClass rather than
14325         an allocated MonoGenericClass.  Change semantics to be intern-like.
14326         * reflection.c (mono_class_bind_generic_parameters): Update to
14327         changes.  Make locking region tighter.
14328         * class.c (inflate_generic_class): Update to changes.
14329         (get_shared_generic_class): Likewise.
14330         * metadata-internals.h: Likewise.
14332         * reflection.c (mono_class_bind_generic_parameters): Take and
14333         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
14334         (mono_reflection_bind_generic_parameters): Use
14335         'mono_class_bind_generic_parameters' rather than duplicate the code.
14336         * class.c (mono_bounded_array_class_get): Update to changes.
14337         * object-internals.h: Likewise.
14339         * reflection.c (mono_class_bind_generic_parameters): Only support
14340         parameterizing generic type definitions.  Remove support for other
14341         open types.
14343 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
14345         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
14347         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
14348         in the dynamic case.
14350 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
14352         * threads.c: When cleaning up thread, reset the Background bit.
14353         Fixes bug #81720.
14355 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
14357        * metadata.c: Move variable declarations to top of scope.
14358        * verify.c: Move variable declarations to top of scope.
14360        Code is contributed under MIT/X11 license.
14362 2007-06-08  Raja R Harinath  <rharinath@novell.com>
14364         * reflection.c (mono_class_bind_generic_parameters): Replace
14365         open-coded loop with mono_metadata_inflate_generic_inst.
14367         * class.c (get_shared_generic_class): Don't call
14368         mono_get_shared_generic_inst.  Use the container's own
14369         'class_inst'.
14371         * metadata.c (mono_metadata_load_generic_params): Move
14372         initialization of 'context' field here from ...
14373         * class.c (mono_class_create_from_typedef): ... here, and ...
14374         * loader.c (mono_get_method_from_token): ... here.
14376         * class.c (get_shared_generic_class): Rename from
14377         mono_get_shared_generic_class and make static.
14378         (mono_get_shared_generic_inst): Move to metadata.c.
14379         * loader.c (mono_get_shared_generic_method): Likewise.
14380         * class-internals.h, metadata-internals.h: Update to changes.
14382         Fix #81830
14383         * class.c (mono_class_from_generic_parameter): Don't assume a
14384         generic container owner exists.  Generic containers from monodis
14385         don't have any.
14387 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
14389         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
14390         * verify.h: new typedefs to returns the non-verifiable status
14391         * verify.c: initial implementation of generics, stack merging and object compatibility check
14393 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14395         * class.c, image.c, class-internals.h (MonoImage): class_cache is
14396         a MonoInternalHashTable again (fixed bug in internal hash table
14397         code).
14399 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14401         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
14402         MonoInternalHashTable again (fixed bug in internal hash table
14403         code).
14405 2007-06-06  Mark Probst  <mark.probst@gmail.com>
14407         * class.c, image.c, class-internals.h, domain.c,
14408         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
14409         changes.  Have to figure out what makes them break the SWF
14410         regression.
14412 2007-06-04  Mark Probst  <mark.probst@gmail.com>
14414         * class.c, image.c, class-internals.h (MonoImage): class_cache is
14415         a MonoInternalHashTable now.
14417 2007-06-04  Mark Probst  <mark.probst@gmail.com>
14419         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
14420         MonoInternalHashTable now.
14422 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
14424         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
14425         invoke_impl code.
14427         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
14429         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
14430         dependent trampoline.
14432         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
14434         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
14436 2007-05-29  Robert Jordan  <robertj@gmx.net>
14438         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
14440 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
14442         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
14444 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
14446        * marshal.c: Fix interface lookup loops for
14447        cominterop_get_com_slot_for_method and 
14448        cominterop_get_method_interface. Only need to lookup
14449        if type is a class, else use interface type method is on.
14451        Code is contributed under MIT/X11 license.
14453 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
14455         * reflection.c: HasSecurity can be present even if no specially 
14456         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
14457         SecurityAttribute). Fix CAS regression tests on buildbot.
14459 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
14461        * appdomain.c: Add configure checks for header files.
14462        * image.c: Add configure checks for header files.
14463        * file-io.c: Add configure checks for header files.
14464        * debug-mono-symfile.c: Add configure checks for header files.
14465        * threadpool.c: Add configure checks for header files.
14466        * console-io.c: Add configure checks for header files.
14467        * profiler.c: Add configure checks for header files.
14468        * rawbuffer.c: Add configure checks for header files.
14469        * icall.c: Add configure checks for header files.
14470        * rand.c: Add configure checks for header files.
14471        * socket-io.c: Add configure checks for header files.
14473        Code is contributed under MIT/X11 license.
14475 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
14477         * reflection.c (mono_custom_attrs_from_builders): Remove the 
14478         assertion as it breaks the build.
14479         
14480         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
14482         * reflection.c (lookup_custom_attr): Make a copy here too.
14484         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
14485         dynamic images.
14487         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
14488         images.
14490         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
14491         info.
14493 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
14495         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
14496         (load_cattr_value): Ditto.
14498 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
14500         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
14502 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
14504         * threads.c: In "start_wrapper", set apartment_state to MTA if
14505         apartment_state is Unknown and we're running on 2.0 profile or
14506         higher.
14507         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
14508         to main method, then set apartment_state to Unknown on 1.0 profile,
14509         and MTA on 2.0 profile.
14511 2007-05-16  Jb Evain  <jb@nurv.fr>
14513         * class-internals.h (MonoDefaults): Add an attribute_class and
14514           customattribute_data_class.
14515         * domain.c (mono_init_internal): Populate them.
14516         * reflection.c: Use them to remove duplicates. Make a vew
14517         MonoClass variables `static'.
14519 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
14521         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
14522         step in implementing IMT, so that all isinst checks now can go
14523         through the bitmap.
14524         This was needed because vtables for TransparentProxy need to look
14525         like the vtable of the "target" class, so they need to point to
14526         its interface bitmap directly.
14528         * object.c: inside "mono_class_create_runtime_vtable" and
14529         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
14531 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
14533         * object-internals.h
14534           culture-info.h : added territory field in MonoCulture and
14535           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
14536         * locales.c : fill territory field above too.
14537         * culture-info-table.h : regenerated.
14539 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
14541         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
14542         Fixes #81599.
14544 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
14546         * object.c: Always initialize apartment, even if 
14547         there is no custom attributes on entry point.
14548         
14549         Code is contributed under MIT/X11 license.
14551 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
14553         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
14554         * metadata.c: If no encoding is set, check for unicode
14555         on class.
14556         
14557         Code is contributed under MIT/X11 license.
14559 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
14561         * threads.c: Handle if mono_thread_current returns NULL 
14562         
14563         Code is contributed under MIT/X11 license.
14565 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
14567         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
14568         in start_wrapper. Added mono_thread_init_apartment_state and
14569         mono_thread_cleanup_apartment_state.
14570         * object.c: Initialize thread apartment state on main thread
14571         by checking for STAThreadAttribute on entry point.
14572         * object-internals.h: Add apartment_state field to MonoThread.
14573         * threads-types.h: Add unmanaged definition of 
14574         System.Threading.ApartmentState, MonoThreadApartmentState.
14575         
14576         Code is contributed under MIT/X11 license.
14577         
14578 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
14580         * class.c: Fix windows build.
14581         * class-internals.h: Fix windows build.
14582         
14583         Code is contributed under MIT/X11 license.
14585 2007-05-08  Robert Jordan  <robertj@gmx.net>
14587         * process.c (CreateProcess_internal):
14588         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
14589         .CreateNoWindow was specified. Fixes #81496.
14591 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
14593         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
14594         step in implementing IMT, replaced it with two compact arrays
14595         (interfaces_packed and interface_offsets_packed) and a bitmap that
14596         is used for isinst checks (interface_bitmap).
14598         * class.c: (compare_interface_ids): compare function to pass to
14599         bsearch when looking for an interface with a given id.
14600         (mono_class_interface_offset): reimplemented using bsearch on
14601         interfaces_packed, getting the offset from interface_offsets_packed.
14602         (print_implemented_interfaces): utility debugging function.
14603         (setup_interface_offsets): reworked to initialize interfaces_packed,
14604         interface_offsets_packed and interface_bitmap.
14606         * object.c: replaced all accesses to "MonoClass.interface_offsets"
14607         with uses of interfaces_packed and interface_offsets_packed.
14609 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
14611         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
14612         mono_class_interface_offset prototype to wrap all accesses to
14613         "MonoClass.interface_offsets".
14615         * class.c: Implemented mono_class_interface_offset, and wrapped all
14616         accesses to "MonoClass.interface_offsets".
14618         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
14619         "MonoClass.interface_offsets".
14621 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
14623         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
14624         GetMethodFromHandle overloads (bug #78637).
14626 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
14628         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
14629         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
14631 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
14633         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
14634         #81498.
14636         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
14637         gracefully.
14638         (mono_custom_attrs_from_index): Ditto.
14640         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
14641         Fixes #81501.
14643 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
14645         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
14646         is now allocated from a mempool.
14648 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
14650         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
14651         caller holds threads_lock, leading to deadlocks. Fixes #81476.
14653 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
14655         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
14656         mono_loader_clear_error () too late. Fixes #81463.
14658 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
14660         * culture-info-table.h : regenerated.
14662 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
14664         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
14665         is missing.
14667 2007-04-25  Dick Porter  <dick@ximian.com>
14669         * Makefile.am: Put the mingw enforced-optimisation back into the
14670         PLATFORM_WIN32 section.
14672 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
14674         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
14675         patch.
14677         * image.c (mono_image_load_module): New API function to load a module reference.
14679         * image.c (load_modules): Load modules lazily. Fixes #80812.
14681         * class.c (mono_class_from_typeref): Use mono_image_load_module.
14682         
14683         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
14685         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
14686         to mono_image_load_module_dynamic.
14688 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
14690         * marshal.c: Fix calling convention for CCW on non-windows
14691         platforms. STDCALL on windows, CDECL everywhere else to work 
14692         with XPCOM and MainWin COM.
14693         
14694         Code is contributed under MIT/X11 license.
14696 2007-04-23  Martin Baulig  <martin@ximian.com>
14698         Fix #80969.
14700         * loader.c
14701         (method_from_memberref): Added `gboolean *used_context' argument.
14702         (mono_get_method_from_token): Likewise.
14703         (mono_get_method_full): Don't insert the method in the cache when
14704         `used_context' is true.
14706 2007-04-23  Raja R Harinath  <rharinath@novell.com>
14708         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
14710         * reflection.c (mono_reflection_bind_generic_parameters): Don't
14711         create new MonoTypes for returned types.
14712         * class.c (mono_generic_class_get_class): Export mono-internal.
14713         * class-internals.h: Update to changes.
14715 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
14717         * threadpool.c, threadpool.h, icall-def.h: patch from
14718         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
14720 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
14722         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
14723         
14724         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
14726         * threads.c (mono_thread_get_stack_bounds): New helper function.
14728         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
14729         Correctly compute stack bounds when attaching. Fixes #81394.
14731 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
14733         * reflection.c: fix handling of doubles in custom attributes
14734         for the arm-fpa format (bug #81368).
14736 2007-04-18  Raja R Harinath  <rharinath@novell.com>
14738         * reflection.c (assembly_add_win32_resources): Mildly relax an
14739         bounds check to let the end pointer point just past the end of the
14740         allocated buffer.  (may fix #81384)
14742 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
14744         * culture-info-table.h : regenerated.
14746 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
14748         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
14749         the thread is aborted early.
14751 2007-04-05  Dick Porter  <dick@ximian.com>
14753         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
14754         FindFirstFile()/FindNextFile() to find entries.  This lets the
14755         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
14756         81038.
14758         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
14759         the parameters of
14760         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
14762 2007-04-04  Martin Baulig  <martin@ximian.com>
14764         * debug-helpers.c
14765         (mono_method_desc_full_match): Add support for nested classes.
14767 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
14769         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
14771 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
14773         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
14774         waiting for too many threads.
14776 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
14778         * environment.c: Fix return value check on uname so we can get the 
14779         executing version on Solaris operating systems.
14781 2007-03-28  Jb Evain  <jbevain@gmail.com>
14783         * class.c (mono_type_get_name_recurse): Complete the
14784         fix for the creation of assembly qualified names for
14785         pointer types. Fixes #81208.
14787 2007-03-27  Dick Porter  <dick@ximian.com>
14789         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
14790         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
14791         changed.
14793         * threads.c
14794         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
14795         the value of ReleaseMutex().
14797 2007-03-27  Dick Porter  <dick@ximian.com>
14799         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
14800         in little-endian order, not network endian, so must be converted
14801         to host endian here.  Fixes bug 80593.
14803 2007-03-22  Jb Evain  <jbevain@gmail.com>
14805         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
14806         qualified names for pointer types. Fixes #81208.
14808 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
14810         * marshal.c: Add support for PreserveSigAttribute. 
14811         
14812         Code is contributed under MIT/X11 license.
14814 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
14816         * process.c: Fix endianness issues. Fixes #81126.
14818         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
14819         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
14821         * image.c (mono_image_lookup_resource): Make this work on big-endian
14822         machines.Change API contract so the caller needs to free the return value.
14823         
14824         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
14825         API change.
14826         
14827 2007-03-14  Martin Baulig  <martin@ximian.com>
14829         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
14830         mono_type_get_desc() as well.
14832 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
14834         * icall.c:  Fix environ access in VS.  
14835         
14836 2007-03-13  Alp Toker  <alp@atoker.com>
14838         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
14839         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
14840         #63841.
14842 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
14844         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
14845         circular references among dynamic methods. Fixes #81091.
14847         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
14849 2007-03-09  Martin Baulig  <martin@ximian.com>
14851         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
14853 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
14855         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
14856         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
14857         
14858         Code is contributed under MIT/X11 license.
14859         
14860 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
14862         * loader.c: Reapply patch for bug #79424.
14864 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
14866         * metadata.c (mono_type_to_unmanaged): Only convert object to
14867         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
14869 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
14871         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
14872         (and incorrectly set) is_reference field from MonoGenericInst.
14874 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
14876         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
14877         a little earlier.
14879         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
14881         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
14883 2007-03-05  Miguel de Icaza  <miguel@novell.com>
14885         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
14886         FileOptions.1 value to mean "temporary", map that to
14887         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
14889         Fixes 80688
14891 2007-03-03  Marek Habersack  <mhabersack@novell.com>
14893         * appdomain.c: implement MS .Net style shadow copying. Copies of
14894         the assemblies are made in a subdirectory of the dynamic base
14895         directory, the assembly names are preserved.
14896         Copy .mdb and .config files along with the assemblies being shadowed.
14898 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
14900         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
14901         (emit_marshal_handleref): Ditto.
14903         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
14904         on Visual C++. Fixes #80671.
14906 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
14908         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
14909         for clone operations.
14911 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
14913         * marshal.c: Fix warnings.
14915 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
14917         * loader.c: allow case-insensitive matching of the dll name
14918         in dllmap handling when prefixed with "i:".
14920 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
14922         * threads.c: Fix #ifdef for dummy_apc function for VS.
14924 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
14926         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
14928 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
14929         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
14930         giving precedence to the methods with a fully qualified name
14931         (InterfaceName.MethodName) when building the interface sections
14932         of the vtable.
14934 2007-02-16  Dick Porter  <dick@ximian.com>
14936         * threadpool.c (append_job): Fix fast-path array handling, so it's
14937         less likely the array will grow exponentially when the load is
14938         heavy.
14940 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
14942         * metadata-internals.h, loader.c: fix dllmap lookup order
14943         for non-function maps, too, and prepare for fallback code.
14945 2007-02-12  Robert Jordan  <robertj@gmx.net>
14947         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
14948         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
14949         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
14950         GlobalFree. Fixes a part of bug #77075.
14952 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
14954         * loader.c: implemented typedef parent in field memberref.
14956 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
14958         * marshal.c: Fix warnings and remember to call Release on
14959         IUnknown of RCW.
14960         
14961         Code is contributed under MIT/X11 license.
14963 2007-02-10  Miguel de Icaza  <miguel@novell.com>
14965         * class-internals.h: Add MonoHandleRef definition, and
14966         handleref_class to mono_defaults. 
14968         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
14969         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
14971         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
14972         (do nothing on this stage)
14973         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
14974         (emit_marshal_handleref): New method, used for argument handling
14975         of HandleRefs. 
14977 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
14979         * class.c (mono_class_setup_parent): Lazily init com types.
14980         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
14981         init com types.
14982         * object.c (mono_remote_class_vtable): Lazily init com types.
14983         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
14984         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
14985         * domain-internals.h: Expose mono_init_com_types.
14986         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
14987         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
14988         Add support for COM Callable Wrapper marshalling.
14989         * marshal.h: Add icall definitions.
14990         * gc.c: Handle freeing of CCWs in finalizer code.
14991         
14992         Code is contributed under MIT/X11 license.
14994 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
14996         * reflection.c: changed all the signature encoding code to use
14997         a variable-sized buffer.
14999 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
15001         * marshal.c: locking fixes: never take the loader lock
15002         or other runtime locks when holding the marshal lock
15003         (fixes bug#80664).
15005 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
15007         * marshal.c: make the delegate function pointer mapping
15008         work for the moving GC.
15010 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
15012         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
15013         for bug #80618.
15015 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
15017         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
15018         gmodule.
15020 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
15022         * threadpool.c: made the code moving-GC safe.
15024 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
15026         * assembly.c, boehm-gc.c, class-internals.h, class.c,
15027         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
15028         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
15029         warning cleanup.
15030         * reflection.c: warning cleanup, some threading and moving GC fixes.
15032 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
15034         * class.c, loader.c: create the needed Set/Get/Address array methods
15035         as well as the .ctors in mono_class_init (), fixes bug #80567.
15037 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
15039         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
15040         we doesn't decrease its alignment. Should fix the sparc build.
15042 2007-01-24  Dick Porter  <dick@ximian.com>
15044         * socket-io.c
15045         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
15046         Create the returned object if we need to ignore an unsupported
15047         socket option.  Fixes a segfault reported by Atsushi.
15049 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
15051         * class.c, object.c: restrict GC-tracked fields to
15052         UIntPtr fields used inside corlib, so we provide better
15053         type info to the GC and also allow broken packing as in
15054         bug #80580.
15056 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
15058         * sgen-gc.c: removed duplicated function.
15060 2007-01-19  Miguel de Icaza  <miguel@novell.com>
15062         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
15063         value that means that the value is not supported, but that we
15064         should not return a failure, but instead report this as a
15065         successful operation.
15067 2007-01-19  Raja R Harinath  <rharinath@novell.com>
15069         Fix tests/bug79956.2.il
15070         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
15071         (mono_generic_class_get_class): If the generic definition in an
15072         enum, copy over other fields related to it.
15074 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
15076         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
15077         genericinst enums (bug #79215).
15079 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
15080         * class.c: Fix bug 80307.
15082 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
15084         * image.c: if the file table is not present, try to load
15085         all the modules, since we don't have info about them
15086         having or not metadata (bug #80517).
15087         * assembly.c: allow mono_assembly_load_references () to
15088         work for netmodules.
15090 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
15092         * image.c, metadata-internals.h, object.c: execute module
15093         cctors when running on the 2 runtime if present (bug #80487).
15095 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
15097         * icall.c: optimized InitializeArray() on bigendian.
15099 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
15101         * icall.c: fix for the broken ARM FPA double format.
15103 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
15105         * icall.c: handle endian issues for r4 and r8 types, too, in
15106         the InitializeArray() icall.
15108 2007-01-15  Miguel de Icaza  <miguel@novell.com>
15110         * loader.c (mono_loader_error_prepare_exception): Clear the error
15111         once we have extracted the information from it, do this before we
15112         call into the JIT's class loading mechanisms.
15114         * object.c (mono_class_create_runtime_vtable): Do not clear the
15115         loader error before calling mono_class_get_exception_for_failure
15116         as the loader error is needed inside
15117         mono_class_get_exception_for_failure to throw the error (thinko).
15119         Fixes #80521
15120         
15121 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
15123         * reflection.c: align fields rva data so it's faster to load at
15124         runtime.
15126 2007-01-12  Raja R Harinath  <rharinath@novell.com>
15128         Prepare to simplify GenericMethod handling.
15129         * class-internals.h (mono_method_get_context): New accessor function.
15130         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
15131         rather than directly accessing '->context' field.
15133         * class-internals.h (_MonoGenericParam.method): Move ...
15134         (_MonoGenericContainer): ... here.  Add into union with klass field.
15135         * class.c, icall.c, loader.c, metadata.c, reflection.c:
15136         Update to changes.
15138 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
15140         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
15141         the wrapper type enum and reduce relocations.
15143 2007-01-12  Raja R Harinath  <rharinath@novell.com>
15145         * reflection.c (inflate_mono_method): Reuse method instantiation
15146         from the generic method, if available.
15148 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
15150         * marshal.c (emit_marshal_variant): Fix conv_arg
15151         type in last commit, based on whether parameter is byref.
15152         
15153 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
15155         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
15156         marshalling.
15157         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
15158         MONO_TYPE_OBJECT back for VARIANT support.
15160 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
15162         * marshal.c, marshal.h, icall-def.h: Implement 
15163         Marshal.ReAllocCoTaskMem.
15165 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
15167         * marshal.c: memory retention fixes: use the proper
15168         image cache for runtime_invoke method lookups.
15170 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
15172         * mempool.c: added code to help debug mempool allocations.
15174 2007-01-11  Dick Porter  <dick@ximian.com>
15176         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
15177         support (experimenting with faking it with IP_MTU_DISCOVER for
15178         systems that don't have IP_DONTFRAGMENT.)
15179         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
15180         icall.
15182         * icall-def.h: new System.Net.Sockets.Disconnect icall.
15184         * socket-io.h: Add new fields to MonoSocketAsyncResult
15185         corresponding to the new ones in Socket.cs.
15187 2007-01-11  Raja R Harinath  <rharinath@novell.com>
15189         Fix IronPython regression mentioned in #80249
15190         * metadata.c (do_mono_metadata_parse_generic_class): Clear
15191         'cached_context' field, since it may have been initialized as a
15192         side-effect of metadata parsing.
15194         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
15195         (_MonoGenericClass.cached_class): Move here and rename from lone
15196         remaining field of ...
15197         (_MonoInflatedGenericClass): ... this.  Remove.
15198         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
15199         to changes.
15201         Fix mcs/tests/test-128.cs regression.
15202         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
15203         2007-01-10 change below.
15204         [MONO_TYPE_OBJECT]: Recurse into array case.
15206 2007-01-11  Raja R Harinath  <harinath@gmail.com>
15208         * class-internals.h (mono_get_inflated_generic_class): Remove.
15209         * class.c (mono_get_inflated_generic_class): Remove.
15210         (mono_generic_class_get_class): Rename from
15211         mono_class_create_generic.
15212         (mono_class_from_mono_type) [GENERICINST]: Use it.
15213         * reflection.c, metadata.c: Update to changes.  Use
15214         'mono_class_from_mono_type'.
15216 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
15218         * reflection.c: use passed type when encoding an array element
15219         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
15221 2007-01-09  Robert Jordan  <robertj@gmx.net>
15223         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
15224         result arguments (someDelegate.EndInvoke (unrelatedAres)).
15225         Fixes bug #80392.
15227 2007-01-09  Raja R Harinath  <rharinath@novell.com>
15229         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
15231         * object.c (set_value): Avoid aliasing between type->data.klass
15232         and type->data.generic_class.
15234         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
15236 2007-01-08  Raja R Harinath  <rharinath@novell.com>
15238         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
15239         between type->data.klass and type->data.generic_class.
15241 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
15243         * marshal.c: In MS.NET, StringBuilder objects are not copied by
15244         value in out parameters.
15246 2007-01-08  Raja R Harinath  <rharinath@novell.com>
15248         Simplify invariant for MonoGenericClass::klass field.
15249         * class.c (mono_class_create_generic): Verify 'klass' is null.
15250         * metadata.c (do_mono_metadata_parse_generic_class): Don't
15251         initialize 'klass' field.
15253 2007-01-05  Raja R Harinath  <rharinath@novell.com>
15255         Ongoing work to avoid redundant data and simplify invariants.
15256         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
15257         'generic_class', and change type to a GenericInst.
15258         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
15259         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
15261 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
15263         * class.c : skip io-layer under PLATFORM_WIN32.
15265 2007-01-03  Tor Lillqvist  <tml@novell.com>
15267         Fix #80305: In a bundled executable, look in the bundled exe
15268         assembly to determine the runtime version. Add the possibility to
15269         bundle also the machine.config file.
15270         
15271         * assembly.c (mono_assembly_open_from_bundle): Make
15272         non-static. Allow being called even if we have no bundled
15273         assemblies, and return NULL right away in that case.
15275         * domain-internals.h: Declare mono_assembly_open_from_bundle()
15276         here.
15278         * domain.c (app_config_parse): Take an assembly exe file name as
15279         parameter instead of a config file name. Check for a bundled
15280         config file for that assembly by calling
15281         mono_config_string_for_assembly_file() (see below) before looking
15282         for one in the file system.
15283         (get_runtimes_from_exe): Corrsponding change to call of
15284         app_config_parse().
15285         (get_runtimes_from_exe): Check for bundled assembly exe file first
15286         by calling mono_assembly_open_from_bundle(). If no bundled
15287         assembly exe file is found, call mono_image_open() as before to
15288         look it up in the file system.
15290         * mono-config.c: Add variable bundled_machinec_onfig.
15291         (mono_config_string_for_assembly_file): New function.
15292         (mono_config_for_assembly): Move code snippet that looks for a
15293         bundled assembly .config file into the above new function. Call
15294         it.
15295         (mono_register_machine_config, mono_get_machine_config): New
15296         functions to set and retrieve
15298         * assembly.h: Declare mono_register_machine_config().
15300         * mono-config.h: Declare mono_get_machine_config() and
15301         mono_config_string_for_assembly_file().
15303         * icall.c: No declaration of environ necessary on Win32. It is
15304         declared (as a macro expanding to a function call) in stdlib.h.
15305         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
15306         New internal mono function. Returns the value of
15307         mono_get_machine_config() as a Mono string.
15309         * icall-def.h: Add get_bundled_machine_config().
15311 2007-01-04  Raja R Harinath  <rharinath@novell.com>
15313         Remove redundant field
15314         * class-internals.h (_MonoGenericContext.container): Remove field.
15315         * loader.c (mono_method_get_signature_full): Don't parse a
15316         "container" for a signature parse when the signature is inflated
15317         immediately.
15318         (method_from_methodspec): Likewise, for a generic_inst.
15319         * class.c, metadata.c, reflection.c: Update to changes.
15321 2006-01-04  Raja R Harinath  <rharinath@novell.com>
15323         * class-internals.h (_MonoGenericClass): Rename 'context' field to
15324         'cached_context', and change semantics -- it starts off NULL, and
15325         is initialized on demand.
15326         * class.c (mono_generic_class_get_context): New accessor to
15327         replace 'context' field accesses.
15328         (mono_class_get_context): New helper.
15329         (*): Update to changes.
15330         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
15332 2007-01-03  Miguel de Icaza  <miguel@novell.com>
15334         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
15335         before the memcpy.   Fixes Marshal2 regression.
15337 2007-01-02  Jb Evain  <jbevain@gmail.com>
15339         * blob.h: add a MONO_TYPE_ENUM definition
15340         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
15341         fix the encoding of arrays of enums in custom attributes.
15343         Fixes #79666.
15345 2007-01-01  Miguel de Icaza  <miguel@novell.com>
15347         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
15348         string is null terminated, but only cut the string short if it
15349         overflows the buffer.   
15350         
15351         (mono_string_to_byvalstr): Also fix this routine.   The code here
15352         was not properly terminating a string (it was only terminated
15353         because of the previous catch-all memset). 
15355         I left the memset, because I do not know if applications expect
15356         the runtime to clear this region. 
15358         Fixes #79944.
15360         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
15361         Clear the error before returning to unmanaged code to prevent the
15362         runtime from being confused later on (fixes  80420).
15363         (ves_icall_type_from_name): Always call mono_loader_clear_error
15364         after parsing a type that could have failed.
15365         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
15367         * loader.c (mono_loader_clear_error): Fix indentation.
15369 2006-12-28  Martin Baulig  <martin@ximian.com>
15371         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
15373 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
15375         * reflection.c: patch from Rolf Bjarne Kvinge to fix
15376         getting a token for an EnumBuilder.
15378 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
15380         * reflection.c: be more careful in case resource generation
15381         fails to create the data array.
15383 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
15385         * sgen-gc.c: write barrier for clone and fix unregister handles.
15387 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
15389         * reflection.c: some fixes needed in the generics code for the moving GC.
15391 2006-12-22  Robert Jordan  <robertj@gmx.net>
15393         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
15394         account. Fixes bug #80299.
15396 2006-12-21  Raja R Harinath  <rharinath@novell.com>
15398         Fix WaitHandle usage in delegates.
15399         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
15400         * object.c (mono_wait_handle_new): Use the property set method to
15401         initialize the handle.
15402         (mono_wait_handle_get_handle): New.
15403         * threadpool.c (mono_async_invoke): Use it.
15404         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
15405         Likewise.
15406         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
15408 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
15410         * marshal.c (emit_marshal): Call emit_marshal_variant and
15411         emit_marshal_com_interface when applicable.
15412         (emit_marshal_variant, emit_marshal_com_interface): Add
15413         methods for this case and remove if's from emit_marshal_object.
15414         
15415 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
15417         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
15419 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
15421         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
15422         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
15423         and GlobalFree on Windows. Remove FIXME.
15425 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
15427         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
15428         implementation for managed objects.
15430 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
15432         * object.c: implemented code to be used for checking
15433         that no reference field overlaps with non-references.
15435 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15437         * threadpool.c: fix queue code to be compatible with the
15438         moving GC.
15440 2006-12-18  Miguel de Icaza  <miguel@novell.com>
15442         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
15443         in structures by throwing ArgumentNullException.
15445         (emit_marshal_safehandle): Also when they are null parameters.
15447         (emit_marshal_safehandle): Add support for ref
15448         SafeHandles parameters
15450 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
15452         * profiler.c: updated to use the mono-dl API instead of
15453         gmodule.
15455 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15457         * profiler.c: updated to use the mono-dl dynamic loading
15458         API instead of gmodule.
15460 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
15462         * profiler.c: use readlink, older versions of glib don't have
15463         g_file_read_link ().
15465 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
15467         * profiler.c: try to detect the path to mono if libc fails to provide
15468         a useful name (bug #80286).
15470 2006-12-16  Raja R Harinath  <rharinath@novell.com>
15472         Fix #80242
15473         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
15474         instance, use the generic type definition instead.
15475         (ves_icall_Type_GetNestedTypes): Likewise.
15476         * class.c (mono_class_create_generic): Always set the
15477         nested_classes of a generic instance to NULL, even if the generic
15478         type definition has nested types.
15480 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
15482         * marshal.c (mono_string_from_bstr): Revert previous Windows change
15483         and fix on Linux.
15484         
15485 2006-12-15  Miguel de Icaza  <miguel@novell.com>
15487         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
15488         my arguments were in the wrong order.   I also fixed the Windows
15489         version which seems to have had the same issue.
15491         (mono_free_bstr): On Unix, this is g_free.
15492         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
15493         conversions (for the tests in corlib to pass).
15495 2006-12-14  Miguel de Icaza  <miguel@novell.com>
15497         * marshal.c (emit_ptr_to_object_conv): For now, ignore
15498         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
15499         exception if a ref SafeHandle in a struct has changed).
15500         
15501         (emit_struct_conv): Do not perform layout checks for classes
15502         derived from SafeHandle, as those are specially handled. 
15504         (emit_object_to_ptr_conv): Add support for
15505         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
15507         (emit_marshal_safehandle): Implement conversion of return values
15508         of safehandles (MARSHAL_ACTION_CONV_RESULT).
15509         
15510         * threads.c: WaitHandle now is compiled with two different handles
15511         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
15512         for 2.0.
15513         
15514         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
15515         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
15516         these routines to cope with both kinds of fields.
15518 2006-12-12  Miguel de Icaza  <miguel@novell.com>
15520         * metadata.c (mono_type_to_unmanaged): Handle the case where
15521         type->data.klass is a SafeHandle, and in that case, return the
15522         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
15523         MONO_MARSHAL_CONV_SAFEHANDLE. 
15525 2006-12-11  Miguel de Icaza  <miguel@novell.com>
15527         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
15528         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
15529         calling emit_marshal_object.
15531         (emit_marshal_safehandle): Implement marshalling of
15532         SafeHandle parameters (no ref support yet).
15534         (MarshalAction): Document the defines as I implement
15535         them for SafeHandle.
15537         (emit_marshal_object): indentation police.
15539         * class-internals.h: Define MonoSafeHandle.
15540         Add safehandle_class to MonoDefaults type.
15542         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
15543         list of classes to check for fields. 
15545         * domain.c (mono_init_internal): Add SafeHandle to the list of
15546         mono_defaults loaded.
15548 2006-12-15  Raja R Harinath  <rharinath@novell.com>
15550         Fix #80253
15551         * reflection.c (mono_reflection_bind_generic_parameters): If the
15552         generic type definition is a type builder, ensure that it is fully
15553         initialized before instantiating it.  Kill some dead code.
15555 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
15557         * object.c: clear the loader_error () before loading
15558         more metadata stuff (bug #80258).
15560 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
15562         * icall.c, icall-defs.h: type modifiers icalls for
15563         parameters and properties.
15565 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
15567         * object.c, icall.c: fixed warnings.
15569 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
15571         * marshal.c: fixed a couple of leaks and coding style in a few places.
15573 2006-12-08  Dick Porter  <dick@ximian.com>
15575         * process.c: Cope with NULL ProcessStartInfo arguments on windows
15576         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
15577         80173.
15579 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
15581         * process.c: ProcessStartInfo may have only filename set and
15582         arguments can be NULL.
15584 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
15586         * icall.c: fix leak found by Robert Jordan.
15588 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
15590         * marshal.c, marshal.h: generate managed method to access an element
15591         of a multi-dimensional array.
15593 2006-11-30  Paolo Molaro (lupus@ximian.com)
15595         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
15597 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
15599         * icall.c: back out GetFields () fix until the serialization code is
15600         fixed to not depend on the incorrect behaviour.
15602 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
15604         * profiler.c: provide defaults if none are set.
15606 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
15608         * Makefile.am, attrdefs.h: new public header file with
15609         constants for attributes for use by embedders.
15611 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
15613         * icall.c: GetFields () fix for bug #80064.
15615 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
15617         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
15618         removed long unused icalls.
15620 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
15621   
15622         * marshal.c: 
15623                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
15624                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
15625                 can be generated without a delegate class.
15626                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
15627         
15628         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
15630 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15632         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
15633         #80069.
15635 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
15637         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
15638         icall-def.h: added icalls needed by System.GC.
15640 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
15642         * loader.c: ensure the class in catch clauses is handled
15643         correctly for generics methods (fixes bug#79980).
15645 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
15647         * monitor.h, monitor.c: added mono_locks_dump () function
15648         to help debug deadlocks involving managed locks.
15650 2006-11-13  Dick Porter  <dick@ximian.com>
15652         * file-io.c (get_file_attributes): If the file is a symlink try
15653         and get the stat data for the target, but also add the
15654         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
15655         the specs for the windows symlink support, but will probably have
15656         to be reworked when I have test data from a vista machine.  Fixes
15657         bug 79887.
15659 2006-11-13  Dick Porter  <dick@ximian.com>
15661         * gc.c (mono_domain_finalize): 
15662         * marshal.c (mono_delegate_begin_invoke): 
15663         * threadpool.c (socket_io_init, mono_thread_pool_init)
15664         (mono_thread_pool_finish): 
15665         * monitor.c (mono_monitor_try_enter_internal): 
15666         * threads.c (mono_thread_resume, mono_thread_init)
15667         (mono_thread_suspend_all_other_threads)
15668         (mono_thread_execute_interruption): 
15669         * appdomain.c (mono_domain_unload): Check for NULL error returns
15670         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
15671         75733.
15673 2006-11-11  Miguel de Icaza  <miguel@novell.com>
15675         * process.c
15676         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
15677         Only close the handle if the value of the handle is not
15678         INVALID_HANDLE_VALUE.  This just makes the process a bit more
15679         robust.
15681         Improvement for #75733, so that we do not run into this problem. 
15683         
15684         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
15685         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
15686         internal variables.  Fixes #79462 
15687         
15689 2006-11-09  Dick Porter  <dick@ximian.com>
15691         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
15692         Use poll() not select().  Fixes bug 79397.
15694 2006-11-09  Raja R Harinath  <rharinath@novell.com>
15696         Fix #79872
15697         * assembly.c (mono_assembly_load_from_full): Check that the given
15698         image has an assembly manifest.
15700 2006-11-09  Ankit Jain  <jankit@novell.com>
15702         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
15703         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
15704         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
15706 2006-11-07  Dick Porter  <dick@ximian.com>
15708         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
15709         Put the old resolver behaviour back for pre-2.0 profiles.
15711 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
15713         * threadpool.c: precise GC and locking fixes.
15715 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
15717         * class.c: don't load types that have an explicit unaligned
15718         managed reference. Provide better info in the TypeLoad exception.
15719         Part of the fix for bug #79744.
15720         * object.c: use the correct check for class type load issues.
15722 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
15724         * class.c: enforce alignment of fields with managed references
15725         even when Pack=1 is forced by the user (bug #77788).
15727 2006-11-03  Dick Porter  <dick@ximian.com>
15729         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
15730         If the address reverse lookup fails, return it as the hostname
15731         anyway.  Fixes bug 79721.
15733 2006-11-03  Dick Porter  <dick@ximian.com>
15735         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
15736         Fix build on Windows.
15738 2006-11-02  Dick Porter  <dick@ximian.com>
15740         * icall-def.h: 
15741         * object-internals.h: 
15742         * exception.c (mono_get_exception_thread_interrupted): 
15743         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
15744         Fixes bug 74525.
15746         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
15747         Check for pending Thread.Interrupt.
15749 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
15750         * loader.c: Fixed bug 79684.
15752 2006-10-27  Dick Porter  <dick@ximian.com>
15754         * file-io.c (get_file_attributes): Force symlinks to directories
15755         to be returned as a regular file.  Fixes bug 79733.
15756 2006-10-26  Dick Porter  <dick@ximian.com>
15758         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
15759         CreateFile to open a directory then we need to set the
15760         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
15762 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
15764         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
15765         friends.
15767 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
15769         * sgengc.c: small cleanup of timer code.
15771 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
15773         * sgen-gc.c: fix some warnings and start adding support for
15774         complete object removal on domain unload.
15776 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
15778         * assembly.c: build_assembly_name should not consider a version
15779         number without build or revision number invalid. Fixes bug #79715.
15781 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
15783         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
15784         call kernel32 function OutputDebugString directly.
15785         
15786         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
15787         
15788 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
15790         * reflection.c: small cleanup, using a function to insert a MonoString
15791         in the string heap.
15793 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
15795         * reflection.c: moving GC fixes.
15797 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
15799         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
15800         all the objects with finalizers belonging to an unloading appdomain.
15802 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
15804         * sgen-gc.c: added ability to allocate even when the nursery is fully
15805         pinned and fixed a couple of bugs.
15807 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
15809         * threads.h: Revert the last change for now.
15811         * threads.h (mono_thread_get_pending_exception): Rename this to
15812         mono_thread_get_undeniable_exception ().
15814 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
15816         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
15817         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
15818         when fname does not refer to valid assembly. This result in a more
15819         meaningful error message.
15820         * exception.c: added mono_get_exception_bad_image_format2 which 
15821         constructs a BadImageFormatException using the ctor taking a custom
15822         message and the file name. Passing in a NULL msg results in a default
15823         message.
15824         * exception.h: define mono_get_exception_bad_image_format2 function.
15825         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
15826         when file name pointed to an invalid IL image. Use 
15827         mono_get_exception_file_not_found2 to construct FileNotFoundException,
15828         as this results in a more meaningful error message.
15830 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
15832         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
15833         #79465.
15835 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
15837         * metadata.c (mono_type_size): Change the align parameter to guint32 for
15838         consistency with the other _size functions.
15839         (mono_type_stack_size): Ditto.
15841         * class.c object.c icall.c: Fix warnings caused by the above change.
15843         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
15845         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
15847         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
15849 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
15851         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
15852         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
15853         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
15854         threadpool.h, threads-types.h: mark more internal functions.
15856 2006-10-11  Dick Porter  <dick@ximian.com>
15858         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
15859         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
15860         reproduce the bug even before applying the fix.)
15862 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
15864         * reflection.c: allow retrieving attributes for arguments in generic
15865         methods (bug #79241).
15867 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
15869         * debug-mono-symfile.c: properly check fopen () result (found by
15870         coverity).
15872 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
15874         * reflection.c: make error message clearer and fixed two
15875         issuelets found by Coverity.
15877 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
15879         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
15881 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
15883         * object-internals.h, gc-internal.h, profiler-private.h:
15884         mark internal functions.
15886 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
15888         * reflection.c: put data in the text section.
15889         * icall.c: recognize more types in type_from_typename ().
15890         * process.c, marshal.c: added some GC FIXMEs.
15892 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
15894         * loader.c: check for NULL before initializing.
15896 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
15898         * gc.c (finalizer_thread): Use a non-alertable wait here.
15900         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
15901         until the correct solution is found.
15903 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
15905         * reflection.c (mono_module_get_object): Avoid an assert when operating on
15906         modules with no metadata. Fixes #79596.
15908         * image.c (load_metadata_ptrs): Put back the error message when
15909         the #- heap is encountered since the support is not complete yet.
15911 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
15913         * gc.c: do not allow the user to SuppressFinalize () a
15914         delegate because it would leak the trampoline if present.
15916 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
15918         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
15919         PropertyPtr table.
15921 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
15923         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
15925         * metadata.c (mono_metadata_get_param_attrs): Ditto.
15927         * row-indexes.h: Add definitions for *Ptr tables.
15929         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
15931         * metadata.c (mono_metadata_translate_token_index): New helper function to
15932         translate table indexes used in uncompressed metadata.
15933         (mono_metadata_decode_table_row): Ditto.
15934         (mono_metadata_decode_table_row_col): Ditto.
15936         * metadata.c: Add table schema for *Ptr tables.
15938         * class.c loader.c: Use the new helper function to access the affected metadata
15939         tables.
15940         
15941         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
15942         #38532.
15943         
15944 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
15946         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
15947         sequences which can be unbounded in size. Fixes #79583.
15949 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
15951         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
15952         static initialization.
15954         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
15956         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
15958         * domain.c (mono_domain_free): Free up type_init_exception_hash.
15960         * object.c (mono_runtime_class_init): Implement correct semantics when a static
15961         ctor fails, i.e. throw the same exception on subsequent accesses.
15962         
15963 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
15965         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
15966         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
15967         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
15968         Handle marshalling of interfaces and VARIANTs contained in structs.
15969         
15970         Code is contributed under MIT/X11 license.
15971         
15972 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
15974         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
15975         
15976         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
15977         mempool.
15979 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15981         * console-io.c: ignore previous SIGINT handler.
15983 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
15985         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
15986         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
15987         #79460, #79461, #79485.
15989         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
15991         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
15992         #79217.
15994 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
15996         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
15997         could be generated from it.
15999 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
16001         * rand.c: fix read loop to correctly handle EINTR.
16003 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
16005         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
16006         internal calls are defined to keep methods closer to the declaring
16007         type and allow a significant reduction in runtime relocations and
16008         memory usage.
16010 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
16012         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
16013         exception message to have FileNotFoundException use the default
16014         assembly load error message. Fixes bug #79426.
16015         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
16017 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16019         * threadpool.c: (start_thread_or_queue) use the root domain when
16020         creating the thread instead of the async object one.
16022 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
16024         * class.c, object.c, class-internals.h, reflection.c:
16025         for arrays, store element_size inside MonoClass (speedup
16026         for array object creation).
16028 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
16030         * icall.c: fixed CodeBase to use the file name and not the module
16031         name (bug #79365).
16033 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
16035         * mono-debug.c, mono-debug.h: export find_method as
16036         mono_debug_find_method ().
16038 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
16040         * debug-helpers.c, class-internals.h: added a few functions useful
16041         when debugging under gdb.
16043 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16045         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
16046         characters that need special handling.
16048 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
16050         * mono-config.c: make the os/cpu specification more flexible,
16051         allowing lists and negation.
16053 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
16055         * marshal.c: COM Interop fixes. Handle case where method->klass.
16056         is interface. Handle BSTR/MonoString when null. Use CDECL as 
16057         calling convention on non-windows platforms. This is for
16058         compatibility with XPCOM and MainWin COM.
16059         
16060         Code is contributed under MIT/X11 license.
16061         
16063 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
16065         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
16066         correctly. Fixes #79217.
16068         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
16070 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
16072         * mono-config.c: allow both an os and cpu attribute for dllmap
16073         and dllentry elemnets to enable a single config file to be used
16074         for multiple architectures.
16076 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
16078         * loader.c: MonoLoaderError was cleared too soon on load failure.
16079         Fixes bug #79424.
16081 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
16083         * icall.c: use the defining class vtable when accessing a
16084         static field, not a pobblibly derived class.
16086 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
16088         * icall.c string-icalls.c: Remove references to unicode.h.
16090         * unicode.h unicode.c Makefile.am: Remove these unused source files.
16092         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
16094         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
16095         indicating the image where custom marshaller types should be looked up.
16096         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
16097         custom marshallers, instead of corlib. Fixes #79425.
16099 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
16101         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
16103 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
16105         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
16106         Implement Environment.ProcessorCount.
16107         
16108         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
16109         Implement Environment.ProcessorCount.
16110         
16111         * icall.c: 
16112         Add Environment.ProcessorCount icall.
16113         
16114         Patch by Jason McFall.
16116 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16118         * assembly.c: don't append .exe/.dll when the filename already contains
16119         one of those extensions.
16121 2006-09-12  Martin Baulig  <martin@ximian.com>
16123         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
16124         to array interfaces.
16126 2006-09-11  Martin Baulig  <martin@ximian.com>
16128         * reflection.c (mono_image_build_metadata): Create the
16129         MethodImpl's after emitting all types and methods, so we don't
16130         need another fixup pass for them.
16132 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
16134         * class.c (mono_class_from_name_case): Fix regression introduced by the last
16135         change.
16137 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
16139         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
16140         unload.
16142 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
16144         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
16145         args is not set. Fixes #78926.
16147 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
16149         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
16151         * image.c (load_class_names): Move this to class.c, and rename it to 
16152         'mono_image_init_name_cache'.
16153         (load_modules): Fix a warning.
16155         * class.c icall.c image.c: Initialize image->name_cache lazily.
16157         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
16158         on its name using information in the AOT file.
16160         * class.c (mono_class_from_name): Use the new hook function.
16162 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
16164         * reflection.c (mono_param_get_objects): Handle enum default parameter values
16165         correctly.
16167         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
16168         Fixes #79289.
16169         
16170 2006-09-06  Martin Baulig  <martin@ximian.com>
16172         * icall.c (mono_lookup_internal_call): Small fix.
16174 2006-09-05  Raja R Harinath  <rharinath@novell.com>
16176         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
16177         double g_free.
16179 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
16181         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
16182         when --debug is specified.
16184 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
16186         * class.c (setup_generic_array_ifaces): Fix a warning.
16188 2006-09-04  Miguel de Icaza  <miguel@novell.com>
16190         * Temporarily remove the patch to assemly.c that checks the
16191         assembly versions as it breaks our gacutil.
16193 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
16195         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
16197         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
16198         a net 1.0 runtime.
16200         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
16201         created using the default ctor. Fixes #79152.
16202         (mono_string_builder_to_utf16): Ditto.
16204 2006-09-01  Martin Baulig  <martin@ximian.com>
16206         Fix handling of the generic array interfaces.
16208         * class-internals.h
16209         (MonoDefaults): Removed `generic_array_class' and added
16210         `generic_ilist' class.
16212         * class.c
16213         (mono_bounded_array_class_get): Add the new generic array interfaces.
16214         (setup_generic_array_ifaces): New static method; create vtable
16215         entries for each method in the generic array interfaces.
16217         * metadata.c
16218         (select_container): Allow "parent-less" generic methods.
16220         * marshal.c
16221         (mono_marshal_get_generic_array_helper): New public method.
16223         * icall.c
16224         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
16225         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
16226         moved the interncall into System.Array.
16228 2006-09-01  Raja R Harinath  <rharinath@novell.com>
16230         A few more cases of avoiding work on types with ->byref set.
16231         Has the real fix for #79238
16232         * icall.c (is_generic_parameter): New helper.
16233         (ves_icall_Type_GetGenericParameterPosition): Use it.
16234         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
16235         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
16236         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
16237         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
16238         reference types.
16239         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
16240         reference types.
16241         (ves_icall_Type_get_IsGenericInstance): Likewise.
16242         (ves_icall_Type_get_IsGenericType): Likewise.
16244 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
16246         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
16247         class if possible.
16249         * mempool.h (mono_mempool_get_allocated): New helper function.
16251         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
16252         change.
16254         * mempool.c: Fix warnings and the calculation of stats.
16256         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
16258         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
16260         * loader.c (mono_get_method_from_token): Update method_count stat.
16262         * class-internals.h (MonoStats): Add some stats.
16264 2006-08-31 Robert Jordan  <robertj@gmx.net>
16266         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
16267         with managed variants.
16268         All code is contributed under the MIT/X11 license.
16269         
16270 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
16272         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
16273         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
16275         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
16277         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
16278         with cycles in classes.
16280         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
16282         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
16283         missing a [MarshalAs] directive. Fixes #79203.
16285         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
16286         klass->marshal_info. Fixes #79217.
16288 2006-08-30  Martin Baulig  <martin@ximian.com>
16290         Committing a patch from Joachim Ante <joe@otee.dk>:
16291         Add support for binary data symbol stores.
16293         * debug-mono-symfile.c
16294         (mono_debug_open_mono_symbol_file): Renamed into
16295         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
16296         arguments.
16298         * mono-debug.c
16299         (mono_debug_open_image): Added `raw_contents' and `size' args.
16300         (mono_debug_init_2_memory): New public function.
16302 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
16304         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
16306 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16308         * appdomain.c: implement support for ShadowCopyFiles.
16310 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
16312         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
16313         when value is NULL (and should remove CID #51).
16315 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16317         * image.c: moved 2 functions to ../utils.
16319 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
16321         * gc.c: cope with the target object of a GC handle being NULL
16322         (bug #78877).
16324 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
16326         * class.c: recursively check parent's explicit implementations
16327         of interface methods (fixes bug #79125).
16329 2006-08-19  Miguel de Icaza  <miguel@novell.com>
16331         * filewatcher.c: Avoid warnings when building, do not redefine
16332         constants that are defined.
16334         Remove warnings.
16336 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16338         * image.c: don't fail when the link points to an absolute path.
16340 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
16342         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
16343         Fix CID #3.
16345 2006-08-17  Miguel de Icaza  <miguel@novell.com>
16347         * image.c (full_path): A new method used to obtain the actual path
16348         of an assembly even in the presence of symbolic links.  
16350         This is necessary for the case where we are running a binary that
16351         has been GACed, but we are using the "published" path name
16352         ($prefix/mono/1.0/blah.exe) which happens to point to the real
16353         file in the GAC.
16355         This was the source of the failure for the `xsp' command with the
16356         recent AppDomain changes, as far as the runtime was concerned,
16357         there were two different assemblies: $prefix/mono/1.0/blah.exe and
16358         $prefix/mono/gac/blah/version/blah.exe.
16360         (do_mono_image_open): use full path
16362 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16364         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
16366 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
16368         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
16369         domain_id is supplied. Fix CID #241 and corlib's unit tests.
16371 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16373         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
16374         small structures. Fixes #78990.
16376 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
16378         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
16380         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
16382 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16384         * appdomain.c:
16385         * marshal.c: don't load all the assemblies from a domain into newly
16386         created ones. The new domains might have different rules and load
16387         assemblies from different locations. Fixes bug #76757.
16389         Patch by Lluis. Conflicts resolved by Brian Crowell.
16391 2006-08-16  Alp Toker  <alp@atoker.com>
16393         * socket-io.c: First half of the fix for #79084.
16394         Set sa_size to the length of the content, not that of the struct.
16395         Don't add NULL suffix to the content, this should be done in
16396         managed code if needed.
16398 2006-08-14  Raja R Harinath  <rharinath@novell.com>
16400         Fix part of #79012
16401         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
16402         mono_metadata_parse_type returns NULL.
16404 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
16406         * normalization-tables.h : new file for string normalization data.
16407         * locales.c, locales.h, icall.c :
16408           added load_normalization_resource() for string normalization,
16409           and icall as well.
16410         * Makefile.am : added normalization-tables.h to the sources.
16412 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
16414         * marshal.c: Add more helper functions to reduce code duplication and use them
16415         everywhere.
16417 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
16419         * marshal.c: Fix non-x86 stdcall warnings.
16420         
16421         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
16422         them everywhere.
16424 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
16426         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
16427         type check on multi-dimensional arrays. Fixes #79000.
16429 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
16431         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
16432         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
16433         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
16434         * class-internals.h: add is_com_object to class structure.
16435         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
16436         null checks to COM object marshalling. Fix .ctor call on RCW.
16437         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
16438         
16439         All code is contributed under the MIT/X11 license.
16441 2006-08-09  Dick Porter  <dick@ximian.com>
16443         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
16444         racing mono_monitor_allocator_lock() somewhere, so don't delete
16445         the critical section for now.  Found by running and exiting
16446         monodevelop.
16448 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
16450         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
16451         (ves_icall_System_ComObject_FindInterface): Ditto.
16452         (ves_icall_System_ComObject_CacheInterface): Ditto.
16454         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
16455         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
16457 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16459         * threadpool.c: treat pipes from process asynchronous reads as sockets
16460         when reading from them, so we get select/poll or epoll to wait for
16461         data.
16463 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
16465         * loader.c: Fix a typo (CID #233) in the null check.
16467 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
16469         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
16470         Hopefully fixes #78949.
16471         
16472         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
16473         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
16474         bytes. Fixes #78972.
16476 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16478         * filewatcher.c: we need to set errno here.
16480 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16482         * filewatcher.c: let Win32Exception get the error value.
16484 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16486         * filewatcher.c: translate errno into win32 errors for Win32Exception
16487         to know what happened.
16489 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
16491         * threadpool.c: Fix more warnings.
16493         * assembly.c (search_loaded): Fix warnings.
16495         * threadpool.c (mono_thread_pool_finish): Fix warnings.
16496         (mono_async_invoke): Ditto.
16498 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
16500         * object.c (mono_remote_class_vtable): Need to create proxy vtable
16501         entries for __ComObject type in addition to ComImport types.
16502         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
16503         about hash table.
16504         
16505         All code is contributed under the MIT/X11 license.
16507 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
16509         * image.c: avoid tentative loading of modulerefs that contain
16510         no metadata (P/Invoke library names).
16512 2006-07-28  Dick Porter  <dick@ximian.com>
16514         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
16515         mono_loader_lock() somewhere, so don't delete the critical section
16516         for now.  Found by running and exiting monodevelop.
16518 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16520         * filewatcher.c: define the inotify syscalls when we're building on
16521         linux and have sys/syscall.h. The build system might not have support
16522         for inotify but the target system might have it.
16524 2006-07-26  Miguel de Icaza  <miguel@novell.com>
16526         * domain.c: Documentation updates.
16528         * loader.c (mono_free_method): Do not release the method
16529         information if we are being profiled, as profilers will use this
16530         information at shut down to present some data to the user.
16532         This is needed so that the profiler does not crash, as the
16533         profiler tends to keep MonoMethods around, and they might become
16534         invalid if we free these.
16536         (mono_get_method_constrained): Return the original CIL stream
16537         method as well, so verification can be performed against it.
16539 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16541         * filewatcher.[ch]: support for inotify file system watcher.
16542         * icall.c: add new internal calls for the inotify file system watcher.
16544 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16546         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
16547         #78888.
16549 2006-07-20  Dick Porter  <dick@ximian.com>
16551         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
16552         warning.
16554 2006-07-20  Dick Porter  <dick@ximian.com>
16556         * threads.c (start_wrapper): Do the thread cleanup while we still
16557         hold a reference to its object.  Fixes bug 78123.
16559 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
16561         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
16562         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
16563           "managed-to-managed".
16564         * icall.c: Redirect string constructors that take sbyte* to
16565           ves_icall_System_String_ctor_RedirectToCreateString.
16566         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
16567           to CreateString () methods with matching signature.
16568         * reflection.c: Use original security informations for
16569           MONO_WRAPPER_MANAGED_TO_MANAGED.
16570         * security-manager.c: Use original security informations for
16571           MONO_WRAPPER_MANAGED_TO_MANAGED.
16572         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
16573           that is a placeholder and only its address should be used.
16574         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
16575           that is a placeholder and only its address should be used.
16577 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
16579         Begin implementing COM Interop.
16580         * appdomain.c: Increment corlib version.
16581         * class.c: Set ComImport classes' parent to __ComObject.
16582         * loader.c: Mark cominterop methods as such.
16583         * domain.c: Add __ComObject class to MonoDefaults structure.
16584         * image.c: Add 2 hashtables to the image for COM Interop related methods
16585         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
16586         using the mempool allocator
16587         
16588         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
16589         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
16590         declaration for mono_metadata_type_dup_mp.
16591         
16592         * debug-helpers.c: Added strings for two additional wrapper types
16593         * object.c: Create proxy objects for ComImport classes
16594         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
16595         and added __ComObject class to MonoDefaults structure.
16596         
16597         * object-internals.h: Finish MonoRealProxy definition, and add definition of
16598         MonoComInteropProxy and MonoComObject.
16599         
16600         * marshal.c: Added support for COM Interop
16601         (signature_cominterop): Converts managed signature to corresponding
16602         unmanaged COM signature.
16603         (cominterop_get_function_pointer): gets unmanaged function pointer via
16604         COM object vtable
16605         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
16606         (cominterop_get_method_interface): returns interface type that method is defined on
16607         (mono_mb_emit_cominterop_call): emits native call to function pointer
16608         gotten from vtable
16609         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
16610         that matches signature of unmanaged function.
16611         (cominterop_get_native_wrapper): wrapper around adjusted method call.
16612         (cominterop_get_invoke): forwards call from proxy to __ComObject
16613         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
16614         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
16615         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
16616         
16617         * marshal.h: Added Marshal icall declarations.
16618         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
16619         so we can access them in finalizer
16620         
16621 2006-07-14  Dick Porter  <dick@ximian.com>
16623         * object.c (mono_type_initialization_cleanup): Fix a race
16624         condition by temporarily commenting out the critical section
16625         deletion.
16627 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
16629         * reflection.c (create_custom_attr): Fix some warnings.
16630         (create_custom_attr_data): Ditto.
16631         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
16632         types. Fixes #78855.
16634 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
16636         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
16638         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
16640 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
16642         * reflection.c (resolve_object): Add support for DynamicMethod.
16644         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
16645         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
16647 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
16649         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
16650         don't leak GPtrArray's pdata has we have no use (nor free) for it.
16652 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
16654         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
16655         Fixes #77888.
16657 2006-06-30  Raja R Harinath  <rharinath@novell.com>
16659         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
16660         slightly: remove a shadow local variable.
16662 2006-06-29  Raja R Harinath  <rharinath@novell.com>
16664         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
16665         definition that introduces the virtual function slot.
16666         Also fix Coverity #105.
16668 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
16670         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
16671         for dynamic assemblies. Fixes #78724.
16673 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
16675         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
16676         Fixes #78722.
16678 2006-06-21  Martin Baulig  <martin@ximian.com>
16680         * reflection.c
16681         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
16682         fixes #76484.
16684 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
16686         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
16688 2006-06-20  Raja R Harinath  <rharinath@novell.com>
16690         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
16691         nor TYPEREFs.
16692         * class.c (mono_class_create_from_typespec): Add 'context' argument.
16693         Inflate result if necessary.
16694         (mono_class_get_full): Remove old version.  Rename from
16695         'mono_class_get' and add 'context' argument.  Pass it to
16696         ..._create_from_typespec.
16697         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
16698         (mono_ldtoken): Revert change below.
16700 2006-06-20  Martin Baulig  <martin@ximian.com>
16702         * class.c (mono_ldtoken): Don't pass the generic context to
16703         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
16705 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
16707         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
16708         and later freeing it. Fixes #78638.
16710 2006-06-15  Miguel de Icaza  <miguel@novell.com>
16712         * icall.c (mono_class_get_throw): Revert over-zealous error
16713         throwing, the caller for mono_class_get_throw will cope with
16714         errors when classes are not properly initialized already.
16716         The code still copes with loader exceptions though.
16718         Fixes the regression in reftype1 and reftype3 from the CAS tests.
16719         
16720 2006-06-14  Miguel de Icaza  <miguel@novell.com>
16722         Fixes the `make run1' version of RuntimeAbort (to be commited,
16723         source is in Bugzilla).
16724         
16725         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
16726         FALSE on class loading failure instead of returning true.
16728         * class.c (mono_class_create_from_typedef): It is possible for
16729         mono_metadata_interfaces_from_typedef_full to fail if a class is
16730         not found, cope with this.
16731         
16733 2006-06-14  Dick Porter  <dick@ximian.com>
16735         * socket-io.c: 
16736         * process.c: Fix a bunch of signed/unsigned warnings from gcc
16737         4.1.1
16739 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
16741         * culture-info-table.h : oops, forgot to make it nsync with r61548.
16743 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
16745         * icall.c: Another fix for building mono in Visual Studio.
16747 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
16749         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
16750         
16751 2006-06-09  Martin Baulig  <martin@ximian.com>
16753         * debug-mono-symfile.c: Put this back and really fix it this
16754         time. Sorry for all the trouble.
16756 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
16758         * icall.c (mono_class_get_throw): Fix a warning.
16759         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
16760         ReflectionTypeLoadException if needed. Fixes #78606.
16762         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
16763         (mono_class_init): Ditto.
16765         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
16766         ref_only exceptions.
16767         (mono_loader_clear_error): Make this work even if there is no error.
16769 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
16771         * object-internals.h marshal.c marshal.h icall.c: Implement method 
16772         Marshal.GetComSlotForMethodInfo using internal call.
16774 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
16776         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
16777         a function for signalling it.
16779         * class.c (mono_class_from_typeref): Use the new kind of loader error when
16780         a referenced assembly is not found.
16782         * loader.c (mono_loader_error_prepare_exception): Add support for 
16783         LOADER_ERROR_ASSEMBLY. Fix formatting.
16785 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
16787         * domain.c appdomain.c class-internals.h marshal.c: Add support 
16788         for VARIANT marshalling on windows and increment corlib version
16789         since Variant struct was added.
16791 2006-06-03  Miguel de Icaza  <miguel@novell.com>
16793         * debug-mono-symfile.c: Revert Martin's previous patch which broke
16794         stack trace line information:
16796         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
16797         (Martin) when looking up B which is between A and C, return A not C.
16799         Bug is #78573.
16801         Thanks to Alexander Olk for tracking this down.
16803 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
16805         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
16806         
16807         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
16808         avoid clobbering its value.
16809         (mono_string_to_lpstr): Fix a warning on windows.
16811 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
16813         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
16815         * reflection.c loader.c: Removed references to 'dummy' flag.
16817         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
16819         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
16820         it gets GC tracking.
16822         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
16823         GC tracking.
16824         
16825         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
16827         * marshal.c threadpool.c: Update callers of mono_async_result_new.
16829         * appdomain.c: Bump corlib version.
16831 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
16833         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
16834         CEE_STIND_REF when working with object references.
16836 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
16838         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
16839         Fixes #78539.
16841 2006-05-30  Miguel de Icaza  <miguel@novell.com>
16843         * loader.c (method_from_memberref): Fix argument value for
16844         mono_loader_set_error_method_load (I was passing the MonoClass
16845         instead of the class name char *).
16847 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
16849         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
16850         CEE_STIND_REF when working with object references.
16852 2006-05-30  Martin Baulig  <martin@ximian.com>
16854         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
16855         mono_method_full_name() change and replace the ':' with a '.'
16856         here.
16858 2006-05-30  Martin Baulig  <martin@ximian.com>
16860         * debug-mono-symfile.c
16861         (mono_debug_symfile_lookup_location): Fix the algorithm:
16862         when looking up B which is between A and C, return A not C.
16864 2006-05-29  Martin Baulig  <martin@ximian.com>
16866         * mono-debug.h
16867         (MonoDebugMethodInfo): Make the typedef public.
16868         (MonoDebugSourceLocation): New public struct.
16870         * mono-debug.c
16871         (mono_debug_source_location_from_address): Removed.
16872         (mono_debug_source_location_from_il_offset): Removed.
16873         (mono_debug_il_offset_from_address): Removed.
16874         (mono_debug_address_from_il_offset): Removed.
16875         (mono_debug_lookup_method): New public function.
16876         (mono_debug_lookup_source_location): New public function; replaces
16877         the old mono_debug_source_location_from_*() functions; see the
16878         inline documentation.
16879         (mono_debug_free_source_location): New public function.
16880         (mono_debug_print_stack_frame): New public function; see the
16881         inline documentation.
16883         * debug-mono-symfile.c
16884         (mono_debug_find_source_location): Renamed into
16885         mono_debug_symfile_lookup_location(); only take a
16886         `MonoDebugMethodInfo *' and an `offset' argument; added inline
16887         documentation.
16888         (mono_debug_find_method): Renamed into
16889         mono_debug_symfile_lookup_method().
16891 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
16893         * assembly.c (mono_assembly_open_full): Dont overwrite the status
16894         returned by mono_image_open_full ().
16896         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
16897         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
16898         #78517.
16900         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
16901         #78518.
16903 2006-05-27  Miguel de Icaza  <miguel@novell.com>
16905         * class.c (mono_class_from_typeref): handle missing images
16906         earlier, deals with bug #78418.   Refactor code; 
16908         Fix a warning introduced in my previous commit (some stale code
16909         from before I revisited my patch).
16911         * class.c (mono_class_create_from_typedef): On failure, remove the
16912         class from the MonoImage->class_cache as the class is not
16913         initialized;   Fixes the leak pointed out by Paolo.
16915 2006-05-25  Dick Porter  <dick@ximian.com>
16917         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
16918         DeleteCriticalSections until I figure out which one may still be
16919         sometimes locked when mono_thread_cleanup is called.
16921 2006-05-24  Dick Porter  <dick@ximian.com>
16923         * threads.c (mono_thread_cleanup): Move the threading cleanup out
16924         of mono_thread_manage and back into its own function, so it can be
16925         called after the finalizer thread has finished.
16927         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
16929 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
16931         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
16932         Fixes #78495.
16934         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
16935         with non-blittable elements.
16936         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
16938 2006-05-24  Martin Baulig  <martin@ximian.com>
16940         * mono-debug-debugger.h (MonoDebuggerEvent): Added
16941         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
16943         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
16944         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
16945         `mono_debugger_event_handler' to NULL.
16947 2006-05-24  Martin Baulig  <martin@ximian.com>
16949         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
16951 2006-05-24  Martin Baulig  <martin@ximian.com>
16953         * mono-debug-debugger.h
16954         (mono_debugger_create_notification_function): Added
16955         `MonoCodeManager *' argument.
16957 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
16959         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
16961 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
16963         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
16964         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
16965         implementation.
16967 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
16969         * icall.c: precise GC support: objects can't be stored in unmanaged
16970         memory anymore, even if they are kept alive by other references: since
16971         they can move the GC needs to be able to always find them.
16973 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
16975         * object.c: precise GC support for static fields. Support
16976         for moving GCs: write barriers and pinned allocation for interned
16977         strings.
16979 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
16981         * domain.c, domain-internals.h: precise GC support for the MonoDomain
16982         structure.
16984 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
16986         * class.c, gc.c: sgen and precise GC updates.
16988 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
16990         * marshal.h, marshal.c: added write barrier wrapper and precise type
16991         fixes.
16993 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
16995         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
16996         support.
16998 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
17000         * reflection.c: precise and sgen GC updates.
17002 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
17004         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
17006 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
17008         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
17010 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
17012         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
17013         MONO_TYPE_OBJECT. Fixes #78462.
17015 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
17017         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
17018         and blittable types.
17020 2006-05-17  Miguel de Icaza  <miguel@novell.com>
17022         * class.c (mono_class_get_exception_for_failure): Implement parts
17023         of a TODO: if the loader error is set (instead of the class
17024         error), we return a Loader exception that can be properly thrown
17025         elsewhere.
17027         This was exposed by some Winforms 2.0 code that I tried to run
17028         (Atsushi pointed me to it).
17030 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
17032         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
17033         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
17034         
17035         * marshal.c (emit_marshal_vtype): Add limited support for 
17036         UnmanagedType.LPStruct. Fixes #78427.
17038         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
17039         Applied a patch from kangaroo to fix #77523.
17041 2006-05-17  Martin Baulig  <martin@ximian.com>
17043         * threads.c
17044         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
17045         (debugger_thread_created): Removed.
17046         (debugger_thread_exited): Removed.
17048 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
17050         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
17052         * object-internals.h (MonoReflectionResource): Sync with managed version.
17054 2006-05-12  Wade Berrier <wberrier@novell.com>
17056         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
17058 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
17060         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
17061         functions try to allocate from the image mempool.
17063 2006-05-12  Dick Porter  <dick@ximian.com>
17065         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
17067 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
17069         * object.c: The FieldGetter and FieldSetter methods require the full
17070         name of the class, not only the name. Fixes bug #78277.
17072 2006-05-11  Miguel de Icaza  <miguel@novell.com>
17074         * loader.c (method_from_memberref): Do not pass the NULL klass to
17075         mono_loader_set_error_() methods.  Pass the non-NULL value
17076         (class). 
17078 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
17080         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
17081         (mono_assembly_close): Null out assembly->image->references after freeing it.
17083         * image.c (mono_image_close): Free image->references.
17084         
17085         * reflection.c (mono_image_basic_init): Fix a small memory leak.
17087 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
17089         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
17090         before checking if it's NULL (g_assert).
17092 2006-05-10  Martin Baulig  <martin@ximian.com>
17094         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
17095         I thought I already killed that two months ago, but now it somehow reappeared.
17097 2006-05-10  Martin Baulig  <martin@ximian.com>
17099         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
17101 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
17103         * reflection.c: Allocate memory for dynamically created methods in the image
17104         mempools.
17106 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
17108         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
17109         don't use the ad pointer before checking if it's NULL (g_assert).
17111 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
17113         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
17114         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
17116         * marshal.c: Allocate all signatures from mempools.
17118         * marshal.c: Allocate some more signatures from mempools.
17120 2006-05-09  Miguel de Icaza  <miguel@novell.com>
17122         * object.c (mono_load_remote_field): The code used to provide a
17123         temporary variable for returning results if the user did not
17124         provide a result pointer.  But our temporary variable was allocted
17125         on the satck.
17127         Fix calling code to always pass a result area.   Coverity ID 103.
17129 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
17131         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
17132         value, not the old. Fixes #78312.
17133         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
17135         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
17136         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
17137         per-image cache.
17139         * assembly.c (mono_assembly_close): Free image->references.
17141         * assembly.c (mono_assembly_names_equal): Fix a warning.
17142         (mono_assemblies_cleanup): Cleanup more global data.
17144         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
17146         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
17147         ptr_cache and image->modules.
17149         * image.c (mono_image_init): Allocate array_cache lazily.
17150         
17151 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17153         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
17154         behavior was changed recently and has bad side effects.
17156 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
17158         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
17159         
17160         * assembly.c (mono_assembly_close): Remove a debug printf.
17162         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
17164         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
17165         to also allow for temporary references between mono_image_open ()/close ().
17167         * domain.c (get_runtimes_from_exe): Add a FIXME.        
17169 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
17171         * marshal.c: Fix support for dynamic methods.
17173         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
17175         * marshal.c (mono_marshal_cleanup): New cleanup function.
17177         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
17178         image mempools.
17180         * class.c (mono_class_init): Fix leaking class->nested_classes.
17182         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
17184         * image.c (mono_image_init): Initialize the new cashes.
17186         * image.c (mono_image_close): Destroy the new cashes.
17188         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
17190         * mempool.c (mono_mempool_strdup): New helper function.
17192         * class-internals.h: Add prototype for mono_loader_unlock ().
17194         * domain.c (mono_jit_info_table_find): Fix a warning.
17195         (mono_debugger_check_runtime_version): Ditto.
17197         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
17198         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
17199         functions to these modules.
17201         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
17202         metadata modules.
17203         
17204         * marshal.c (mono_free_bstr): Fix a warning.
17206         * assembly.c (mono_assembly_open_full): Fix another small leak.
17208         * object.c: Fix some unload leaks in the remoting code.
17210         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
17211         function.
17213         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
17215         * reflection.c: Fix some unload leaks in dynamic assemblies.
17217 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
17219         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
17220         * marshal.h: Add BSTR support on Win32
17221         * icall.c: Add BSTR icalls
17222         * metadata.h: Add BSTR enums
17224 2006-04-28  Miguel de Icaza  <miguel@novell.com>
17226         Work to catch the crash from #76795 and turn it into an
17227         exception.   As I stubbed out pieces of the VisualBasic support,
17228         I found a number of places where the code was failing and I added
17229         checks to those places. 
17230         
17231         * metadata.c (do_mono_metadata_parse_generic_class): Make this
17232         function return a status code.  If we fail to parse the signature
17233         from mono_metadata_parse_generic_inst, return FALSE.
17235         * loader.c (mono_get_method_from_token): If we fail to load the
17236         method (mono_class_get) return NULL.   
17238         * (method_from_memberref): Return NULL if we are unable to parse
17239         the method signature
17241         (mono_loader_error_prepare_exception): Since we now use the
17242         loader_error flag internally to stop processing, and obtaining
17243         exceptions that might be thrown will walk this code path the
17244         proper way of going from a MonoLoaderError into a
17245         MonoException was convoluted.   This new routine encapsulates the
17246         process of turning the error into an exception and *clearing* the
17247         error afterwards.
17248         
17249 2006-04-27  Miguel de Icaza  <miguel@novell.com>
17251         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
17252         with missing assemblies), and to cope with:
17254                 * Missing fieldref from a non-existing assembly.
17255                 * Missing methodref from a non-existing assembly.
17257         The first batch of work to address *some* of the issues from 76661.
17258         
17259         * object.c (mono_class_create_runtime_vtable): If we fail to
17260         initialize the class raise the exception here. 
17262         * metadata.c (mono_class_get_overrides_full): If any methods fail
17263         to load return the failure to the caller.
17265         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
17266         flagging assemblies that failed to load.   
17268         Do not crash if we are unable to load the assembly.
17270         (mono_assembly_close): Do nothing with REFERENCE_MISSING
17271         assemblies. 
17273         * loader.c (mono_loader_set_error_type_load): Change the
17274         convention to always pass unallocated strings, so we make our own
17275         copies (I know our own code had duplicated strings before, but
17276         this keeps the normal conventions).
17277         (method_from_memberref): Call mono_loader_set_error_method_load
17278         for all possible failures of loading the class. 
17279         Remove assert, turn into a loader error.
17281         (mono_loader_error_to_exception): Move this routine from mini
17282         (mini_loader_error_to_exception) there was no need to have that in
17283         mini. 
17285         * class.c (mono_class_from_typeref): If we were not able to load
17286         the assembly with mono_assembly_load_reference, call the
17287         mono_loader_set_error_type_load to register the problem.
17289         (mono_class_setup_fields): If we fail to load the type from
17290         mono_metadata_parse_type_full, call mono_class_set_failure and
17291         break from the loop.
17293         If class->exception_type is set, we do not layout the fields as
17294         that might crash the runtime, and instead return (from breaking
17295         from the previous loop).
17297         (mono_class_setup_vtable): This now returns a boolean indicating
17298         whether the table was properly setup.   The decision is driven by
17299         mono_class_get_overrides_full which might run into non-existing
17300         methods. 
17301         
17302         (mono_class_init): Returns TRUE on success or FALSE if there was a
17303         problem in loading the type (incorrect assemblies, missing
17304         assemblies, methods, etc).
17306         When we call mono_class_setup_fields we also check for a potential
17307         error inside this call (either a class exception or a general
17308         loader exception).
17310         (mono_class_create_from_typedef): If the parent fails to load
17311         (calling mono_class_get_full) return NULL.
17312         
17313         ** Important **
17315         calls to mono_metadata_parse_type_full should be checked
17316         everywhere and set the mono_class_set_failure
17317         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
17319         The current patch checks the places where my manually constructed
17320         tests show the errors are showing up, but we should do it
17321         everywhere. 
17323         ** Important2 **
17325         mono_class_init return values should be tested everywhere, like
17326         the previous case this is something that we should audit
17327         everywhere and not only on the cases exposed by the tests I
17328         created. 
17330 2006-04-26  Miguel de Icaza  <miguel@novell.com>
17332         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
17333         boolean parameter and instead pass the information on `options'
17334         parameter (FileOptions).
17336         * icall.c: Register the new signature for MonoIO.Open.
17338         * debug-helpers.c (dis_one): Trying to understand how coverity
17339         works.  Fix Run 5, item 78.
17341 2006-04-26  Dick Porter  <dick@ximian.com>
17343         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
17344         dereference.
17346 2006-04-25  Martin Baulig  <martin@ximian.com>
17348         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
17350         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
17351         debugger_thread_created().
17352         (debugger_gc_push_all_stacks): Don't handle the main thread in any
17353         special way.
17354         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
17355         (mono_debugger_finalize_threads): New function; undo the effects
17356         of mono_debugger_init_threads().
17357         (mono_debugger_create_all_threads): Removed.
17359 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
17361         * image.c (mono_image_close): Tidy up trace messages.
17363         * assembly.c (mono_assembly_close): Ditto.
17365         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
17366         no longer references an already freed assembly. Fixes #78168.
17368 2006-04-21  Dick Porter  <dick@ximian.com>
17370         * threads.c (mono_thread_detach): Fix reference counting when
17371         detaching threads.
17373 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
17375         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
17376         #78155.
17378 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
17380         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
17381         (mono_type_to_stind): Ditto.
17383         * marshal.c: Use the new helper functions to simplify code.
17385         * image.c (mono_image_close): Add some code for help debug assembly unloading
17386         problems.
17388         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
17389         image mempool.
17391         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
17392         assembly was already loaded in another appdomain. Fixes #78083.
17394 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
17396         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
17397         referenced assemblies.
17398         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
17400         * domain.c (mono_domain_free): Add a trace message.
17402         * appdomain.c (add_assemblies_to_domain): Ditto.        
17404         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
17405         field.  
17407 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
17409         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
17411 2006-04-12  Martin Baulig  <martin@ximian.com>
17413         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
17414         `USE_INCLUDED_LIBGC'.   
17416 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
17418         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
17419         the patch contains ../ and a small directory name later. Hopefully fixes
17420         #78035.
17422 2006-04-10  Martin Baulig  <martin@ximian.com>
17424         Clean up the debugger's thread-handling code.
17426         The debugger's thread-handling code has been moved from
17427         ../mini/debug-debugger.c to threads.c.  We now iterate directly
17428         over the `threads' hash, keep track of exiting threads and also
17429         use proper locking.
17431         We can now debug XSP and XSP based applications with the debugger.
17433         * object-internals.h (MonoThread): Added `gpointer end_stack'.
17435         * threads.h
17436         (MonoThreadCallbacks): Removed; this was only used by the debugger.
17437         (mono_install_thread_callbacks): Likewise.      
17439         * threads.c (mono_thread_callbacks): Removed.
17440         (debugger_thread_created, debugger_thread_exited): New static functions.
17441         (start_wrapper): Call debugger_thread_created().
17442         (thread_cleanup): Call debugger_thread_exited().
17443         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
17444         (mono_debugger_init_threads): New public function.
17445         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
17446         iterate directly over the `threads' hash and also use proper locking.
17448         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
17450         * mono-debug-debugger.h
17451         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
17453 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
17455         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
17456         argument type=array. Fixes #78057.
17458 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
17460         * culture-info-table.h : regenerated. Fixed bug #69652.
17462 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
17464         * loader.c metadata.c: Reapply a variant r59116.
17465         
17466         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
17468         * class.c (mono_class_setup_interface_offsets): New internal function.
17470         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
17471         interfaces too. Fixes #77398.
17473         * reflection.c (encode_cattr_value): Add support for 
17474         parameter type=object, argument type=array.
17475         (load_cattr_value): Ditto. Fixes #77916.
17477         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
17478         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
17480         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
17481         a byval char array and CharSet is Ansi.
17483         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
17485 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
17487         * metadata.c: Add some locking comments.
17488         
17489         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
17490         mempool.
17491         (mono_metadata_free_method_signature): Don't free the signature itself.
17493         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
17495         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
17496         reference the same MonoImage.
17497         (mono_assembly_load_from_full): Add an assert.
17499 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
17501         * image.c (mono_image_close): Don't put the image we are about to free into the
17502         loaded_images_guid_hash.
17504         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
17505         to reduce code duplication.
17507         * marshal.c: Register the native functions called by this module as icalls, to
17508         somewhat centralize the creation of MonoMethodSignature's.
17510         * loader.c (mono_method_signature): Add a cache for method signatures.
17512         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
17513         the parameter attributes of a method.
17514         (mono_metadata_parse_method_signature_full): Refactored the computation of
17515         parameter attributes into a separate function. Also avoid one allocation in
17516         most cases.
17518         * assembly.c (mono_assembly_close): Ditto.
17520         * image.c (mono_image_close): Log trace messages with INFO level.
17522         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
17524         * image.c reflection.c: Correct reference counting of image modules.
17525         
17526         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
17527         of this function from the image mempool.
17528         
17529         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
17530         to allow more cached types to be used.
17532         * mono-debug.c (mono_debug_add_method): Appled patch from
17533         David S. Miller  <davem@sunset.davemloft.net>: Access 
17534         minfo->lexical_blocks[] entry elements using read32().
17536 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
17538         * loader.c (mono_free_method): No longer free the method header for non-dynamic
17539         methods as it is allocated from the mempool.
17541         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
17542         image mempool.
17544         * metadata-internals.h: Add comments describing the reference counting scheme
17545         used for MonoImage and MonoAssembly.
17547         * image.c assembly.c reflection.c: Rework reference counting of images and 
17548         assemblies so they are freed when the runtime is shut down. Free some 
17549         additional memory structures when an image is unloaded.
17550         
17551 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
17553         * class.c loader.c reflection.c: Allocate more data structures in
17554         the image mempool.
17556 2006-03-31  Miguel de Icaza  <miguel@novell.com>
17558         * icall.c
17559         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
17560         build on pre glib 2.4 systems.
17562 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
17564         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
17566         * icall.c: Fix some warnings.
17568 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
17570         * culture-info-table.h : regenerated.
17572 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
17574         * threads.c, object-internals.h, verify.c: changed the culture caching
17575         code to use a normal MonoArray for storage so the GC can keep track of
17576         them easily. Fixed bits of the cache logic, too and simplified the
17577         code.
17579 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
17581         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
17582         thread for non-Boehm GCs.
17584 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
17586         * domain.c, object.c, domain-internals.h: reduce the amount of memory
17587         needed to keep track of the data for static fields.
17589 2006-03-29  Raja R Harinath  <rharinath@novell.com>
17591         Fix #75172
17592         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
17593         for interface classes.  Use 'num_methods' instead.
17594         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
17595         before using '->vtable_size' field.
17597 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
17599         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
17600         doesn't contain managed pointers, so use a normal hashtable.
17602 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
17604         * reflection.c, class-internals.h, domain.c: fixed handling of types
17605         used as values for objects in custom attributes (bug #77915):
17607 2006-03-24  Martin Baulig  <martin@ximian.com>
17609         * class.c (mono_class_setup_fields): Added support for generic
17610         instances; fixes #77580.
17612 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17614         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
17616 2006-03-24  Dick Porter  <dick@ximian.com>
17618         * file-io.c (get_file_attributes): More stat macro breakage.
17619         Fixes bug 77759.
17621 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
17623         * profiler.c: added the file=filename option in the default profiler
17624         to output the profile data to filename.
17626 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17628         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
17629         bug #77877.
17631 2006-03-22  Martin Baulig  <martin@ximian.com>
17633         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
17634         allocated `MonoClassField *' in `fb->handle'.
17636 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
17638         * class.c, image.c, metadata-internals.h: implemented new mechanism to
17639         allocate interface ID to save memory and allow better ID reuse on
17640         appdomain unload. setup_generic_vtable () removal from Martin.
17642 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
17644         * object.h, appdomain.c, domain.c, exception.c, icall.c,
17645         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
17646         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
17647         write barriers for reference stores with managed objects accessed with
17648         C structures in the runtime and in embedding programs.
17650 2006-03-20  Raja R Harinath  <rharinath@novell.com>
17652         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
17653         'interface_id' and 'max_interface_id' fields of MonoClasses
17654         representing open generic types.
17656 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
17658         * object.h, object.c, icall.c: added functions to deal with
17659         storing valuetypes that contain references in managed objects.
17660         * reflection.c, string-icalls.c, threads.c, marshal.c: small
17661         fixes and comments around uses of mono_array_addr ().
17663 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
17665         * object.h, icall.c, monitor.c: object.GetHashCode ()
17666         implementation that supports the moving garbage collector.
17668 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
17670         * icall.c, threads-types.h, threads.c: implemented finalizer for
17671         LocalDataStoreSlot.
17673 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
17675         * metadata.c (mono_type_size): Add a fixme.
17676         (mono_type_stack_size): Ditto.
17678         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
17679         'type_forwarders' field.
17681         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
17682         attribute from net 2.0.
17684         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
17685         from class.c.
17687         * class.c (mono_class_setup_fields): Fix a warning.
17688         
17689         * class.c (mono_class_from_name): Add support for assemblyref entries
17690         in the EXPORTEDTYPE table.
17692         * reflection.c: Add support for handling type forwarders under net 2.0.
17694         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
17695         
17696 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
17698         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
17699         overwriting entries in ModuleBuild->types, also clean up the code
17700         a little. Fixes #77774.
17702 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
17704         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
17705         load friend assembly info when present.
17707 2006-03-14  Raja R Harinath  <rharinath@novell.com>
17709         Fix crasher on gtest-158.cs.
17710         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
17711         the return value if the MonoClass we want is yet in an
17712         inconsistent state.
17713         * class.c (mono_class_create_from_typedef): Add an comment
17714         explaining an order dependency between mono_class_setup_parent and
17715         mono_class_setup_mono_type.
17717 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
17719         * class.c: documentation updates and events bug fix.
17721 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
17723         * class.c: some cleanup, locking fixes.
17725 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
17727         * class.c: fix the generics code to setup nested
17728         type info to the instantiated type (bug #77770).
17730 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
17732         * marshal.c: fixed a few type correctness issues.
17734 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
17736         * loader.c: the Set/Get/Addrtess array methods should be public.
17738 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
17740         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
17741         
17742         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
17743         info->wrapper.
17745 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
17747         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
17749         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
17751         * mempool.c (mono_mempool_alloc): Speed this up a bit.
17752         (mono_mempool_alloc0): Ditto.
17754 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17756         * socket-io.c:
17757         (create_object_from_sockaddr): it was allocating 4 extra bytes
17758         for the AF_UNIX data. Fixes bug #77747.
17760 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
17762         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
17764 2006-03-09  Dick Porter  <dick@ximian.com>
17766         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
17767         Fixes bug 76966 again.
17769 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
17771         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
17772         names from r57532
17773         * appdomain.c: Bumped corlib version to 48 (due to r57532)
17775 2006-03-07  Martin Baulig  <martin@ximian.com>
17777         * object.c
17778         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
17780 2006-03-07  Martin Baulig  <martin@ximian.com>
17782         * class.c
17783         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
17784         regression introduced in r56970; see gtest-252.cs.
17786         * loader.c (mono_get_method_constrained): Correctly handle generic
17787         methods; see gtest-253.cs.
17789 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
17791         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
17793 2006-03-04  Martin Baulig  <martin@ximian.com>
17795         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
17796         compute the parent type at runtime, just like we're already doing
17797         it for interfaces.
17799         * reflection.c
17800         (mono_reflection_bind_generic_parameters): Don't compute the
17801         parent type anymore.
17803         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
17805 2006-03-04  Martin Baulig  <martin@ximian.com>
17807         * mono-debug-debugger.h
17808         (mono_debugger_create_notification_function): Allocate memory at
17809         runtime and return a pointer to it.
17811 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
17813         * assembly.c: Fix windows build.
17814         
17815         * assembly.c: Fix build.
17817         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
17819         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
17820         
17821 2006-03-03  Dick Porter  <dick@ximian.com>
17823         * process.c
17824         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
17825         Check parameters before dereferencing them.  Fixes Aaron's part of
17826         bug 77393.
17828 2006-03-03  Raja R Harinath  <rharinath@novell.com>
17830         Fix performance regression.
17831         * loader.c (find_method_in_class): Add 'from_class' argument.
17832         Rename 'klass' argument to 'in_class'.  The signature is compared
17833         against the method in 'in_class', and the corresponding method is
17834         returned from 'from_class'.
17835         (find_method): Walk both 'in_class' and 'from_class' in parallel.
17836         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
17837         type definition and generic instantiation in parallel.
17838         (mono_get_method_constrained): Update to changes.
17840 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
17842         * threads.c: make sure the domain is correct, too when doing
17843         mono_thread_attach ().
17845 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
17847         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
17848         windows. Fixes #77683.
17850 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
17852         * object.h, *: introduced specific way to set elements of an array
17853         of references to be used as write barrier. Still need to audit the
17854         uses of mono_array_addr.
17856 2006-03-01  Miguel de Icaza  <miguel@novell.com>
17858         * object-internals.h: New field to cache the assmebly name, patch
17859         from Tambet Ingo (tambet@ximian.com)
17861 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
17863         * decimal.h, class-internals.h, metadata-internals.h,
17864         file-io.h: mark a few function declarations as internal, to
17865         reduce the number of PLT entries.
17867 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17869         * file-io.c: fix typo in warning message.
17871 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
17873         * loader.c: on unix, lookup the "*A" version of a function
17874         if charset is auto as a second option before failing.
17876 2006-02-28  Raja R Harinath  <rharinath@novell.com>
17878         * class.h (mono_class_inflate_generic_method): Revert to two
17879         argument version.
17880         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
17881         (mono_class_inflate_generic_method_full): Add.
17882         * class.c (mono_class_inflate_generic_method_full): Rename from
17883         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
17884         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
17885         * loader.c, reflection.c: Update to changes.
17887 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
17889         * icall.c: const fixes and small improvements.
17891 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17893         * threadpool.c: for asynchronous connect(), enable the same workaround
17894         for BSD 6 as for the Mac. Fixes bug #77637.
17896 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
17898         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
17899         formatted classes. Fixes #77524.
17901 2006-02-24  Raja R Harinath  <rharinath@novell.com>
17903         * class.c (inflate_generic_type): Add a couple more
17904         micro-optimizations.
17905         (inflate_generic_context): Don't use the 'gmethod' from
17906         'inflate_with'.
17907         (mono_class_inflate_generic_method): If the method has generic
17908         parameters, but the passed-in context doesn't have a 'gmethod',
17909         create one.  Use the possibly simplified generic instantiation
17910         from the declaring class instead of the one passed in.
17912 2006-02-24  Raja R Harinath  <harinath@gmail.com>
17914         Make generic method signature and method header handling lazy.
17915         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
17916         (inflate_generic_header): Likewise.
17917         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
17918         parameter to avoid inflating types.
17919         (mono_get_inflated_method): Empty out.
17920         * class.h (mono_class_inflate_generic_method): Update to changes.
17921         * loader.c (mono_get_method_from_token): Don't parse signature for
17922         generic methods, nor methods of generic classes.
17923         (mono_method_signature): Rename from 'mono_method_signature'.
17924         Inflate signature on demand.
17925         (mono_method_get_header): Inflate method header on demand.
17926         * reflection.c: Update to changes.
17928 2006-02-23  Raja R Harinath  <rharinath@novell.com>
17930         * metadata.c (mono_metadata_inflate_generic_inst): If the
17931         instantiation is closed, don't bother expanding it in the new
17932         context.
17933         * class.c (inflate_generic_class): If the generic instantiation
17934         doesn't change after inflation, return the argument itself.
17935         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
17936         Add bounds checks.
17937         (inflate_generic_context): If neither the generic class nor the
17938         generic method instantiations change, return the original context.
17939         * reflection.c (mono_method_get_object): Do
17940         'mono_get_inflated_method' before accessing the ->klass field.
17941         (inflate_mono_method): Don't create a MonoGenericMethod unless
17942         necessary.
17943         (inflate_method): Don't pass a constructed type as the declaring
17944         type of a methodbuilder.
17946 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
17948         * object.c: fix memory overwrite.
17950 2006-02-22  Dick Porter  <dick@ximian.com>
17952         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
17953         it doesn't work any more.
17954         (mono_threads_request_thread_dump): Fix unused variable warnings.
17956 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
17958         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
17959         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
17960         the public header file.
17962 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
17964         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
17966 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
17968         * class-internals.h, object.c: reduce the size of MonoVTable
17969         and store the interface_offsets array at negative offsets.
17971 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
17973         * metadata.c: tweak table descriptors data structures to reduce
17974         size and runtime relocations.
17976 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
17978         * marshal.c: fix some types and opcodes to be type-safe
17979         in marshaling wrappers.
17981 2006-02-21  Ankit Jain  <jankit@novell.com>
17983         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
17985 2006-02-21  Raja R Harinath  <rharinath@novell.com>
17987         * metadata.c (get_constraints): Relax debugging checks for monodis.
17989 2006-02-21  Ankit Jain  <jankit@novell.com>
17991         * metadata.c (mono_metadata_load_generic_params): Move the code
17992         checking for ambiguous generic params from here to mono/dis/get.c
17993         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
17995 2006-02-21  Raja R Harinath  <harinath@gmail.com>
17997         Fix assertion triggered when compiling nemerle.
17998         * class.c (mono_get_shared_generic_inst): Rename from
17999         get_shared_inst and make non-static.
18000         * loader.c (mono_get_shared_generic_method): New.  Used to create
18001         the MonoGenericContext-equivalent of a MonoGenericContainer.
18002         (mono_get_method_from_token): Initialize the 'context' field of
18003         the created MonoGenericContainer.
18004         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
18005         * metadata.c (get_constraints): Add sanity check.
18006         * class-internals.h: Add new internal methods.
18008         * reflection.c (verify_safe_for_managed_space): New sanity check.
18009         Currently checks that owner-less generic parameters aren't allowed
18010         in managed space.
18011         (mono_type_get_object): Use it.
18012         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
18013         that are now in mono_type_get_object.
18014         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
18016 2006-02-19  Raja R Harinath  <harinath@gmail.com>
18018         * metadata.c (mono_type_create_from_typespec): Rename from
18019         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
18020         argument and caching of types in the generic container.
18021         (unwrap_arrays, find_generic_param): Remove.
18022         * metadata-internals.h: Update.
18023         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
18025 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
18027         * class.c (mono_class_get_exception_for_failure): Fix a warning.
18029         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
18030         return values. Fixes #77581.
18032         * class.c (mono_fnptr_class_get): Switch name and name_space.
18034         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
18035         classes and add support for [In, Out] attributes.
18036         (mono_marshal_free_asany): Ditto. Fixes #77524.
18038 2006-02-18  Raja R Harinath  <harinath@gmail.com>
18040         * class.c (mono_class_from_generic_parameter): Make more robust to
18041         incomplete MonoGenericContainers from monodis.
18043 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
18045         * class-internals.h: added some more exception types.
18046         * class.c, metadata.c: added a few checks to handle missing
18047         types.
18049 2006-02-17  Raja R Harinath  <rharinath@novell.com>
18051         Use owner-less generic-params some more.
18052         * class.c (my_mono_class_from_generic_parameter): Remove.
18053         (mono_class_from_generic_parameter): Handle null image,
18054         param->name and param->owner.
18055         (mono_class_from_mono_type): Update.
18056         (mono_class_create_from_typespec): Remove 'container' parameter.
18057         If that parameter is non-null, the result is always inflated by
18058         'mono_class_get_full' anyway.
18059         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
18060         parameter.
18061         (mono_class_get_full): Update.
18063         * class.c (inflate_generic_type) [GENERICINST]: If the generic
18064         instance is not open, don't bother inflating.
18065         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
18066         parse metadata for inflated classes.
18067         (_mono_class_get): Change GenericContext* parameter to
18068         GenericContainer*.
18069         (mono_class_create_from_typespec): Likewise.  Simplify, and
18070         implement trivially.  All the cases are handled in
18071         mono_class_from_mono_type.  Don't inflate returned class.
18072         (mono_class_get_full): Delegate GENERICINST optimization to
18073         inflate_generic_type.
18074         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
18076 2006-02-16  Dick Porter  <dick@ximian.com>
18078         * socket-io.c (create_object_from_sockaddr): Fix typo.
18079         (create_sockaddr_from_object): Check array lengths before
18080         potentially accessing items off the end.
18081         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
18082         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
18083         (ves_icall_System_Net_Sockets_Socket_Send_internal)
18084         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
18085         length checks to avoid wraparound overflows.
18086         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
18087         contents of the array of sockets
18088         (hostent_to_IPHostEntry2)
18089         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
18090         Check return value of inet_ntop ().
18091         (addrinfo_to_IPHostEntry): Fix typo
18093 2006-02-16  Raja R Harinath  <rharinath@novell.com>
18095         Type metadata parsing doesn't use generic-instantiation information.
18096         * metadata.c (mono_metadata_parse_array_full): Change
18097         MonoGenericContext* parameter to MonoGenericContainer*.
18098         (mono_metadata_parse_type_full): Likewise.
18099         (mono_type_create_from_typespec_full): Likewise.
18100         (mono_metadata_parse_mh_full): Likewise.
18101         (mono_metadata_parse_generic_inst): Likewise.
18102         (do_mono_metadata_parse_generic_class): Likewise.
18103         (do_mono_metadata_parse_type): Likewise.
18104         * metadata-internals.h: Update to changes.
18105         * class.c (mono_class_find_enum_basetype): Likewise.
18106         (mono_class_setup_fields): Likewise.
18107         (mono_class_create_from_typespec): Likewise.
18108         * loader.c (method_from_methodspec): Likewise.
18109         (mono_get_method_from_token): Likewise.
18110         (mono_method_get_header): Likewise.
18112 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
18114         * marshal.c: handle additional GENERICINST case (patch from
18115         Thong Nguyen <tum@veridicus.com>).
18116         Fix a few cases where LDIND_I/STIND_I was used for references.
18118 2006-02-16  Raja R Harinath  <rharinath@novell.com>
18120         * reflection.c (mono_reflection_get_token): Remove unused variable.
18122 2006-02-16  Martin Baulig  <martin@ximian.com>
18124         * reflection.c (mono_reflection_get_token): Add support for fields
18125         in instantiated generic types.
18127         * icall.c
18128         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
18130 2006-02-15  Martin Baulig  <martin@ximian.com>
18132         * icall.c
18133         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
18134         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
18135         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
18136         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
18138 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
18140         * class.c, metadata.c, metadata.h, object.c, icall.c,
18141         marshal.c: changed mono_type_get_underlying_type () to do
18142         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
18143         Fixed handling of instantiated generic valuetypes (bug #75479).
18145 2006-02-15  Raja R Harinath  <rharinath@novell.com>
18147         * metadata.c (mono_metadata_decode_signed_value): Simplify.
18148         Delegate to mono_metadata_decode_value, and work on the returned value.
18150         * icall.c (ves_icall_MonoType_GetGenericArguments):
18151         Add consistency check here too.
18152         
18153 2006-02-15  Ankit Jain  <jankit@novell.com>
18155         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
18156         char/short etc.
18158 2006-02-15  Ankit Jain  <jankit@novell.com>
18160         * metadata.c (mono_metadata_decode_signed_value): New function to decode
18161         signed values, used only for representing lower bounds of arrays.
18162         (mono_metadata_parse_array_full): Use new
18163         mono_metadata_decode_signed_value to decode lower bounds.
18165 2006-02-14  Martin Baulig  <martin@ximian.com>
18167         * reflection.c
18168         (mono_reflection_get_token): Support "MonoGenericMethod" and
18169         "MonoGenericCMethod" and allow generic instances / methods.
18171 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
18173         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
18174         to obtain the terminal size using an ioctl.
18176         * object.c (mono_nullable_init): Revert this as nullable reference
18177         types are not valid.
18178         (mono_nullable_box): Ditto.
18180 2006-02-09  Dick Porter  <dick@ximian.com>
18182         * threads.c (mono_thread_detach): Drop a reference to the thread
18183         we're detaching.
18185 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
18187         * object.c (mono_nullable_init): Handle nullable reference types.
18188         (mono_nullable_box): Ditto. Fixes #77446.
18190 2006-02-07  Martin Baulig  <martin@ximian.com>
18192         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
18194 2006-02-07  Ankit Jain  <jankit@novell.com>
18196         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
18197         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
18198         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
18199         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
18200         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
18201         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
18203 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
18205         * class.c (mono_class_create_generic): Set type_token as well.
18207         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
18208         compatible with MS.
18210 2006-02-02  Martin Baulig  <martin@ximian.com>
18212         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
18213         has never been used so far.
18215 2006-02-02  Martin Baulig  <martin@ximian.com>
18217         * mono-debug-debugger.h: Changed comment at the top of this file;
18218         the header is not installed, but it's safe to #include it from
18219         within the JIT.
18221         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
18222         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
18224 2006-02-02  Martin Baulig  <martin@ximian.com>
18226         * mono-debug.h
18227         (MonoSymbolTable): Removed the `metadata_info' field.
18229         * mono-debug.c
18230         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
18232         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
18233         (mono_debugger_add_builtin_types): Removed.
18234         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
18235         (mono_debugger_create_notification_function): We now operate on a
18236         pre-allocated area; take a `gpointer' and return `void'.
18238         * mono-debug-debugger.c
18239         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
18240         (mono_debugger_add_builtin_types): Removed.
18242 2006-02-02  Martin Baulig  <martin@ximian.com>
18244         * threads.c (mono_debugger_create_all_threads): New public method.
18246 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
18248         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
18249         breaks on several platforms.
18251 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
18253         * assembly.c: the VS.NET build doesn't supply default values for
18254         MONO_ASSEMBLIES and MONO_CFG_DIR.
18256 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
18258         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
18259         helper function.
18261         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
18263         * loader.c (method_from_memberref): Fix a warning.
18265         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
18267         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
18268         with explicit layout. Fixes #77433.
18270 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
18272         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
18273         max_interface_id is initialized before using it. Fixes #77398.
18274         (ves_icall_Type_GetInterfaces): Ditto.
18276 2006-01-30  Raja R Harinath  <rharinath@novell.com>
18278         * metadata.c (mono_metadata_parse_method_signature_full): Don't
18279         allocate memory for parameter attributes when parsing memberref
18280         signatures.
18281         * loader.c (mono_loader_set_error_method_load): Don't warn.
18282         (method_from_memberref): Ensure MissingMethodException gets thrown
18283         if method is not found.  Make warning more informative.
18285 2006-01-29  Raja R Harinath  <harinath@gmail.com>
18287         Fix #77397
18288         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
18289         return true if is byref.
18290         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
18291         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
18292         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
18294 2006-01-27  Raja R Harinath  <rharinath@novell.com>
18296         Fix tests/find-method.2.il
18297         * loader.c (find_method, find_method_in_class): Remove is_inflated
18298         argument.  Revert 2006-01-18 change.
18299         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
18300         is generic, search for method in its generic definition.
18301         * class.c (mono_class_setup_vtable_general): Print generic
18302         arguments of generic types in debugging printf.
18304 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
18306         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
18308         * threads.c (mono_threads_request_thread_dump): New helper function.
18310 2006-01-25  Raja R Harinath  <rharinath@novell.com>
18312         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
18314 2006-01-25  Ankit Jain  <jankit@novell.com>
18316         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
18317         move definition to ..
18318         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
18319         
18320 2006-01-25  Ankit Jain  <jankit@novell.com>
18321             Raja R Harinath  <rharinath@novell.com>
18323         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
18324         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
18325         as necessary.
18327 2006-01-25  Martin Baulig  <martin@ximian.com>
18329         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
18330         `MonoDebuggerThread' into debug-debugger.c.
18332 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
18334         * profiler.c: fix printing of data.
18336 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
18338         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
18339           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
18341 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
18343         * object.c: fix deadlock related to string interning.
18345 2006-01-23  Martin Baulig  <martin@ximian.com>
18347         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
18349         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
18351 2006-01-23  Martin Baulig  <martin@ximian.com>
18353         * mono-debug.h: Moved the prototypes of some functions which are
18354         used by the JIT here from mono-debug-debugger.h.
18356 2006-01-21  Martin Baulig  <martin@ximian.com>
18358         * Makefile.am: Don't install mono-debug-debugger.h.
18360 2006-01-21  Martin Baulig  <martin@ximian.com>
18362         * mono-debug-debugger.h: Enforce the private status of this header
18363         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
18364         Moved some stuff from mono-debugger-jit-wrapper.h here.
18366 2006-01-20  Raja R Harinath  <rharinath@novell.com>
18368         * class.c (mono_class_from_typeref): Add a sanity test to help
18369         catch lack of assembly load/search hooks.
18371 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
18373         * marshal.c (emit_struct_conv): Relax the fields with same offset
18374         check even more. Fixes #77230.
18376 2006-01-18  Martin Baulig  <martin@ximian.com>
18378         * loader.c (find_method_in_class): Added `gboolean is_inflated'
18379         argument; if false, we compare the uninstantiated signatures.
18380         (method_from_memberref): Compare the uninstantiated signatures;
18381         fixes #76417.
18383 2006-01-18  Robert Jordan  <robertj@gmx.net>
18385         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
18386         Clear the weak link. Fixes bug #77170.
18388         * gc.c (mono_gchandle_free):
18389         Reflect *-gc.c changes (tiny optimization).
18391 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
18393         * metadata.c (mono_metadata_signature_dup): Applied patch from
18394         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
18395         Fixes #77288.
18397 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
18399         * marshal.c (emit_struct_conv): Allow fields with the same offset when
18400         marshalling from native to managed code. Fixes #77230.
18402 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18404         * threadpool.c: fix problem (Mac only) when more than one asynchronous
18405         connect. Fixes bug #77020.
18407 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
18409         * class.c: fixed id assignement for nested interfaces (bug #77275).
18410         Added also better info for --print-vtable debugging.
18412 2006-01-12  Martin Baulig  <martin@ximian.com>
18414         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
18415         interfaces on-the-fly; fixes #76625.
18417         * class-internals.h
18418         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
18419         don't need that anymore.
18421 2006-01-12  Miguel de Icaza  <miguel@novell.com>
18423         * socket-io.c
18424         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
18425         To avoid initing the nested_classes when not needed I turned the
18426         PeerCredData as a toplevel internal class, as it has to be shared
18427         anyways. 
18429         Fixes the CASA issue.
18431 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
18433         * domain.c: Accessors for MonoJitInfo
18435         * profiler-private.h: Add jitinfo to the end jit hook
18437         * profiler.[ch]: Define new hooks, called after jitting which give
18438         the MonoJitInfo that was compiled
18440 2006-01-10  Martin Baulig  <martin@ximian.com>
18442         * class.c (mono_class_setup_events): Add support for generic
18443         classes; fixes #76440.
18445 2006-01-06  Raja R Harinath  <rharinath@novell.com>
18447         Fix #77160.
18448         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
18449         on passed-in method.
18451 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
18453         * object.c (mono_runtime_invoke_array): Add Nullable support.
18455         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
18457 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
18459         * file-io.c: Don't consider sockets as directory and avoid an endless
18460         loop. Fix bug #76966.
18462 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
18464         * object.c (mono_nullable_init): New helper function.
18465         (mono_nullable_box): Ditto.
18467         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
18469         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
18471         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
18472         
18473 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
18475         * class.c (mono_class_is_assignable_from): Make T assignable to 
18476         Nullable<T>.
18478 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
18480         * appdomain.c: Bump corlib version to 46.
18481         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
18482         serialization purpose) and changed ves_icall_System_Reflection_
18483         Assembly_get_code_base signature to accept a boolean (to escape, or 
18484         not, the assembly code base).
18486 2005-12-23  Dick Porter  <dick@ximian.com>
18488         * icall.c: 
18489         * threads-types.h: 
18490         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
18491         CreateEvent icall now returns "created" boolean parameter.
18493 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
18495         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
18496         #76967.
18498         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
18499         when attr_klass is an interface. Fixes #77045.
18501 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
18503         * marshal.c (emit_struct_conv): Fix previous patch.
18504         
18505         * marshal.c (emit_struct_conv): Add a check for fields with the same
18506         offset.
18508 2005-12-20  Raja R Harinath  <rharinath@novell.com>
18510         Fix regression in Mono.C5.
18511         * class.c (mono_class_create_generic): If 'klass' is an interface
18512         set up the interface offsets.
18513         (mono_class_is_assignable_from): Don't throw away generic arguments.
18515 2005-12-19  Raja R Harinath  <rharinath@novell.com>
18517         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
18518         type parameters.
18520 2005-12-15  Raja R Harinath  <rharinath@novell.com>
18522         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
18523         dead store.
18524         (do_mono_metadata_parse_generic_class): Don't pass the current
18525         generic context when parsing the type being instantiated: it
18526         cannot use it, anyway.
18528         * loader.c (method_from_memberref): Don't inflate a signature if
18529         it doesn't contain any type parameters.
18531 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
18533         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
18535 2005-12-14  Martin Baulig  <martin@ximian.com>
18537         * class.c
18538         (mono_type_get_name_recurse): Don't return null for type
18539         parameters and open generic classes.
18540         (mono_class_setup_methods): Don't exclude generic instances.
18541         (mono_get_unique_iid): Use different IDs for different
18542         instantiations of the same generic type.
18543         (mono_class_setup_vtable): Only use setup_generic_vtable() for
18544         open generic instances; create a normal vtable for closed generic
18545         instances.
18546         (mono_class_setup_vtable_general): We're now also called for
18547         closed generic instances.
18549         * reflection.c
18550         (mono_reflection_bind_generic_parameters): Correctly use
18551         mono_metadata_lookup_generic_inst() everywhere.
18553 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
18555         * object.c (mono_class_create_runtime_vtable): Call 
18556         mono_class_setup_vtable ().
18558         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
18559         function.
18560         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
18561         #76959.
18563         * loader.c (mono_loader_set_error_type_load): Print the type load
18564         warnings to the console so they are more visible to the user.
18565         (mono_loader_set_error_method_load): Ditto.
18567         * reflection.c (ensure_runtime_vtable): Revert the last change as it
18568         is still broken.
18569         
18570         * reflection.c (ensure_runtime_vtable): Fix build.
18572         * reflection.c (ensure_runtime_vtable): Disable an optimization which
18573         doesn't work in all cases.
18575 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
18577         * object.c (mono_array_new_full): Treat a single dimensional array
18578         with 0 lower bounds as an szarray. Fixes #76973.
18580         * reflection.c (custom_attr_visible): Really fix this.
18582 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
18584         * reflection.c (custom_attr_visible): Allow nested public attributes
18585         as well.
18587         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
18588         interface check.
18590 2005-12-12  Raja R Harinath  <harinath@gmail.com>
18592         * class.c (set_generic_param_owner): Delete.
18593         (mono_class_create_from_typedef): Don't set ->owner field of
18594         generic parameters to "param containers" of enclosing classes.
18595         * reflection.c (mono_reflection_initialize_generic_parameter):
18596         Likewise.
18598 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
18600         * reflection.c (custom_attr_visible): Fix build.
18602 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
18604         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
18605         private attributes.
18606         
18607         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
18608         handling of null parameter defaults.
18610 2005-12-09  Raja R Harinath  <rharinath@novell.com>
18612         * class.c (mono_class_from_generic_parameter): Don't set
18613         klass->generic_container.
18614         (my_mono_class_from_generic_parameter): Likewise.
18616 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
18618         * reflection.c (load_public_key): Fix a warning.
18619         (method_encode_code): Fix unaligned accesses.
18621 2005-12-07  Martin Baulig  <martin@ximian.com>
18623         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
18625         * reflection.c
18626         (write_generic_param_entry): Encode our custom attrs.
18628         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
18630 2005-12-07  Martin Baulig  <martin@ximian.com>
18632         * reflection.c (encode_new_constraint): Removed; we don't use the
18633         `NewConstraintAttribute' anymore.
18635 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
18637         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
18638         not fire a TypeResolve event when Assembly.GetType () is called.
18640 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
18642         Beginning of support for nullable types in the runtime. Parts of
18643         this patch are from Martin.
18645         * appdomain.c (MONO_CORLIB_VERSION): Bump
18647         * domain.c (mono_init_internal): get the nullable type
18649         * class.c (mono_class_is_nullable): New method
18650         (mono_class_get_nullable_param): New mehod
18651         (mono_class_create_generic): In types T? set cast_class to T
18653         * class-internals.h (MonoDefaults): new nullable default class
18654         (mono_class_get_nullable_param, mono_class_get_nullable_param):
18655         new methods.
18657 2005-12-05  Raja R Harinath  <rharinath@novell.com>
18659         * metadata.c (select_container): New.  Refactor code to select the
18660         appropriate GenericContainer given the type of generic parameter
18661         we are looking for.
18662         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
18663         not a MonoGenericContext.  Use select_container.  Update parameters.
18664         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
18665         and MONO_TYPE_MVAR.
18666         (unwrap_arrays): Remove duplicate tests.
18667         (find_generic_param): Rename from 'has_same_context'.  Now walks a
18668         generic instantiated class to find any arguments that are generic
18669         parameters.
18670         (mono_type_create_from_typespec_full): Use find_generic_param to
18671         avoid evicting some generic instantiations from the typespec
18672         cache.
18674 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
18676         * reflection.c: fixed writing of doubles on ARM FPA.
18678 2005-12-02  Robert Jordan  <robertj@gmx.net>
18680         * icall.c: Fixed EventInfo.ReflectedType (#76829).
18682 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18684         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
18685         least on SUSE 10 they are not the same (on debian, they are just the
18686         same thing).
18688 2005-12-01  Raja R Harinath  <rharinath@novell.com>
18690         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
18691         DeclaringType for VARs and MVARs.
18692         * class.c (set_generic_param_owner): Fix initialization of owner
18693         fields.
18695 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
18697         * icall.c: fixed Enum.ToObject() to correctly convert the values.
18699 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18701         * threadpool.c: workaround for a bug that shows up on the Mac:
18702         select()+connect() on a blocking socket is not like it should
18703         be, so we proceed to connect() in that case, wasting the I/O
18704         threadpool thread until connect succeedes. Fixes bug #75436.
18706 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18708         * threadpool.c: fix typo when setting file descriptor states.
18710 2005-11-28  Raja R Harinath  <rharinath@novell.com>
18712         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
18713         * metadata.c (mono_metadata_parse_method_signature_full): Don't
18714         create a temporary signature container.
18715         (mono_metadata_parse_generic_param): Update to changes.
18716         (mono_type_create_from_typespec_full): Update to changes.
18717         * loader.c (method_from_memberref): Don't use a
18718         MonoGenericContainer while parsing a memberref signature.
18719         (method_from_methodspec): Remove dead-store of the 'container'
18720         variable.  It's overwritten before use.
18722         * metadata.c (mono_type_create_from_typespec_full): Make debugging
18723         checks tighter.
18724         (mono_metadata_parse_generic_param): Likewise.
18725         * loader.c (find_method_in_class): Does not need a
18726         MonoGenericContainer.  Use 'mono_method_signature' rather than
18727         'mono_method_signature_full'.
18728         (find_method, mono_get_method_constrained, method_from_memberref):
18729         Update to changes.
18731         * metadata.c (mono_type_create_from_typespec_full): Ensure that
18732         owner-less generic-parameters are never evicted from the typespec
18733         cache.
18735         * loader.c (method_from_memberref): Don't use the current context
18736         when parsing signatures.
18737         (method_from_methodspec, mono_get_method_from_token): Update to changes.
18739         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
18740         side-effects in g_assert.
18741         * loader.c (mono_get_method_from_token): Resolve klass earlier so
18742         that we don't potentially lose information.
18744 2005-11-26  Dick Porter  <dick@ximian.com>
18746         * icall.c:
18747         * threads.c: icalls to implement basic (ie, not named)
18748         System.Threading.Semaphore.
18750 2005-11-24  Dick Porter  <dick@ximian.com>
18752         * process.c
18753         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
18754         Use GetProcessId() if it's available.
18756 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
18758         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
18760 2005-11-23  Raja R Harinath  <rharinath@novell.com>
18761             Ankit Jain  <jankit@novell.com>
18763         * loader.c (mono_get_method_from_token): Initialize 'method' field
18764         of all generic parameters before parsing the signature.  Remove
18765         code that "fixed"-up MVAR references.
18767 2005-11-23  Ankit Jain  <jankit@novell.com>
18769         * metadata.c (mono_metadata_has_generic_params):
18770         (mono_metadata_load_generic_param_constraints):
18771         (mono_metadata_load_generic_params): Move duplicate code ...
18772         (mono_metadata_get_generic_param_row): ... here. Returns the
18773         first row-id in GenericParam table for a given owner (token).
18774         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
18775         prototype.
18777 2005-11-23  Raja R Harinath  <rharinath@novell.com>
18778             Ankit Jain  <jankit@novell.com>
18780         * metadata.c (mono_metadata_class_equal): Pass signature_only when
18781         comparing VARs too.
18782         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
18783         type->data.generic_param only if the type is an MVAR.
18784         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
18785         leak owner-less VARs and MVARs into managed space.
18787 2005-11-21  Martin Baulig  <martin@ximian.com>
18789         * class-internals.h
18790         (MonoMethod): Moved the `generic_container' here from
18791         `MonoMethodNormal' since we now also need it for
18792         `MonoMethodPInvoke';
18793         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
18794         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
18795         an union containing both `MonoMethodNormal' and
18796         `MonoMethodPInvoke'.
18798         * loader.c
18799         (mono_get_method_from_token): Allow implementing generic methods
18800         as interncalls.
18802         * threads.c
18803         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
18804         icall.
18806 2005-11-17  Dick Porter  <dick@ximian.com>
18808         * icall.c: 
18809         * process.h: 
18810         * process.c: Split the Process Start_internal icall into
18811         ShellExecuteEx_internal and CreateProcess_internal, which are
18812         called depending on whether UseShellExecute is true.  Fixes bug
18813         76670.
18815         * appdomain.c (MONO_CORLIB_VERSION): Incremented
18817 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
18819         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
18820         'msize' parameters, use the information in 'mspec' instead.
18821         (emit_object_to_ptr_conv): Ditto.
18823         * marshal.c (emit_struct_conv): Handle explicit layout structs with
18824         fields out of order. Fixes #76733.
18826 2005-11-17  Ankit Jain  <jankit@novell.com>
18828         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
18830 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
18832         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
18833           bug #76575.
18835 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
18837         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
18838         for types with non-auto layout. Fixes #76717.
18840 2005-11-16  Ankit Jain  <jankit@novell.com>
18842         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
18843         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
18844         if generic_context is null.
18845           (mono_metadata_generic_param_equal): param->owner can be null.
18846           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
18847         null.
18849 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
18851         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
18852         the correct value.
18854 2005-11-15  Martin Baulig  <martin@ximian.com>
18856         * object.c (set_value): Use mono_class_from_mono_type() instead of
18857         the hack for generic instances; fixes #76136.
18859 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
18861         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
18862         fields.
18864         * image.c (load_metadata_ptrs): Initialize the new fields.
18866         * reflection.c (create_dynamic_mono_image): Ditto.
18868         * reflection.c (build_compressed_metadata): Use the new fields.
18870         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
18871         icall.
18873         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
18874         icall.
18875         
18876 2005-11-15  Ankit Jain  <jankit@novell.com>
18877             Raja R Harinath  <harinath@gmail.com>
18879         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
18880         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
18881         new per-generic_container cache if the cached MonoType's context matches
18882         the current context.
18883           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
18884         to the expected context.
18885           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
18887 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18889         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
18890         we changed the signature of an icall.
18891         * icall.c: Modify to mono_double_ParseImpl return true/false 
18892         depending on the success, instead of throwing the exception. This will
18893         help us in Double.TryParse methods.
18894         
18895 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
18897         * marshal.c (emit_marshal_object): Throw an exception when
18898         marshalling 'object' instead of crashing. Fixes #76696.
18900 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
18902         * class-internals.h: Add prototype for mono_type_get_full_name ().
18904 2005-11-11  Dick Porter  <dick@ximian.com>
18906         * threads.c (mono_thread_manage): Make sure the main thread has
18907         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
18909 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
18911         * loader.c (mono_loader_set_error_type_load): Log a warning to the
18912         console about the missing type.
18913         (mono_loader_set_error_method_load): Ditto.
18915 2005-11-09  Miguel de Icaza  <miguel@novell.com>
18917         * mono-config.c (mono_get_config_dir): Set the system defaults if
18918         none is specified.
18920         * assembly.c (mono_set_dirs): New API entry point to set the
18921         assembly and the config directory in one call
18923 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
18925         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
18926         the ftnptr was created from a delegate in a domain other than the
18927         current domain. Fixes #75377.
18929         * exception.h exception.c: Add mono_get_exception_not_supported ().
18931 2005-11-08  Martin Baulig  <martin@ximian.com>
18933         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
18935 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
18937         * security-manager.h: Added definitions to deal with strongname key 
18938         pairs bigger (and smaller) than 1024 bits.
18939         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
18940         adjust wrt the public key length being used.
18942 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
18944         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
18945           Windows build (r51396-51397).
18947 2005-11-03  Martin Baulig  <martin@ximian.com>
18949         * class.c (mono_class_setup_vtable_general): Also add generic
18950         methods to the vtable; fixes #76581.
18952 2005-11-01  Miguel de Icaza  <miguel@novell.com>
18954         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
18955         sure that we lookup GetString method from the System.Text.Encoding
18956         class, not the derived class or we get an empty method.
18958         Fixed class #76612.
18960 2005-10-25  Miguel de Icaza  <miguel@novell.com>
18962         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
18963         if it has been previously set (embedders). 
18965         Make mono_set_rootdir available also on Unix.
18967 005-10-24  Robert Jordan  <robertj@gmx.net>
18969         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
18971 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
18973         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
18974         only calls which are made to native code use this flag.
18976         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
18978 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
18980         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
18981         Add support for FieldBuilders.
18983 2005-10-29  Martin Baulig  <martin@ximian.com>
18985         * mono-debug.c
18986         (mono_debug_using_mono_debugger): New public method; returns
18987         whether we're running inside the debugger.
18989 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
18991         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
18992         for Method/Constructor/FieldBuilders.
18994 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
18996         * reflection.c (module_add_cattrs): Save custom attributes for global methods
18997         and fields as well.
18999 2005-10-26  Martin Baulig  <martin@ximian.com>
19001         * mono-debug-debugger.c
19002         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
19004 2005-10-24  Raja R Harinath  <harinath@gmail.com>
19006         * icall.c (base64_to_byte_array): Don't pass an out-of-range
19007         integer to isspace.
19009 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
19011         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
19012         when passing valuetypes byref. Fixes #76502.
19014 2005-10-19  Jackson Harper  <jackson@ximian.com>
19016         * profiler.c: Don't put a . in front of types that are not in a
19017         namespace.
19019 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
19021         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
19023 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
19025         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
19026         #76436.
19027         (mono_marshal_get_ldflda_wrapper): Fix a warning.
19029 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19031         * assembly.c metadata-internals.h icall.c: Define an additional
19032         parameter for mono_assembly_name_parse_full, so we can avoid creating
19033         S.R.AssemblyName.Version when no version info wasn't passed.
19034         
19035 2005-10-09  Miguel de Icaza  <miguel@novell.com>
19037         * class.c (mono_type_get_full_name): Reimplement method that was
19038         removed. 
19040         * image.c: Some docs
19042 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
19044         * profiler.c (output_newobj_profile): Fix printing of Total memory
19045         on x86.
19047 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
19049         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
19051 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
19053         * threads.c: remove debug output.
19055 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
19057         * threads.c (mono_thread_manage): Fix crashes if more than 64
19058         threads need to be aborted. Hopefully fixes #75899.
19060         * assembly.c (mono_stringify_assembly_name): New helper function.
19062         * class.c: Use mono_stringify_assembly_name instead of the similar
19063         static function.
19065         * assembly.h assembly.c: Add support for calling a postload search 
19066         hook if an assembly cannot be loaded.
19068         * appdomain.c: Register new search hooks which call the AssemblyResolve
19069         events in AppDomain. Fixes #75231
19071 2005-10-07  Martin Baulig  <martin@ximian.com>
19073         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
19074         methods without debug info.
19076 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
19078         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
19079         wrappers.
19081 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19083         * file-io.c: now that we return symlinks, use lstat and, when the file
19084         is a symbolic link, stat, to get the file attributes. Also avoid the
19085         conversion to/from utf16/external.
19087 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
19089         * class.c (mono_class_layout_fields): Compute klass->has_references
19090         correctly if an embedded valuetype is not yet initialized. Fixes
19091         #76331.
19093 2005-10-04  Martin Baulig  <martin@ximian.com>
19095         * metadata.c
19096         (mono_metadata_load_generic_param_constraints): New public
19097         function; splitted the constraints loading out from
19098         mono_metadata_load_generic_params().
19100         * class.c (mono_class_create_from_typedef): Call
19101         mono_metadata_load_generic_param_constraints() after setting up
19102         the type and creating our parent; fixes #75329.
19104 2005-10-04  Martin Baulig  <martin@ximian.com>
19106         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
19107         non-dynamic parent classes.
19109 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
19111         * file-io.c : win32 build fix (ETXTBSY seems not found).
19113 2005-10-04  Martin Baulig  <martin@ximian.com>
19115         * reflection.c
19116         (mono_image_get_methodspec_token): Make the cache actually work;
19117         fixes #75974.
19119 2005-10-04  Martin Baulig  <martin@ximian.com>
19121         * class.c (mono_class_name_from_token): Removed the unneccessary
19122         `MonoGenericContext *' argument.
19124 2005-10-04  Martin Baulig  <martin@ximian.com>
19126         * loader.c
19127         (method_from_methodspec): Make the caching work again; fixes the
19128         performance regression from #76262.
19130 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19132         * file-io.c:
19133         * file-io.h:
19134         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
19135         GetFileSystemEntries that performs the same work but without going
19136         into io-layer, locking, etc.
19138 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
19140         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
19141         ThreadState_Stopped as well. Fixes #76047.
19143 2005-09-29  Martin Baulig  <martin@ximian.com>
19145         * class.c
19146         (inflate_generic_context): If the new context has a `gmethod', set
19147         its `container' that that gmethod's `container'.
19149         * metadata.c
19150         (mono_metadata_parse_generic_param): Simplify things;
19151         `generic_container = generic_context->container;' is just fine.
19153         * loader.c (method_from_methodspec): Code cleanups.
19155 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
19157         * decimal.c: fix warning (and let gcc generate correct
19158         code on ARM with optimizations).
19160 2005-09-28  Martin Baulig  <martin@ximian.com>
19162         * loader.c
19163         (method_from_memberref): Added `MonoGenericContext *class_context'
19164         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
19165         (method_from_methodspec): If we're a memberref, use the enclosing
19166         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
19168 2005-09-28  Martin Baulig  <martin@ximian.com>
19170         * object.c (mono_runtime_invoke_array): Added support for
19171         MONO_TYPE_GENERICINST; fixes #75917.
19173 2005-09-27  Martin Baulig  <martin@ximian.com>
19175         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
19176         `k->byval_arg.type' to determine the actual type.
19178         * loader.c (method_from_methodspec): Removed some hacks.
19180 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
19182         * class-internals.h (mono_field_is_deleted): Do the test for
19183         rtspecialname before we check the actual name of the field. This
19184         prevents us from dereferencing a pointer into the string table,
19185         saving us from accessing a few pages
19187         * *.c: Replace the use of {Enter,Leave}CriticalSection with
19188         macros. This will allow a deadlock debugger to easily be plugged
19189         in.
19191 2005-09-27  Martin Baulig  <martin@ximian.com>
19193         * loader.c (method_from_methodspec): Create a "signature"
19194         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
19196 2005-09-27  Martin Baulig  <martin@ximian.com>
19198         * class.c
19199         (inflate_generic_class): Correctly set the new context's
19200         container.
19202         * loader.c
19203         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
19204         instead of a `MonoGenericContext *'.
19205         (mono_method_signature_full): Take a `MonoGenericContainer *'
19206         instead of a `MonoGenericContext *'.
19208         * metadata.c
19209         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
19210         instead of a `MonoGenericContext *'.
19211         (mono_metadata_parse_method_signature_full): Likewise.
19213 2005-09-26  Martin Baulig  <martin@ximian.com>
19215         * class.c
19216         (mono_class_from_generic_parameter): Set `klass->generic_container'
19217         (mono_class_from_generic_parameter): Likewise.
19218         (mono_bounded_array_class_get): We inherit the generic container
19219         from the element class.
19221         * loader.c
19222         (find_method, find_method_in_class): Take a `MonoGenericContext *'
19223         argument rather than computing it here.
19224         (method_from_memberref): Correctly set the generic context before
19225         parsing the signature.  Fixes #75681.
19227 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
19229         * object.c (mono_class_has_special_static_fields): Fix warnings.
19231 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19233         * assembly.c: Add parse_public_key function, to
19234         par the public keys. Also added mono_assembly_name_parse_full,
19235         to define it the parsed key should be freed or not.
19236         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
19237         to parse a long format assembly name.
19238         * metadata-internals.h: Keep mono_assembly_name_parse_full as
19239         private, since calling it to preserve the key requires
19240         freeing it manually.
19241         
19242 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
19244         * locales.c : removed HAVE_ICU part.
19246 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
19248         * object.c (mono_class_create_runtime_vtable): Avoid calling 
19249         field_is_special_static if the klass has no special static fields.
19251         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
19252         (MonoCachedClassInfo): Likewise.
19254         * object.c (mono_class_has_special_static_fields): New helper function.
19256 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
19258         * class.c (mono_class_create_from_typedef): Don't call 
19259         interfaces_from_typedef_full for enums.
19260         (mono_class_create_from_typedef): Compute the base types of enums directly
19261         without calling mono_class_setup_fields ().
19262         (mono_class_find_enum_basetype): New helper function.
19264         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
19265         one place inside the string heap.
19266         
19267 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
19269         * class.c: locking fixes, code cleanups, some docs added.
19270         Allocate some data structures in the image mempool.
19272 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
19274         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
19275         the example code.
19276         
19277 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
19279         * class-internals.h, class.c, reflection.c: reduce memory taken by
19280         MonoClass.
19282 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
19284         * metadata.c, metadata.h, loader.h: documentation updates, code and
19285         API cleanups.
19287 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
19289         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
19290         the example code.
19292         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
19293         page faults caused by the runtime while reading metadata.
19295 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19297         * socket-io.c: the field names were changed 3 months ago and no one
19298         realized until bug #76077 got filed!
19300 2005-09-20  Martin Baulig  <martin@ximian.com>
19302         * icall.c (assembly_icalls): Removed some unused debugger icalls.
19304 2005-09-20  Martin Baulig  <martin@ximian.com>
19306         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
19307         write the rank into the class entry.
19309 2005-09-20  Martin Baulig  <martin@ximian.com>
19311         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
19313 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
19315         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
19317         * icall.c (custom_attrs_defined_internal): New icall.
19319         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
19320         function.
19321         (mono_custom_attrs_construct_by_type): New helper function.
19323 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
19325         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
19326         terminate the resulting string. Fixes #76123.
19328 2005-09-16  Martin Baulig  <martin@ximian.com>
19330         * mono-debug.c
19331         (mono_debug_add_method): Ignore inflated methods for the moment.
19333 2005-09-14  Martin Baulig  <martin@ximian.com>
19335         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
19337 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
19339         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
19340         return a success/failure indication.
19341         (mono_metadata_interfaces_from_typedef_full): Ditto.
19342         (get_constraints): Ditto.
19344 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
19346         * marshal.c (emit_marshal_array): Fix handling of null arrays.
19347         
19348         * marshal.c (emit_marshal_array): Add support for returning string
19349         arrays from delegates. Fixes #76063.
19351         * marshal.c: Use the emit_ldloc/stloc macros where possible.
19353 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
19355         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
19356         icall.
19358 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
19360         * reflection.c icall.c: Fix after mono_get_exception_type_load
19361         signature change.
19363         * assembly.c (mono_assembly_get_assemblyref): New helper function.
19364         (mono_assembly_load_reference): Use the new helper.
19366         * class-internals.h (MonoLoaderError): New structure containing 
19367         information about type loading errors.
19369         * class-internals.h loader.c: Add APIs to store per-thread loader
19370         error information.
19372         * loader.c class.c: Set the loader error if needed.
19374         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
19376 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
19378         * decimal.c: fixed to handle the broken ARM fp format.
19380 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
19382         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
19383         broken.
19385 2005-09-06  Martin Baulig  <martin@ximian.com>
19387         * domain.c (supported_runtimes): Added v2.0.50727.
19389 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
19391         * culture-info.h: reduce the size of some structures.
19393 2005-09-05  Martin Baulig  <martin@ximian.com>
19395         Reflect latest API changes in the August CTP.
19397         * icall.c
19398         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
19399         ("MonoType.HasGenericArguments"): Removed.
19400         ("MonoMethod.BindGenericParameters"): Renamed to
19401         "MakeGenericMethod".
19402         ("MethodBuilder.BindGenericParameters"): Renamed to
19403         "MakeGenericMethod".    
19405 2005-09-05  Martin Baulig  <martin@ximian.com>
19407         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
19409 2005-09-05  Martin Baulig  <martin@ximian.com>
19411         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19413         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
19414         generic_container is non-NULL.
19416 2005-09-05  Martin Baulig  <martin@ximian.com>
19418         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19420         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
19422 2005-08-29  Michal Moskal  <malekith@nemerle.org>
19424         * reflection.c (encode_locals,
19425         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
19426         for large generic types.
19428 2005-09-05  Martin Baulig  <martin@ximian.com>
19430         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19432         * class.c (mono_dup_array_type): New public method.
19433         (mono_metadata_signature_deep_dup): New public method.
19434         (dup_type): Correctly duplicate array and function types.
19436 2005-09-05  Martin Baulig  <martin@ximian.com>
19438         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19440         * reflection.c (get_default_param_value_blobs): Handle generic types
19441         and generic methods.
19443 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
19445         * class.c: Fixed error reporting (method/class were inversed) for 
19446         inheritance demands.
19447         * security-manager.c|h: Added the AppDomain when calling the managed
19448         System.Security.SecurityManager.InheritanceDemand method.
19450 2005-09-01  Raja R Harinath  <rharinath@novell.com>
19452         * reflection.c (encode_marshal_blob): 'marshaltype' and
19453         'marshaltyperef' are alternate sources for the custom marshaler
19454         name.
19456 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
19458         * class.c: fix creation of array classes with rank == 1
19459         (patch by Ankit Jain <jankit@novell.com>).
19461 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
19463         * object.c: fix check for creating the bound data for arrays vs
19464         szarrays.
19466 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19468         * object.c: configuration file name is now based on the executable name,
19469         not the image name. Fixes bug #75931.
19471 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
19473         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
19474         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
19476 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
19478         * rand.c: Use wincrypt.h instead of WinCrypt.h.
19480 2005-08-24  Ankit Jain  <jankit@novell.com>
19481             Raja R Harinath  <rharinath@novell.com>
19483         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
19484           called by it recursively.
19485           (mono_class_init): Remove special case in pending_init handling, since it's
19486           superseded by the fix to mono_class_from_typeref.
19488 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
19490         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
19491         BROKEN_THREAD_START stuff.
19493 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
19495         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
19496         trampoline.
19498         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
19499         
19500         * object.c (mono_delegate_ctor): Replace the original function address with
19501         a delegate trampoline.
19503 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
19505         * icall.c: add boolean argument to base64_to_byte_array and 
19506         InternalFromBase64String to control whether a whitespace-only string
19507         is allowed (or should casue a FormatException to be thrown). We need
19508         this as the behavior has changed between MS.NET 1.x and 2.0, and we
19509         to match the MS behaviour in both profiles.
19510         * appdomain.c: Bump corlib version.
19512 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19514         This patch implements a big portion of publisher policy
19515         support, used to bind assembly versions and redirect
19516         one assembly from version A to version B.
19518         * assembly.c:
19519         New GSList loaded_assembly_bindings, for storing the cached
19520         assembly bindings.
19521         (assembly_binding_maps_name): New static function for checking if a 
19522         assembly binding information maps an assembly name.
19523         (mono_assembly_binding_info_free): New function for freeing
19524         assembly binding information resources.
19525         (get_publisher_policy_info): New static function for retrieving 
19526         assembly binding information from a MonoImage.
19527         (compare_versions): New static function for comparing an assembly
19528         binding information data and the version of an assembly name.
19529         (check_policy_versions): New static function for checking if an
19530         assembly binding info mapping an assembly name is valid for it.
19531         (mono_assembly_load_publisher_policy): New static function for
19532         loading the 'policy.major.minor.MyAssembly' image for an assembly
19533         with an assembly name 'aname'.
19534         (mono_assembly_bind_version): New static function for updating
19535         assembly redirection.
19536         (mono_assembly_apply_binding): New static function for applying
19537         assembly binding.
19538         (search_binding_loaded): New static function for searching 
19539         loaded assembly binding infos in the cache domain.
19540         (mono_assembly_load_full): Don't apply assembly binding for
19541         reflection only assemblies.
19543         * metadata-internals.h: Add MonoAssemblyBindingInfo,
19544         which contains information about assembly binding. Also
19545         declare signature for mono_config_parse_publisher_policy ()
19546         function, used to retrieve pub policy info.
19547         
19548         * mono-config.c:
19549         (publisher_policy_start): New static function used to parse publisher 
19550         policy config files.
19551         (publisher_policy_parser): New static MonoParseHandler containing 
19552         the functions used when parsing config files.
19553         (mono_config_parse_publisher_policy): New function for parsing
19554         publisher policy files.
19555         
19556 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
19558         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
19560         * marshal.c (mono_delegate_free_ftnptr): Ditto.
19562         * object.c (mono_get_addr_from_ftnptr): New helper function.
19564         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
19566         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
19568 2005-08-19  Dick Porter  <dick@ximian.com>
19570         * threads.c, threads.h, appdomain.c, appdomain.h,
19571         profiler-private.h, monitor.c, object.c, object-internals.h,
19572         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
19573         store the thread ID, so it can hold a 64 bit value if needed.
19575 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
19577         * reflection.c (mono_reflection_create_dynamic_method): Store the
19578         handle class into the method references as well so ldtoken works in
19579         dynamic methods.
19581         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
19582         types.
19584 2005-08-19  Ankit Jain <jankit@novell.com>
19586         Fix #75847.
19587         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
19588           here rather than using the method signature of a arbitrary function
19589           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
19590           two arguments.
19591           Hack done with Harinath.
19593 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19595         * threadpool.c: disable printing stack traces when we get a exception
19596         in a threadpool thread. I need to do more testing to figure out which
19597         cases actually print this. Fixes bug #75828.
19599 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19601         * icall.c: there might be ignored whitespace after the last '='. This
19602         fixes length computation and bug #75840.
19604 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
19606         * assembly.c (mono_assembly_load_full): Consider .exe extension as
19607         well. Fixes #75809.
19609         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
19610         #75784.
19611         
19612         * reflection.c (create_custom_attr_data): Ditto.
19614 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
19616         * locales.c, culture-info.h : removed RegionLCIDMap.
19617         * culture-info-tables.h : regenerated.
19619 2005-08-16  Martin Baulig  <martin@ximian.com>
19621         * class.c (mono_type_get_name_recurse): Small fix.
19623 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
19625         * locales.c : indentation fixie.
19627 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
19629         * object-internals.h,
19630           locales.h,
19631           locales.c,
19632           culture-info.h,
19633           icall.c : added RegionInfo table support.
19634         * culture-info-table.h : regenerated for region support.
19636 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
19638         * reflection.c (resolve_object): handle all kinds of MonoMethod
19639         including generic ones
19641 2005-08-12  Ankit Jain <jankit@novell.com>
19643         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
19644           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
19646 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
19648         * process.c: Don't close a thread handle when it's NULL. This is a
19649         workaround for bug #75733.
19651 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
19653         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
19655 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
19657         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
19659 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19661         * threadpool.c: if a work item in the thread pool has a callback that
19662         catches a exception, don't propagate it after invoking the callback.
19663         Fixes bug #75336.
19665 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
19667         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
19669         * class-internals.h (MonoCachedClassInfo): Add some new fields.
19671         * class.c (mono_class_init): Load field info lazily in the AOT case.    
19673         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
19675 2005-08-03  Ankit Jain  <jankit@novell.com>
19677         Fix #75683.
19678         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
19679           PInvoke calling convention is 0.
19681 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
19683         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
19684         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
19686 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
19688         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
19689         to handle threads not started by the GC (patch by Michael Meeks
19690         <michael.meeks@novell.com>).
19692 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
19694         * reflection.c: Make buffer used in emitting types larger for some
19695         big generic types (patch by Michal Moskal).
19697 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
19699         * mono-debug.c: Fix some (not all) alignment problems.
19701 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19703         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
19704         Invoke mono_image_load_from_data_full passing the refonly
19705         parameter.
19707         * assembly.c
19708         (mono_assembly_open_from_bundle): Add the refonly argument, 
19709         in order to pass it to other methods it calls to.
19710         (do_mono_assembly_open): Add the refonly argument, in order 
19711         to pass it to other methods it calls to.
19712         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
19713         the refonly parameter to it.
19715         * image.c: Add loaded_images_refonly_hash and
19716         loaded_images_refonly_guid_hash to cache the reflection
19717         only loaded images.
19718         (mono_images_init): Initialize the hash tables used for
19719         caching the reflection only images.
19720         (load_modules): Invoke mono_image_open_full passing the refonly
19721         parameter to load the modules the correct way.
19722         (build_guid_table): Add the refonly argument, to re-build the 
19723         correct hash table.
19724         (do_mono_image_open): Added the refonly argument, in order to
19725         define it for the loaded image.
19726         (mono_image_loaded_full): New function, which receives an
19727         additional parameter to look for the image in the refonly or
19728         non-refonly section.
19729         (mono_image_loaded): Updated, using mono_image_loaded_full.
19730         (mono_image_loaded_by_guid_full): The same case that happens
19731         with mono_image_loaded_full.
19732         (mono_image_loaded_by_guid): Likewise.
19733         (register_image): Use the ref_only variable inside MonoImage
19734         to decide in which hash table store the current image.
19735         (mono_image_open_from_data_full): Rename
19736         mono_image_open_from_data to mono_image_open_from_data_full,
19737         adding the refonly argument, to define the ref_only variable 
19738         inside MonoImage.
19739         (mono_image_open_from_data): Return 
19740         mono_image_open_from_data_full.
19741         (mono_image_open_full): Rename mono_image_open to
19742         mono_image_open_full, receiving the new refonly argument,
19743         to pass it to inner methods.
19744         (mono_pe_file_open): Update this function, to open
19745         a MonoImage as a non-refonly image.
19746         (mono_image_close): Use the refonly variable inside
19747         MonoImage to remove the image from the correct caches.
19749         * image.h: Add the signatures of mono_image_open_full,
19750         mono_image_open_from_data_full, mono_image_loaded_full,
19751         mono_image_loaded_by_guid_full.
19753         * metadata-internals.h: Add the ref_only field to 
19754         MonoImage.
19755         
19756 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19758         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
19759         Fix the last behavior, which used to load the assemblies and
19760         extract MonoReflectionAssemblyName information, instead of
19761         extract it from the metadata tables. Needed for Reflection
19762         Only assemblies.
19763         
19764 2005-07-29  Martin Baulig  <martin@ximian.com>
19766         * mono-debug-debugger.c
19767         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
19768         not initialized.
19770         * mono-debug.c
19771         (mono_debug_address_from_il_offset): Check whether we have
19772         debugging support before attempting to take the lock.
19773         (mono_debug_source_location_from_address): Likewise.
19774         (mono_debug_source_location_from_il_offset): Likewise.
19775         (mono_debug_il_offset_from_address): Likewise.
19776         (mono_debug_address_from_il_offset): Likewise.
19778 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
19780         * class.c (mono_class_from_name_case): Add support for dynamic images.
19781         Fixes #75650.
19783         * object.c (mono_class_compute_gc_descriptor): Add a workaround
19784         for #75479.
19786 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
19787         
19788         * reflection.c (mono_method_get_object): Fix warning.
19790 2005-07-28  Martin Baulig  <martin@ximian.com>
19792         * mono-debug.c
19793         (mono_debug_add_wrapper): Also write the wrapper type.
19795 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
19797         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
19798         
19799         * class.c (mono_class_init): Avoid reading nested classes if the AOT
19800         data indicates the class has none.
19802 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
19804         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
19805         loader lock with the debugger lock. Prevents deadlocks for beagle.
19807         Beagle can now run on an smp box for a weekend without any
19808         issues. Woohoo!
19810 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
19812         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
19813         in a module. Fixes #75629.
19815 2005-07-26  Martin Baulig  <martin@ximian.com>
19817         * mono-debug.c (mono_debug_add_wrapper): New static method.
19818         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
19819         interncall or a wrapper.
19821         * mono-debug.h (MonoDebugWrapperData): New public typedef.
19822         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
19823         (MONO_DEBUGGER_VERSION): Bump to 51.
19825         * mono-debug-debugger.c
19826         (mono_debugger_add_type): Removed this empty function.
19827         (mono_debugger_add_method): Likewise.
19829 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
19831         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
19832         before accessing method->slot.
19834 2005-07-21  Jb Evain  <jbevain@gmail.com>
19836         * reflection.c (method_encode_clauses/class): Handle filters clauses.
19837         Fixes #75010.
19839 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
19841         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
19842         #75587.
19844 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
19846         * image.h image.c: Add mono_image_get_guid () API function.
19848 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
19850         There were issues when multiple threads tried to load
19851         assemblies. A deadlock was created between assemblies_mutex and
19852         mono_domain_assemblies_lock. This fixes the issue by making the
19853         assembly ref counting be lock free. See bug 75586.
19854         
19855         * image.c (mono_image_close): The add ref function here was using
19856         Interlocked operations while the unref was using a mutex and a
19857         --. I don't think this was ever a bug that would be exposed in a
19858         non-pendantic way (ie, by an embedder doing a ref on one thread
19859         and an unref on another), but for the sake of correctness, this is
19860         now Interlocked.
19862         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
19863         (mono_assembly_load_reference): Call mono_assembly_addref rather
19864         than touching the refcount ourselves.
19865         (mono_assembly_close): Use InterlockedDecrement to unref the
19866         assembly. Don't acquire the lock unless it is actually needed.
19868 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
19870         * class.c (mono_class_layout_fields): Fix calculation of has_references
19871         for generic types.
19873 2005-07-12  Martin Baulig  <martin@ximian.com>
19875         Applying a patch from Michal Moskal <malekith@nemerle.org>.
19877         * metadata.c
19878         (mono_type_hash): Provide better hashing for generic instances.
19879         (mono_generic_inst_hash): Improve hashing.
19880         (mono_generic_class_hash): Likewise.
19882         * reflection.c (mymono_metadata_type_hash): Improve hashing for
19883         generic instances.
19885 2005-07-12  Martin Baulig  <martin@ximian.com>
19887         * reflection.c (mono_reflection_create_runtime_class): Remove the
19888         hack for generic type definitions and non-`Run' assemblies.
19889         (mono_reflection_bind_generic_parameters): Also use
19890         `klass->wastypebuilder' to check for TypeBuilders.
19892 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
19894         * class.c (mono_class_layout_fields): Fix calculation of has_references
19895         for generic types.
19897         * class.c (inflate_generic_class): Fix a leak.
19898         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
19899         for generic types.
19901 2005-07-11  Martin Baulig  <martin@ximian.com>
19903         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
19904         on error.
19906 2005-07-11  Martin Baulig  <martin@ximian.com>
19908         * loader.c (find_method): Also lookup in
19909         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
19911 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19913         * appdomain.c (mono_domain_unload): Don't free the error message
19914         before passing it to mono_get_exception_...
19916         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
19917         
19918 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
19920         * threads.c: try to better guess an available RT signal (bug #75387).
19922 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19924         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
19925         and CACHE_OBJECT.
19927 2005-07-07  Martin Baulig  <martin@ximian.com>
19929         * class.c (mono_type_get_name_full): Return NULL for
19930         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
19931         fixes #75408.
19933 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
19935         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
19936         exit the appdomain as well being aborted.
19938         * threadpool.c: Create all threadpool threads inside the root appdomain, and
19939         change back to the root domain after calling managed code. This enables
19940         appdomains using threadpools to be unloaded.
19942 2005-07-07  Martin Baulig  <martin@ximian.com>
19944         * class-internals.h
19945         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
19946         into `MonoDynamicGenericClass' since we only need it for dynamic
19947         types.
19949         * reflection.c (mono_class_bind_generic_parameters): We don't need
19950         to compute the `parent' here.
19952 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
19954         * culture-info-table.h : regenerated.
19956 2005-07-06  Martin Baulig  <martin@ximian.com>
19958         * icall.c
19959         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
19961         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
19963 2005-07-06  Martin Baulig  <martin@ximian.com>
19965         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
19966         we're doing a signature-only comparision; fixes #74945.
19968 2005-07-06  Martin Baulig  <martin@ximian.com>
19970         * class-internals.h (MonoGenericClass): Moved some things out into
19971         a new `MonoInflatedGenericClass' type.  
19972         (MonoInflatedGenericClass): New type; the `klass' of a
19973         `MonoGenericClass' is now computed lazyly in
19974         mono_get_inflated_generic_class().      
19976         * class.c (mono_get_inflated_generic_class): New public function.
19977         (mono_class_inflate_generic_method): Removed the unused
19978         `MonoClass *' argument.
19979         (setup_generic_vtable): Don't call mono_get_inflated_method() on
19980         all the methods.
19981         (mono_class_create_generic): Make this static and merge it with
19982         mono_class_create_generic_2(); we're now called automatically from
19983         mono_get_inflated_generic_class().
19985         * loader.c (mono_method_signature): Call
19986         mono_get_inflated_method() here.
19988 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
19990         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
19991         type of fields with RVA.
19993         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
19994         for this pseudo class.
19995         (my_mono_class_from_generic_parameter): Likewise.
19996         (mono_class_init): Allow interfaces to have cctors.
19998 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
20000         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
20001         lazily for AOT methods.
20003 2005-07-05  Martin Baulig  <martin@ximian.com>
20005         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
20006         returns FALSE for a successful match, not TRUE.
20008 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
20010         * loader.c (mono_method_get_index): Optimize this a bit.
20012 2005-07-04  Martin Baulig  <martin@ximian.com>
20014         * class.c
20015         (class_compute_field_layout): Move the check for generic type
20016         definitions into mono_class_layout_fields().  Fixes #74684.
20017         (mono_class_from_generic_parameter): Correctly compute
20018         `klass->parent'; fixes #75457.
20020         * reflection.c (register_assembly, register_module): Make sure
20021         `domain->rejobject_hash' is already created.
20023 2005-07-02  Martin Baulig  <martin@ximian.com>
20025         * class-internals.h
20026         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
20027         `MonoDynamicGenericClass'.      
20029 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
20031         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
20032         returned by a field getter is null, since null is a valid value.
20034 2005-07-01  Martin Baulig  <martin@ximian.com>
20036         * reflection.c (mono_reflection_generic_class_initialize): Update
20037         the `dgclass->fields [i].parent' to the correct class.
20038         (mono_image_get_fieldref_token): Use the declaring type, not the
20039         reflected type.
20041 2005-07-01  Martin Baulig  <martin@ximian.com>
20043         * loader.c (find_method): Also look in the interfaces; fixes #75429.
20045 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
20047         * threads.c (thread_cleanup): assert that thread != NULL
20048         (wait_for_tids_or_state_change): We were using the wrong variable
20049         when accessing wait->threads. `i' was always out of the bounds of
20050         the array.
20052 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20054         * loader.c: map user32 and kernel32 to libMonoSupportW
20056 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
20058         * appdomain.c (unload_thread_main): Mark this as WINAPI.
20060 2005-06-28  Martin Baulig  <martin@ximian.com>
20062         * loader.c (method_from_methodspec): Fix #75334.
20064 2005-06-28  Martin Baulig  <martin@ximian.com>
20066         Fix #74953 - Arrays now implement the generic IList<T> interface
20067         on the 2.0 platform.
20069         * class-internals.h (MonoDefaults): Added `generic_array_class'.
20071         * reflection.c (mono_class_bind_generic_parameters): New public
20072         function; similar to mono_reflection_bind_generic_parameters(),
20073         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
20075         * domain.c (mono_init_internal): Try to initialize.
20076         `mono_defaults.generic_array_class' here; this'll only succeed if
20077         we're using the 2.0 corlib.
20079         * icall.c
20080         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
20081         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
20082         (mono_lookup_internal_call): Added support for nested classes.
20084         * loader.c
20085         (mono_get_method_from_token): Set `result->signature->pinvoke' if
20086         we're an interncall and have generic arguments.
20088         * class.c
20089         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
20090         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
20091         instance of System.Array.InternalArray<T> for arrays, so they
20092         implement the generic IList<T> interface.
20094 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
20096         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
20097         (chastamar@yahoo.com). Fixes #75374.    
20099 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
20101         * culture-info-table.h: regenerated.
20103 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20105         * icall.c: handle spaces correctly for base64 strings.
20107 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
20109         * *.c: Kill some warnings.
20111 2005-06-23  Duncan Mak  <duncan@novell.com>
20113         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
20114         that this builds on Solaris 10 (x86).
20116 2005-06-23  Martin Baulig  <martin@ximian.com>
20118         * class.c
20119         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
20120         generic type definitions.
20122 2005-06-23  Martin Baulig  <martin@ximian.com>
20124         Fix #75331.
20126         * metadata.c (mono_class_get_overrides): Renamed to
20127         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
20128         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
20129         pass it to mono_get_method_full().
20131 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
20133         * reflection.c (mono_reflection_create_runtime_class): take the
20134         mono_domain_lock in this method. Prevents deadlocks
20136 2005-06-22  Martin Baulig  <martin@ximian.com>
20138         * loader.c (method_from_methodspec): Fix #75330.
20140 2005-06-22  Martin Baulig  <martin@ximian.com>
20142         * reflection.c (type_get_qualified_name): Use
20143         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
20144         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
20145         argument; use it if we don't have an assembly name.
20147 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
20149         * object.c: In mono_message_init, set "copy out" flag for in
20150         parameters with the [Out] flag.
20152 2005-06-21  Martin Baulig  <martin@ximian.com>
20154         * class.c
20155         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
20156         and MONO_TYPE_PTR.
20158 2005-06-21  Martin Baulig  <martin@ximian.com>
20160         * class.c (mono_class_init): Don't initialize `class->fields' for
20161         generic instances since they're initialized again in
20162         compute_field_layout(). 
20163         (compute_field_layout): Set the field's `generic_info' here; fix
20164         #75320. 
20166 2005-06-21  Martin Baulig  <martin@ximian.com>
20168         * class-internals.h
20169         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
20171         * metadata.c (mono_metadata_generic_method_equal): Also
20172         distinguish the `generic_class'; fixes #75334.
20174 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20176         * domain.c:
20177         * appdomain.c:
20178         * domain-internals.h:
20179         * reflection.c: 'domain_assemblies' field is now protected by its own
20180         lock. Don't call into managed code to run the AssemblyLoad event if we
20181         now there are no registered delegates for it.
20183 2005-06-20  Martin Baulig  <martin@ximian.com>
20185         * class.c (mono_class_is_assignable_from): Use a custom version of
20186         mono_class_has_parent() to make things work for generic instances;
20187         fix #75300.
20189 2005-06-20  Martin Baulig  <martin@ximian.com>
20191         * loader.c (method_from_methodspec): Apply a patch from
20192         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
20194 2005-06-20  Martin Baulig  <martin@ximian.com>
20196         * class.c (mono_class_init): Reverted Zoltan's last change; it
20197         breaks generics.
20199 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
20201         * threads.c (wait_for_tids_or_state_change): Add missing locking.
20203 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20205         * socket-io.c: fix the index in the socket array for writable/error
20206         sockets. Fixes bug #75306.
20208 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
20210         * class.c (mono_class_init): Allow interfaces to have static ctors.
20212 2005-06-17  Martin Baulig  <martin@ximian.com>
20214         * loader.c (method_from_methodspec): Use `context->container' when
20215         parsing the `gmethod->inst'.
20217 2005-06-17  Martin Baulig  <martin@ximian.com>
20219         * class.c (mono_type_get_name_recurse): Don't add the assembly
20220         name for type arguments.
20222 2005-06-15  Martin Baulig  <martin@ximian.com>
20224         * reflection.c (mono_image_get_inflated_method_token): Encode
20225         correct klass; fixes #75260.
20227 2005-06-13 Michal Moskal <malekith@nemerle.org>
20229         * icall.c: Make GetCorrespondingMethod/Constructor take
20230         MonoReflectionMethod method not MonoMethod. Removed
20231         MonoType.GetCorrespondingField, and make
20232         MonoGenericType.GetCorrespondingField take name not
20233         MonoClassField.
20235 2005-06-13  Michal Moskal <malekith@nemerle.org>
20237         * reflection.c (field_encode_signature, encode_locals):
20238          Make sizes of buffers for types larger (for big generic types).
20239          (create_generic_typespec,
20240          mono_reflection_sighelper_get_signature_local,
20241          mono_reflection_sighelper_get_signature_field):
20242          Add asserts for too small buffers.
20244 2005-06-15  Martin Baulig  <martin@ximian.com>
20246         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
20247         if our parent is not a dynamic type.
20249 2005-06-15  Martin Baulig  <martin@ximian.com>
20251         * class-internals.h (MonoTypeNameFormat): New enum.
20253         * class.c
20254         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
20255         (mono_type_get_full_name): Removed.
20256         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
20257         argument instead of the boolean's.
20259         * icall.c (ves_icall_System_MonoType_getFullName):
20260         Added `gboolean assembly_qualified'.    
20262         * reflection.h
20263         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
20265         * reflection.c (mono_reflection_parse_type): Parse the new type
20266         name format.
20268 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20270         * icall.c: no need to convert from utf16 to utf8 and then back again
20271         after the call to GetLogicalDrives.
20273 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20275         * icall.c: frombase64. Fix problems exposed by new tests.
20277 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20279         * icall.c: added internal calls for converting char [] and strings in
20280         base64 into byte [].
20282 2005-06-10  Martin Baulig  <martin@ximian.com>
20284         * class.c (mono_class_create_generic_2): Read the nested classes
20285         from the metadata rather than from `gklass->nested_classes' since
20286         `gklass' might not be initialized yet.
20288 2005-06-09  Duncan Mak  <duncan@novell.com>
20290         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
20291         all public headers. Fixes #74919.
20293 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
20295         * domain.c: The key for proxy_vtable_hash is now a pointer
20296         array. Added new GHashFunc and GCompareFunc functions for this.
20298         * class.h: The list of interfaces in MonoRemoteClass is known in
20299         advance and can't grow (we create a new MonoRemoteClass if needed),
20300         so now the interface array can be allocated together with
20301         MonoRemoteClass.
20302         
20303         * object.c: Added a new method create_remote_class_key.
20304         Fixed mono_remote_class so it does not depend on
20305         mono_upgrade_remote_class.
20306         Removed extend_interface_array.
20307         Added new method clone_remote_class(), which makes a copy of a remote
20308         class and adds a new interface or class to it.
20309         mono_upgrade_remote_class() now creates a new remote class (or gets
20310         it from the cache) if an vtable upgrade is needed. In this way
20311         we make sure that other objects sharing the same remote class
20312         don't get the new vtable with unwanted interfaces.
20313         
20314         * object-internals.h:
20315         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
20316         
20317         * marshal.c: Track changes in mono_upgrade_remote_class().
20319 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
20320         * icall.c: Add runtime methods for obtaining members of inflated
20321         class, which were created from supplied non-inflated members. It
20322         is used in internal Get{Method,Constructor,Field} methods in
20323         System.Type
20325 2005-06-09  Martin Baulig  <martin@ximian.com>
20327         * reflection.c
20328         (mono_reflection_bind_generic_method_parameters): Fix #75169.
20330 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20331         * reflection.c (mono_image_basic_init): Define
20332         Version in MonoDynamicAssembly. 
20333         
20334 2005-06-08  Martin Baulig  <martin@ximian.com>
20336         Fix #75136.
20338         * loader.c
20339         (mono_method_signature_full): New public method; takes a
20340         `MonoGenericContext *'.
20341         (find_method): Use mono_method_signature_full() and pass the
20342         klass'es context to it.
20344         * class.c (mono_class_is_inflated_method): Use
20345         mono_method_signature_full() and pass the context to it.
20347 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
20349         * object.c: add proper locking in mono_remote_class_vtable(),
20350         fixes possible memory corruption.
20352 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
20354         * marshal.c (mono_remoting_marshal_init): set
20355         initialized after initialization.
20357 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
20359         * locales.c : hush.
20361 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
20363         * object.c (extend_interface_array): fix really silly
20364         memory corrupting / comparison bug.
20366 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20368         * reflection.c: Functions added to support the creation
20369         of CustomAttributeData, which includes Attribute data
20370         used by ReflectionOnly methods.
20372         * reflection.h:  mono_reflection_get_custom_attrs_data and
20373          mono_custom_attrs_data_construct added (functions exposed).
20375          * icall.c: Added mono_reflection_get_custom_attrs_data
20376          as icall.
20377         
20378 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
20380         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
20381         lupus's request.
20383 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
20385         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
20387         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
20388         dynamic DllImportAttribute.
20390         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
20391         dynamic DllImportAttribute.
20393         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
20394         Fixes #75162.
20396 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20398         * threads.c: avoid segfault when an unstarted thread is aborted.
20400 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
20402         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
20403         Returns the name and version of the runtime for reporting.
20405 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20407         * appdomain.c: bump corlib version.
20408         * object-internals.h: new field in MonoReflectionAssembly.
20410 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20412         * object-internals.h: Carlos forgot to add this field.
20414 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20416         * icall.c: Added create_version to create instances
20417         of Version of MonoReflectionAssemblyName. This change helps
20418         the AssemblyName tests to keep running fine.
20419         
20420 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
20421   
20422         * object.c (mono_method_return_message_restore): A somehow less
20423         intrusive fix for #75138.
20425 2005-06-03  Raja R Harinath  <rharinath@novell.com>
20427         * object.c (mono_method_return_message_restore): Fix computation
20428         of expected number of out args.
20430 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
20432         * reflection.c (mono_image_get_method_info): Fix the case when the
20433         charset is empty.
20435 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
20437         * object.c: Added missing null check in
20438           mono_method_return_message_restore.
20440 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
20442         * reflection.c (mono_image_get_method_info): Handle the case when
20443         dllentry is empty.
20445 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
20447         * object.c: When creating the vtable for a proxy, take into account
20448         all inherited interfaces, not only the ones registered in
20449         iclass->interfaces. This fixs bug #74996.
20450         Also, in mono_method_return_message_restore, verify that the array
20451         of out args has the expected lengh.
20453 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20455         * socket-io.c: update the timeout in Poll when the call is interrupte.
20457 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20459         * socket-io.c: support abort/suspend in Select_internal after last
20460         change.
20462 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20464         * threadpool.c: remove warning.
20466 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20468         * icall.c:
20469         * socket-io.[ch]: Select_internal uses poll() now when available, thus
20470         removing the 1024 limit from select(). Runtime part of the fix for
20471         bug #71203.
20473 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20475         * socket-io.c: when resolving the addresses for the same
20476         host returned by gethostname(), get the local IPs from the interface
20477         list. Loopback addresses are discarded if the are interfaces up with
20478         non-loopback ones. Fixes bug #63265.
20480 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
20482         * appdomain.c, verify.c, object-internals.h, reflection.c:
20483         bumped corlib number to 36, and added new extra_flags field
20484         to ReflectionMethodBuilder and friends.  Fixes #75060.
20486 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
20488         * gc.c: register a new weak link only if the object is non-null
20489         (fixes bug#75047).
20491 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
20493         * culture-info.h : short time pattern too.
20495 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
20497         * culture-info.h : expand long time pattern string length.
20499 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
20501         * culture-info-table.h : update (more French date format; #72788).
20503 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
20505         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
20506         the method is static. Fixes #75029.
20508 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
20510         * reflection.c: Update the table_idx field of method builders after
20511         saving the module, since it can change. This is a workaround for
20512         bug #74914. 
20514 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
20516         * culture-info-table.h : update (additional French date format).
20518 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
20520         * icall.c (ves_icall_type_Equals): Revert last change.
20521         
20522         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
20524         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
20526 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
20528         * class-internals.h: Added executioncontext_class field to 
20529         MonoDefaults structure.
20530         * domain.c: Cache System.Threading.ExecutionContext class in 
20531         mono_defaults.
20532         * object.c: Capture the ExecutionContext for asynchroneous calls in
20533          mono_async_result_new.
20534         * object-internals.h: Added execution_context and original_context 
20535         fields to MonoAsyncResult. Added execution_context to MonoThread.
20536         * security-manager.c|.h: Added mono_get_context_capture_method to 
20537         return the capture method (if required by the security manager or by
20538         the framework version used).
20539         * threadpool.c: Apply capture (if present) ExecutionContext in 
20540         mono_async_invoke and revert to original context after it completes.
20542 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
20544         * culture-info-table.h : updated (real hacky solution for zh-CHT).
20546 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
20548         * culture-info-table.h : zh-CHT related workaround.
20550 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
20552         * marshal.c (emit_marshal_custom): Add some error checking and call the
20553         methods in the ICustomMarshaler interface. Fixes #74875.
20554         
20555         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
20556         native->managed wrappers.
20558 2005-05-12  Martin Baulig  <martin@ximian.com>
20560         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
20561         here and use the loader lock.
20563         * mono-debug.c: Properly lock when the debugger is not attached.
20564         (mono_debug_init): Release the initial lock if we're not running
20565         in the debugger.
20567 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
20569         * marshal.c (emit_marshal_custom): Pass through NULL values without
20570         calling the custom marshalling routines.
20572         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
20573         conversion in structures. Fixes #74882.
20575 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
20577         * culture-info-table.h : zh-* cultures were missing.
20579 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
20581         * threads.c: Added a new event background_change_event which is signaled
20582         when a thread changes its background mode.
20583         Moved here several checks previously done in managed code. The checks
20584         require the thread lock, and using the thread lock in managed code
20585         can result in deadlocks.
20586         Merged Start_internal and Thread_internal into a single method. Now 
20587         Thread_internal does all work of creating and starting a thread.
20588         Added icalls for setting and getting the state of the object. Moved from
20589         managed code to avoid locking there.
20590         Added wait_for_tids_or_state_change() which is called instad of
20591         wait_for_tids when waiting for non-backround threads to end. This method
20592         will return if one of the threads ends or the background_change_event
20593         is signaled.
20594         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
20595         the background mode. This method signals the background_change_event
20596         event.
20597         * icall.c:
20598         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
20599         removed Start_internal.
20600         
20601 2005-05-11  Martin Baulig  <martin@ximian.com>
20603         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
20604         to order of some fields to get proper alignment on 64-bit machines.
20606 2005-05-11  Martin Baulig  <martin@ximian.com>
20608         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
20609         changes as they're broken and completely fuck up the debugger.
20611         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
20613 2005-05-10  Martin Baulig  <martin@ximian.com>
20615         * reflection.c (mono_reflection_generic_class_initialize): Don't
20616         call mono_class_setup_parent() here.
20618 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20620         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
20621         send/receive timeout use an integer in milliseconds. We were using a
20622         struct timeval.
20624 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20626         * locales.c:
20627         (internal_get_cultures): reserve the first slot of the array for the
20628         InvariantCulture, which will be filled in managed code.
20630 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
20632         * reflection.c (mono_image_fill_module_table): Initialize the
20633         GENERATION field as well.
20635 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20637         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
20638         Monitor.Enter on the object.
20640 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
20642         * threads.c: Enable the wait for running threads when exiting.
20643         * icall.c: Suspend all threads before exiting.
20645 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
20647         * assembly.c (mono_assembly_load_reference): Fix warning.
20649 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20651         * threadpool.c: changed the default number of threads per cpu. From now
20652         on, the default will be 20 + (5 * number of cpus) instead of 50.
20654 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
20656         * loader.c (mono_method_get_signature_full): Add locking here.
20658 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
20660         * appdomain.c: Moved methods for parsing and freeing assembly
20661         names to assembly.c.
20662         * assembly.c, domain-internals.h: Created public methods for parsing
20663         assembly names. Fixed mono_assembly_load_with_partial_name:
20664         it now finds the best match, taking into account the version,
20665         token and culture specified in the partial name. Also return
20666         the latest version if no version information is specified.
20668 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
20670         * threadpool.c: replace check for SocketAsyncCall class.
20672 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20674         * threadpool-internals.h:
20675         * Makefile.am: added threadpool-internals.h
20677         * threadpool.c: call mono_unhandled_exception on exceptions not handled
20678         that happen in threadpool threads (tested on MS).
20679         (mono_thread_pool_remove_socket): new function that dispatch any pending
20680         AIO call on a socket that is closing. By now only epoll really needs it,
20681         as select/poll wake up when the socket closes.
20684         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
20686 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
20688         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
20690 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
20692         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
20694 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
20696         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
20697         has an abort request, convert it into a suspend request.
20699 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
20701         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
20702         warning for the usage of `UnmanagedFunctionPointerAttribute' which
20703         is not supported yet.
20705 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20707         * image.c: register assemblies loaded from data (bundles) in the loaded
20708         assemblies hash. Fixes bug #74772.
20710 2005-04-29  Martin Baulig  <martin@ximian.com>
20712         * class.c (mono_type_get_name_recurse): Update to the new naming
20713         schema from the latest .NET 2.x beta2.
20714         (mono_class_setup_vtable_general): If we're a generic instance,
20715         copy the vtable from our generic type definition and inflate all
20716         the methods in it.
20718         * loader.c (find_method): Update to the new naming schema from the
20719         latest .NET 2.x beta2.
20721 2005-04-29  Raja R Harinath  <harinath@gmail.com>
20723         * class.c (mono_class_init): Add a mono_loader_unlock to the
20724         #74734 fix.
20726 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
20728         * icall.c (ves_icall_System_Environment_Exit): Remove the 
20729         suspend_all_other_threads () call for the time being, since it can hang.
20731         * threads.c (mono_thread_manage): Similarly, disable the waiting for
20732         the background threads to exit, since it can also hang.
20734         * class.c (mono_class_init): Applied patch from Ankit Jain 
20735         (radical@gmail.com). Avoid pending init errors when a field refers
20736         to a nested class using a typeref. Fixes #74734.
20738         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
20739         this for dynamic modules.
20741 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20743         * threads.c: don't wait for threads that are in the process of aborting
20744         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
20745         and waiting for background threads to finish. This makes xsp and
20746         mod-mono-server exit without random length delays and/or hangs.
20748 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20750         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
20752 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
20754         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
20755         dynamic types to prevent infinite loops. Fixes #74727.
20757         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
20758         ..._is_assignable_to.
20760 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
20762         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
20764 2005-04-25  Martin Baulig  <martin@ximian.com>
20766         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
20768         * domain.c
20769         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
20771         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
20773         * reflection.c (build_compressed_metadata): Set metadata header
20774         version to 2.0.
20776 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
20778         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
20779         number into an integral and a decimal part. Fixes #70473.
20781         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
20783 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
20785         * culture-info-table.h : reflected the latest locale-builder output.
20787 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20789         * threadpool.c: check for SuspendRequested too when deciding if
20790         mono_thread_interruption_checkpoint should be called.
20792 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20794         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
20795         * threads.c: remove interruption_mutex and use Interlocked instead. When
20796         suspending all the threads, wait for all the suspended events at once.
20797         If we're shutting down and get an APC that is going to be queued,
20798         call mono_thread_execute_interruption immediately, as the thread might
20799         be sleeping on a pthread condition or mutex.
20801         * icall.c: call mono_runtime_set_shutting_down before suspending the
20802         threads.
20804         Fixes bug #74693. And now xsp is happier when exiting.
20806 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
20808         * loader.c (mono_stack_walk): Fix #74690.
20810 2005-04-22  Martin Baulig  <martin@ximian.com>
20812         * mono-debug.h (MonoDebugMethodJitInfo): Added
20813         `MonoDebugMethodJitInfo *jit'.
20815         * mono-debug.c (mono_debug_read_method): Cache the
20816         MonoDebugMethodJitInfo in `address->jit'.
20817         (mono_debug_free_method_jit_info): New public method.
20819 2005-04-22  Martin Baulig  <martin@ximian.com>
20821         * class.c (mono_class_is_assignable_from): Disallow
20822         type parameter -> interface.
20824 2005-04-21  Dick Porter  <dick@ximian.com>
20826         * threads.c (mono_thread_create): Turn an assertion into an error.
20828 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
20830         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
20831         
20832         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
20833         Fix some gcc 4.0 warnings.
20835 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
20837         * file-io.c: fix alt dir separator char on unix systems
20838         and cleanup (fixes bug #71214).
20840 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
20842         * marshal.c: Use CALLVIRT instead of CALL when dispatching
20843         a call to a remote domain, since the method may be an
20844         interface method in the client domain. This fixes bug #74192.
20846 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20848         * threadpool.c: recv/send are now performed before going back to managed
20849         code to save one transition.
20851 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20853         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
20855         * metadata/threadpool.c: removed hack to workaround the bug above.
20857         Fixes bug #74618.
20859 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
20861         * reflection.c reflection.h: Fix handling of parameter defaults in
20862         dynamic methods. Also fixes handling of parameter attributes.
20863         Fixes #74609.
20865         * mono-debug.c (mono_debug_close_image): Fix warning.
20867 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20869         * socket-io.h: replaced old unused field with new 'blocking'.
20870         * threadpool.c: restore socket blocking state on windows(tm).
20872 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
20874         * icall.c: don't return the codebase in the AssemblyName[] returned by
20875         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
20876         * object-internals.h: Removed FIXME (fields were presents) and fixed
20877         versioncompat declaration.
20879 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20881         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
20882         not closed, so don't cleanup when it happens.
20884 2005-04-13  Chris Toshok  <toshok@ximian.com>
20886         * mono-debug-debugger.h: change prototype for
20887         mono_debugger_lookup_type.
20889         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
20890         this function, although it should probably be named
20891         mono_debugger_init_type.
20893 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20895         * threadpool.c: fix non-AIO case.
20897 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
20899         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
20900         the built-in profiler to measure just JIT compilation times.
20902 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20904         * threadpool.c: the epollfd might be closed by another thread at
20905         any time, so ignore EBADF at treat it as a "we're closing" sign.
20907 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20909         * threadpool.c: release the semaphores with a count equals to the number
20910         of working threads in both IO and regular pools. Fixed typo that messed
20911         up the count of IO pool threads. Don't initialize the pipe handles if
20912         we're using epoll.
20914 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20916         * threadpool.c: some systems don't like a NULL when deleting the socket
20917         from epoll.
20919 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20921         * threadpool.c: fix semaphore allocation.
20923 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20925         * threadpool.c: added epoll() based implementation for asynchronous IO
20926         that is used instead of the default poll() when available.
20927         It can be disabled by setting MONO_DISABLE_AIO.
20929 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20931         * threadpool.c: windows needs 'closesocket' and instead of returning
20932         0 when the stream is closed while in select, it returns -1. Fixes bug
20933         #74573.
20935 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
20937         * class.c (class_compute_field_layout): Fix the regression caused by
20938         the previous try.
20940 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20942         * threadpool.c: separate pool for socket async. IO.
20943         * threadpool.h: mono_max_worker_threads is not a global any more.
20945 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
20947         * class.c (class_compute_field_layout): Fix #74549.
20949 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20951         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
20952         use 2 connected sockets instead.
20954 2005-04-08  Miguel de Icaza  <miguel@novell.com>
20956         * mono-config.c: Add new entry point for mkbundle
20957         mono_config_parse_memory. 
20959 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20961         * threadpool.c: removed another unused function.
20963 2005-04-08  Ankit Jain  <radical@corewars.org>
20965         * reflection.c (get_default_param_value_blobs): Add 'types'
20966         parameter to get the types encoded in the constant table.
20967         (mono_param_get_objects): Use the type from the constant table,
20968         not the type of the parameter, when creating default values.
20969         Handle null default values correctly.
20971 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20973         * file-io.c:
20974         * file-io.h:
20975         * threadpool.c:
20976         * threadpool.h:
20977         * icall.c:
20978         * socket-io.c: removed dead code for async IO.
20980 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20982         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
20984         * threadpool.c: intercept socket async. calls and pass them to a thread
20985         that is polling and dispatching the job items to the threadpool as
20986         socket become ready. Fixes bugs #71217, #71933.
20988         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
20989         between char and short/ushort arrays.
20991         * socket-io.c: remove dead code.
20993 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
20995         * locales.c,
20996           icall.c : removed InternalToUpper_Comp() and
20997           InternalToLower_Comp().
20999 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
21001         * char-conversions.h : The tables were incorrectly generated. Should
21002           be generated against invariant culture.
21004 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
21006         * object.c (mono_runtime_invoke_array): Fix return value when 
21007         passing pre-created valuetype objects to ctors.
21009         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
21010         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
21011         Fixes #74338.
21013 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
21015         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
21016         only used with --security and hides the wrong corlib version error.
21018 2005-03-30  Joshua Tauberer  <tauberer@for.net>
21020         * class.c: Changed mono_class_name_from_token so that types
21021         outside of a namespace don't have an initial period.  Improved
21022         the g_warning message used in _mono_class_get when loading
21023         fails.
21024         * assembly.c: In mono_assembly_load_reference, when an assembly
21025         can't be found, "No such file or directory" is misleading and
21026         unhelpful because a few paths were checked for the presence of
21027         the assembly.  When that happens (ENOENT), display a nicer
21028         message indicating the directories that were searched.  In all
21029         cases, the warning is made easier to read for non-hackers.
21031 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
21033         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
21034         project/solution.
21035         * appdomain.h|domain.c: Removed inline from functions.
21036         * appdomain.c: Reduced warnings when compiling on windows.
21037         * icall.c: Fixed output_debug declaration to gunichar2*.
21038         * mono-config.c: Reduced warnings when compiling on windows.
21039         * rand.c: Added missing "windows.h". Added missing return value.
21040         * rawbuffer.c: Added missing winsock2.h for windows.
21041         * sysmath.h: Added mono-compiler.h header to allow/ease 
21042         compilation with non-GCC compilers.
21043         * threads.c: Fixed declarations to compile with VS.NET C compiler.
21044         Removed cast warnings.
21046         Adapted from the work of J Lothian (for VC6).
21048 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
21050         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
21051         from default_path.
21053 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
21055         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
21056         the 2.0 profile.
21058 2005-03-27  Raja R Harinath  <harinath@gmail.com>
21060         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
21061         has to be in $(exec_prefix).  $(prefix) is for arch-independent
21062         stuff, and it would probably use $(prefix)/share rather than
21063         $(prefix)/lib.
21065 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21067         * console-io.c: added 2 includes that might be missing.
21069 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
21071         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
21072         profile.
21074         * reflection.c (create_custom_attr): Allocate the params array using
21075         alloca so it gets GC tracking.
21077 2005-03-23  Chris Toshok  <toshok@ximian.com>
21079         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
21080         out some spew.
21082 2005-03-24  Raja R Harinath  <rharinath@novell.com>
21084         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
21085         changes to pick up any changes in prefix, etc.
21087 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
21089         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
21090         
21091         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
21092         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
21094 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
21096         * class-internals.h object-internals.h class.c reflection.c: Extend the
21097         mono_lookup_dynamic_token () function to return the class of the
21098         token as well. 
21100         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
21101         well. Fixes #73848.
21103 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
21105         * security-manager.c: Skip inheritance checks for intra-corlib
21106         class inheritance and method overrides. This skips a lot of checks
21107         and (anyway) permissions cannot work until corlib is loaded.
21109 2005-03-23  Martin Baulig  <martin@ximian.com>
21111         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
21112         MONO_TYPE_GENERICINST.  
21114 2005-03-23  Martin Baulig  <martin@ximian.com>
21116         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
21118 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
21120         * class.c: added locking comments to some functions.
21121         Cache the interface offsets arrays (saves about 20 KB
21122         of runtime memory in a typical app).
21123         Reduce the time overhead in mono_class_setup_supertypes ().
21125 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
21127         * icall.c: speedup and fix leaks in GetMethodsByName and
21128         GetPropertiesByName.
21130 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21132         * reflection.c: some locking fixes.
21134 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
21136         * metadata.c: added missing break in case statement.
21138 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
21140         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
21141         typedbyref return values. Fixes #73941.
21143 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
21145         * security-manager.c|h: Added demandunmanaged method and 
21146         suppressunmanagedcodesecurity class to MonoSecurityManager.
21147         Renamed aptc class to allowpartiallytrustedcallers.
21149 2005-03-17  Martin Baulig  <martin@ximian.com>
21151         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
21153 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21155         * file-io.c: disabled file async. IO using aio_*. It uses the
21156         threadpool now. Workaround for bug #73718.
21158 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21160         * assembly.h, mono-config.c: added code to deal with bundled configs
21161         for bundled assemblies.
21163 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
21165         * *.c, private.h: cleanup, removing old private.h header file.
21167 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
21169         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
21170         and throw_on_unmappable_char attributes.
21172 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
21174         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
21175         _ProcessName_internal.
21177 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
21179         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
21180         #73631.
21182         * icall.c threads.c threads-types.h: Remove slothash icalls as they
21183         are no longer used.
21185 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
21187         * object.c (compute_class_bitmap): Add support for generics. Fixes
21188         #73527.
21190 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
21192         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
21194 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21196         * filewatcher.c: commented out the code for windows watcher, as we don't
21197         use it (we use the managed implementation instead).
21199 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
21201         * object-internals.h (MonoThread): Remove 'unused1' field.
21203         * appdomain.c: Bump corlib version.
21205         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
21207         * reflection.c (mono_reflection_create_runtime_class): Remove the
21208         AssemblyBuilder.Save optimization since it causes too many problems.
21210 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
21212         * exception.c|h: Added mono_get_exception_reflection_type_load to
21213         create a ReflectionTypeLoadException object.
21214         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
21215         to return NULL is a InheritanceDemand fails during reflection. Updated
21216         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
21217         ReflectionTypeLoadException if an InheritanceDemand fails during 
21218         reflection. Added icall mapping for GetLinkDemandSecurity.
21219         * security-manager.c|h: Added ves_icall_System_Security_
21220         SecurityManager_GetLinkDemandSecurity internal call to return the
21221         class and methods permissions set for a LinkDemand. Removed unused
21222         fields in MonoSecurityManager.
21224 2005-03-10  Martin Baulig  <martin@ximian.com>
21226         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
21227         it's a generic instance.
21229 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
21231         * reflection.c (mono_get_object_from_blob): Applied patch from
21232         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
21234         * class.c (mono_class_is_assignable_from): Another try at fixing 
21235         #73469 without breaking anything.
21237 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
21239         * class.c: (mono_class_is_assignable_from): Revert the last changes
21240         since they don't work with generics.
21241         
21242         * class.c (mono_class_is_assignable_from): Fix build bustage.
21244         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
21245         the managed IsAssignableFrom method. Fixes #73469.
21247         * reflection.c (mono_reflection_call_is_assignable_from): New helper
21248         function.
21250 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
21252         * object.c (mono_load_remote_field_new): Fix returning uninitialized
21253         memory when the remoting callback does not sets the out arguments.
21254         Fixes #73007.
21256         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
21257         by mistake.
21259         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
21261         * object-internals.h (MonoStackFrame): Sync with managed object layout.
21263         * appdomain.c: Bump corlib version.
21265 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
21267         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
21268         function.
21270         * threads.c (mono_thread_attach): Detect threads which are not started
21271         by the GC pthread wrappers.
21273 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
21275         * icall.c: Added new icall for RNG.
21276         * rand.c|h: Added new icall to open the RNG. This allows to share a 
21277         single handle on Linux to access /dev/urandom and fix #73183.
21279 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
21281         * object.c: setting the new vtable in a transparent proxy object must
21282         not change the GC descriptor.
21284 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21286         * object.c: fixed compilation without GCJ support.
21287         * reflection.c: for runtime-created types ensure klass->has_references
21288         is correct (bug #73215).
21290 2005-03-02  Martin Baulig  <martin@ximian.com>
21292         * class.c (mono_class_is_assignable_from): Make this work if
21293         `oklass' is a generic instance; fixes #72831.
21295 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
21297         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
21298         with hasthis set.
21299         
21300         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
21302         * marshal.c: Reorganize native->managed marshalling code to also use
21303         the emit_marshal_... functions.
21305 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
21307         * object.c: typed allocs have issues with bitmap sizes > 30,
21308         so check for max_set >= 30.
21310 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
21312         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
21313         managed code. Fixes #73012.
21315         * metadata.h (MonoMarshalSpec): Add elem_mult field.
21317         * metadata.c reflection.c: Load/Emit elem_mult as well.
21318         
21319         * metadata.h (MonoMarshalSpec): Add comment.
21321         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
21323         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
21324         num_elem to -1 if not given.
21326         * object-internals.h (MonoReflectionMarshal): Add has_size field.
21328         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
21329         given values.
21331 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
21333         * null-gc.c (mono_gc_free_fixed): Was not compilable.
21335 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
21337         * reflection.c (encode_marshal_blob): Encode param_num field as well.
21339         * object-internals.h (MonoReflectionMarshal): Add param_num field.
21341 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
21343         * object.c: generalized the reference bitmap creation
21344         and added hooks for the new GC.
21345         * class-internals.c: removed the gc_bitmap field from MonoClass.
21347 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21349         * domain.c: help the compiler to produce better code
21350         in mono_jit_info_table_find ().
21352 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
21354         * object.c: make all allocations look typed.
21356 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21358         * socket-io.c: load Mono.Posix if it's not loaded already
21359         (fixes bug#73033).
21361 2005-02-24  Martin Baulig  <martin@ximian.com>
21363         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
21364         * reflection.c (dup_type): Likewise.
21366 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
21368         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
21369         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
21371 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21373         * domain.c, threads.c, object-internals.h: make the critical thread
21374         local vars use the fast access mode (even when we're compiled in
21375         a lib). Provide accessors to be used by the jit during codegen.
21377 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21379         * appdomain.c: Changed hook functios behavior to include
21380         support for the reflection only assemblies. Some icalls were changed
21381         to support the mentioned assemblies too. Signatures of static methods
21382         try_assembly_resolve and real_load now have an additional parameter:
21383         refonly.
21385         * assembly.c: General changes to mono_assembly_ methods to support
21386         reflection only api. Functions mono_assembly_open, mono_assembly_load,
21387         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
21388         suffix, to support an additional gbool parameter to specify whether
21389         the assembli is reflection only or not. Created some new hook functions 
21390         to add support for reflection only assemblies. Signatures of static 
21391         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
21392         have now an additional parameter: refonly.
21394         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
21395         indicating whether the assembly is reflection only or not.
21397         * exception.c: Add mono_get_exception_invalid_operation.
21399         * icall.c: Throw an InvalidOperationException when trying to invoke
21400         a property/method/event, or trying to set/get the value of a field.
21401         Also add an icall to retrieve the ref_only flag to the
21402         MonoReflectionAssembly.
21404 2005-02-23  Chris Toshok  <toshok@ximian.com>
21406         Part of fix for #72827.
21407         * mono-debug.c (mono_debug_add_method): add lexical block data to
21408         the info we write.  Kind of a hack at the moment - we copy the
21409         lexical block info from the MonoDebugMethodInfo to the
21410         MonoDebugMethodJitInfo here, before writing it.
21411         (mono_debug_read_method): read the lexical block info.
21413         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
21415         * debug-mono-symfile.h: add lexical block support.
21417         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
21418         support.
21420 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
21422         * loader.c (mono_lookup_pinvoke_call): Fix warning.
21424         * object.c (mono_runtime_free_method): Call mono_free_method () and
21425         put the TODOs there.
21427         * loader.c (mono_free_method): Free up most memory allocated for 
21428         dynamic methods.
21430 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
21432         * reflection.c: properly flag a Type argument to a
21433         named custom attr value (bug #72248).
21435 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21437         * reflection.c: reduce code duplication in named custom
21438         attribute encoding.
21440 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
21442         * reflection.c: properly encode custom attrs of type object
21443         (bug #72649).
21445 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
21447         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
21449 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
21451         * socket-io.c: load System.dll if it's not loaded already
21452         (bug #72850 and #70477).
21454 2005-02-21  Martin Baulig  <martin@ximian.com>
21456         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
21457         generic instances.
21459 2005-02-21  Martin Baulig  <martin@ximian.com>
21461         * reflection.c (mono_image_build_metadata): We also need to
21462         "fixup" the MethodImpl table after we computed the final method
21463         indices.  Call fixup_methodimpl() to do that.
21464         (fixup_methodimpl): New private method.
21466 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
21468         * assembly.c: special case mscorlib.dll (bug#72536),
21469         patch from Carlos Alberto Cortez.
21471 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
21473         * threads-types.h threads.c: Fix build bustage.
21475         * threads.c: Use a union for long<->double conversions.
21477         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
21478         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
21480         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
21481         containing the checkpoint call with NOT_TAKEN.
21482         
21483         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
21484         checkpoint before pushing the arguments, so they won't have to be
21485         spilled to stack.
21487 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21489         * domain.c, assembly.c, domain-internals.h: make some data
21490         const and relocation-free.
21492 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
21494         * object.c, appdomain.c, class-internals.h: introduce the
21495         MonoClassRuntimeInfo structure to hold the info needed to
21496         use a class at runtime. Made mono_class_vtable() lock-free
21497         for all the appdomains.
21499 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
21501         * metadata-internals.h, image.c: introduce a per-image mempool to
21502         be used for memory that has the same lifetime as the image.
21504 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
21506         * domain.c: In mono_init_internal(), instead of selecting the first
21507         runtime version supported by an executable, get a list of all
21508         supported versions and select the one for which an mscorlib exists
21509         (since even if the runtime supports a given version, it doesn't mean
21510         that the framework for that version is installed).
21511         Modified get_runtimes_from_exe to support this behavior.
21512         In supported_runtimes, added information about additional system
21513         assembly versions.
21514         
21515         * assembly.c: Added support for more than one system assembly version
21516         per runtime version. Updated the assembly list.
21517         In mono_assembly_remap_version, removed the initial version check,
21518         since we don't know to which version we need to compare until we
21519         get the version set on which the assembly is based.
21520         Moved the code for loading corlib into the new method
21521         mono_assembly_load_corlib(), so it can be used by the initialization
21522         code.
21523         
21524         * domain-internals.h: Updated data structures and added declaration
21525         for mono_assembly_load_corlib.
21527 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
21529         * reflection.c (resolve_object): Fix the creation of the signature in 
21530         the SignatureHelper case.
21532         * assembly.c (mono_assembly_remap_version): Fix binary search.
21533         
21534 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
21536         * class.c: Added inheritance check when a method is overloaded (from a
21537         virtual method or when implementing an interface) and when a class is
21538         inherited. Added functions to set a failure for a class and to 
21539         retreive the exception from a failure.
21540         * class-internals.h: Added fields to MonoClass to keep the exception
21541         information status for inheritance (or other exceptions) to be thrown
21542         later (i.e. not at load time).
21543         * object.c: Throw the inheritance SecurityException when a type is to 
21544         be created with either class or method inheritance violations.
21545         * reflection.c|h: Fix when getting declsec from a class. Removed 
21546         unrequired code for class. Improved sanity in parameter naming.
21547         * security-manager.c|h: Added functions to check for class and method
21548         inheritance.
21550 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
21552         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
21553         and has_finalize in dynamic types as well.
21555 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
21557         * culture-info-table.h : fixed currency format for en-GB (and so on).
21559 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
21561         * gc.c: ensure the GC handles never have 0 as a value.
21563 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
21565         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
21566         a pointer to a struct to unmanaged code. Fixes #72625.
21568 2005-02-16  Martin Baulig  <martin@ximian.com>
21570         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
21572 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
21574         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
21576 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
21578         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
21580         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
21581         UnmanagedFunctionPointerAttribute, use it for determining calling convention
21582         etc. Fixes #71471.
21584         * reflection.c (mono_custom_attrs_get_attr): New helper function.
21586         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
21588 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
21590         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
21591         changes to make the current context a field in MonoThread.
21593 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
21595         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
21596         the last change.
21597         
21598         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
21599         extracted from mono_marshal_get_native_wrapper.
21601         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
21602         to create wrappers around native functions.
21604         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
21605         delegates for arbitrary function pointers. Fixes #71472.
21607 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
21609         * threads.c: cleaned up the code a little.
21611 2005-02-15  Martin Baulig  <martin@ximian.com>
21613         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
21614         the data table.
21616         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
21617         allocate larger chunks if needed.
21619 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
21621         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
21622         in by mistake.
21624 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
21626         * domain.c: keep the domains in an array and ensure the domain ids
21627         are kept small, so they can be used as indexes to domain-specific data
21628         with a small memory overhead.
21630 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
21632         * icall.c: Handle byref types in Type icalls. Fixes #72544.
21634 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
21636         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
21638 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
21640         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
21642         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
21643         values.
21645         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
21646         
21647 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
21649         * domain-internals.h: add the hashtable here.
21651         * class-internals.h: Remove `info' from MonoMethod
21653         * domain.c: Add a new hashtable, jit_trampoline_hash
21655 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
21657         * object.c: don't set the value of static fields
21658         (fixes bug#72494).
21660 2005-02-11  Martin Baulig  <martin@ximian.com>
21662         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
21663         (mono_debug_add_method): Silently ignore the method if it's too big.
21664         (mono_debug_add_type): Likewise.
21666 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
21668         * threads.c, appdomain.c: remove #ifdefs from the code.
21670 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
21672         * metadata-internals.h: Added flags to MonoAssembly to cache the most
21673         common security informations. This allows us to stay in unmanaged code
21674         when doing LinkDemand and it's special cases (except for the first 
21675         time for initialization). The flags a very much used with --security.
21676         * reflection.c|h: Added code to get declarative security attributes 
21677         for LinkDemand and InheritanceDemand. This required to refactor the
21678         existing code for Demand.
21679         * security-manager.c|h: Added new method fields for the special cases
21680         of LinkDemand.
21682 2005-02-10  Martin Baulig  <martin@ximian.com>
21684         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
21685         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
21687 2005-02-10  Martin Baulig  <martin@ximian.com>
21689         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
21690         debugging code; this is almost a complete rewrite.
21692         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
21694 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
21696         * domain.c, object.h: expose mono_string_equal () and 
21697         mono_string_hash ().
21698         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
21699         it's implemented in managed code.
21701 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21703         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
21704         lo leak objects between appdomains.
21706 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21708         * assembly.c: old compilers compilation fix from 
21709         robertj@gmx.net (Robert Jordan).
21711 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
21713         * class-internals.h: Little reminder for the future.
21715         * debug-helpers.c: Fix up wrapper_type_names
21717 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21719         * image.c, metadata-internals.h: when loading an image from a file,
21720         mmap all of it and use the same codepaths as when using a
21721         in-memory image: the code is simpler and we use less memory
21722         (both writable and readonly).
21724 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
21726         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
21727         API to alloc runtime data structures that need to be tracked by the
21728         GC and contain pointers.
21729         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
21730         make the code more readable and eventually use a different GC.
21732 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
21734         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
21735         for out arguments.
21736         
21737 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
21739         * object.c: In release_type_locks(), don't release the cctor lock
21740         if it has already been released. This fixes a crash in the
21741         thread5 test.
21743 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
21745         * gc.c, marshal.c, icall.c: register a delegate for finalization
21746         only when the native function pointer has been allocated for it.
21748 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
21750         * object.c: cleaned up some code, allocate objects that are
21751         pointer free with the atomic malloc variant. Allocate memory
21752         for static data from the mempool if it's pointer-free.
21753         Allocate the bounds array at the end of the array data, when needed.
21754         * object-internals.h, object.h: move a private function in a private
21755         header.
21756         * class.c: handle missing case in tracking references in fields.
21758 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
21760         * class.c, class-internals.h: keep track if a type has
21761         reference fields in either the instance or static fields.
21763 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
21765         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
21766         and renamed to MonoRuntimeInfo. Added fields to store the expected
21767         framework assembly version. Changed mono_get_framework_version and
21768         mono_get_runtime_version for a single mono_get_runtime_info method.
21769         
21770         * assembly.c: Added method to remap system assembly versions to the
21771         current executing runtime version. Removed old mapping code.
21772         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
21773         
21774         * icall.c, reflection.c: Track api changes.
21776 2005-02-06  Miguel de Icaza  <miguel@novell.com>
21778         * loader.c (method_from_memberref): Improve error reporting,
21779         produce the class name instead of the typeref/typedef index. 
21781 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
21783         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
21785 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21787         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
21788         stdcall and charset name mangling.  Reorganize the code and add
21789         some tracing stuff.
21791 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
21793         * monodiet.c: More iters!
21795         * marshal.c: Iter usage.
21797         * icall.c: Iter usage.
21799         * object.c: Use iters.
21801         * debug-helpers.c: More iters
21803 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21805         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
21806         under win32.
21808 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
21810         * mono-debug-debugger.c: use iters
21812         * class.c, class-internals.h: mono_class_setup_events is static
21813         now
21815         * All callers: use iters
21817 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
21819         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
21820         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
21822 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
21824         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
21826         * marshal.h: Add prototypes for ldfld/stfld_remote.
21828         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
21829         this is called during startup.
21830         
21831 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
21833         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
21834         MonoThreadsSync struct private in monitor.c. Changed the way
21835         MonoThreadsSync is allocated so it's faster and there is no
21836         need to keep track of it with a finalizer and it uses less memory.
21837         This also finally allows us to allocate mono objects as ptrfree when
21838         there are no reference fields.
21840 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
21842         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
21843         disappearing link to the GC interface and use them to simplify
21844         the gchandles code.
21846 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
21848         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
21849         stfld_remote which call mono_load/store_field_new. This allows methods
21850         calling ldfld/stfld wrappers to be AOTed.
21852         * console-io.c: Include sys/filio.h under solaris.
21853         
21854         * console-io.c: Include curses.h if needed correctly.
21856 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
21857         
21858         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
21859         method->klass as well.
21861         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
21863         * class.c (mono_class_init): Switch on lazy initialization of 
21864         methods.
21866         * class.c (mono_class_get_finalizer): Handle the case when the 
21867         finalizer is inherited.
21869 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21871         * console-io.c: <curses.h> is needed by term.h on solaris.
21873 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
21875         * icall.c, class-internals.h, monodiet.c, class.c: Remove
21876         mono_class_setup_properties where possible. Remove this ftn from
21877         the header file, and make it static.
21879 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
21881         * loader.c: Add missing setup_... call.
21883         * class.c: Add missing setup_... calls.
21885         * class.c (mono_class_init): Switch on lazy initialization of 
21886         the generic vtable.
21887         
21888         * class.c (mono_class_init): Fix generics broken by the recent changes.
21890         * monodiet.c (handle_type): Add missing setup_... calls.
21892         * class.c: Back out garbage in previous patch.
21893         
21894         * class.c: Add missing setup_... calls.
21896         * class.c (mono_class_get_method_from_name_flags): Avoid calling
21897         mono_class_setup_methods () if possible.
21899         * class-internals.h (MonoClass): Add 'has_cctor' flag.
21901         * class-internals.h (MonoCachedClassInfo): New structure.
21903         * class.c: Initialize properties and events fields of MonoClass lazily.
21905         * class.c: Add infrastructure for lazily initializing the methods and
21906         vtable fields of MonoClass. Not yet used.
21908         * class.c (mono_class_get_finalizer): New helper function.
21910         * class.c: Add infrastructure for loading some class related data from
21911         an AOT file.
21913         * object.c: Add infrastructure for initializing the vtable from data
21914         in the AOT file.
21916         * gc.c (run_finalize): Use mono_class_get_finalizer ().
21918         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
21919         appropriate initialization function before accessing parts of the
21920         MonoClass structure.
21922         * marshal.c: Fix warnings.
21923         
21924         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
21926         * mono-debug-debugger.c (get_exception_message): Use 
21927         mono_class_get_method_from_name_flags ().
21929 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
21931         * reflection.c, appdomain.c: Replace a few manual searches that
21932         Zoltan missed. (Paolo approved this part of my initial patch).
21934 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
21936         * profiler.c: disable recording statistical events at report time.
21938 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
21940         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
21941         to byteswap arrays of enum values, too (bug #72080).
21943 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
21945         * appdomain.c (set_domain_search_path): Allow this to be called if
21946         domain->setup is not yet set.
21948         * loader.c (mono_method_get_index): New helper function.
21950         * loader.c reflection.c: Use mono_method_get_index ().
21952         * class.c (mono_class_get_method_from_name_flags): New helper method.
21954         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
21955         this.
21957         * class.c (mono_class_get_cctor): New helper method.
21959         * string-icalls.c object.c class.c marshal.c reflection.c: Use
21960         mono_class_get_method () to look up methods.
21962 2005-02-01  Miguel de Icaza  <miguel@novell.com>
21964         * console-io.c: Fix the build, this should work on Windows.
21966 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
21968         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
21969         be set to null to keep things valid
21971 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21973         * icall.c: added Console 2.0 icalls.
21974         * Makefile.am: added console-io.[ch]
21975         * console-io.[ch]: internal calls for Console 2.0 API.
21977 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21979         * class.c: make sure we consider all the interfaces
21980         when calculating max_interface_id (bug found by
21981         Jeroen Frijters running ikvm).
21983 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
21985         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
21986         valuetype fields to null.
21988         * object.c (set_value): Ditto. Fixes #71669.    
21990 2005-01-31  Martin Baulig  <martin@ximian.com>
21992         * metadata.c (mono_metadata_has_generic_params): New public
21993         function; checks whether something is a generic method.
21995 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
21997         * appdomain.c: fix infinite recursion when adding assemblies.
21999 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
22001         * object.c: Fix small typo to return all items for Environment.
22002         GetCommandLineArgs.
22004 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
22006         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
22007         reflection.c: more domain and assembly-unload related fixes
22008         and memory leaks plugs.
22010 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
22012         * 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.
22014 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
22016         * loader.c (mono_method_signature): Make this method lazy
22017         (mono_get_method_from_token): Don't computate the signature here.
22019         Doing this saves quite a bit of memory. I got 90 kb on starting up
22020         monodoc. It should also save some disk reads on startup.
22022         * *: MonoMethod->signature might be NULL now. You *MUST* use
22023         mono_method_signature.
22025 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
22027         * object.c (mono_runtime_get_main_args): Return an array from the
22028         current domain here. Fixes #71938.
22030 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
22032         * monitor.c: formatting changes to comply with the
22033         mono coding style and remove #ifdefs from the code.
22035 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
22037         * metadata.c, private.h: remove some unneeded data
22038         and use a more compact representation for table schemas.
22040 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
22042         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
22043         to get a better distribution in hash tables.
22044         * *.c: use mono_aligned_addr_hash() where appropriate.
22045         * assembly.c: make var static.
22047 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
22049         * domain-internals.h: Put MonoJitInfo on a diet.
22051         * domain.c: Fix a warning.
22053 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22055         * gc.c: rework the gc handles code to reuse handles
22056         when freed.
22058 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
22060         * domain.c: fixed long standing bug in mono_string_equal() which
22061         was brought to light with the ldstr changes.
22063 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
22065         * reflection.c: Remove warning by adding missing include for marshal.h
22067 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22069         * domain.c, object.c: change the ldstr_table to hold
22070         MonoString* as keys: makes the runtime isinterned lookup
22071         faster and simplifies memory management.
22073 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
22075         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
22076         possible to add imperative security checks before calling the icall.
22077         * reflection.c: Return security attributes on the original MonoMethod
22078         (and not the wrapped one). This fix permissions on icalls.
22080 2005-01-25  Dick Porter  <dick@ximian.com>
22082         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
22083         the check for mktime() support actually test the mktime() return
22084         value.  "Fixes" bug 71682, though the output is still different to
22085         MS.
22087 2005-01-25  Martin Baulig  <martin@ximian.com>
22089         * class.c (mono_class_is_assignable_from): Make this work for
22090         generic instances.
22092 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
22094         * marshal.c (mono_string_utf8_to_builder)
22095         (mono_string_builder_to_utf16): We might not have ownership of the
22096         string. In thise case, we need to create a new buffer.
22098         * object-internals.h (mono_stringbuilder_capacity): sb->str might
22099         be null, in which case, use the default capacity.
22101 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22103         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
22104         GC events to the profiler.
22106 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
22108         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
22109         if you don't want the GC to run.
22111 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
22113         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
22114         start providing a GC API and keeping different implementations in
22115         their own file.
22116         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
22118 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
22120         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
22121         mmap rather than allocating a huge buffer.
22122         (mono_debug_close_mono_symbol_file): Free the buffer allocated
22123         above.
22125 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
22127         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
22128         and CheckExecutionRights.
22129         * reflection.c|h: Keep the index of the declarative security to be 
22130         used, instead of the pointer, when AOT compiler is used. Also add 
22131         class initialization when requesting demands.
22132         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
22133         CheckExecutionRights. Both properties are now FALSE by default, and
22134         unmodifiable, unless the --security option is used.
22136 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22138         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
22139         reflection.c: properly refcount images and assemblies, many leaks fixed.
22141 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22143         * threadpool.c: increase the timeout for threads in the thread pool to
22144         10s.  Fixes bug #67159.
22146 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
22148         * class-internals.h: Sun's compiler insists on explicit
22149         signed on bit fields to handle then correctly.
22151 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
22153         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
22154         Make the size of the array fit only the number of invalid path
22155         chars that we have.
22157         * class.c (_mono_class_get): Improve the error reporting when a
22158         class referenced is not found, to assist debugging. 
22160 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
22162         * threads.c: fix off-by-one error.
22163         * domain.c: free data allocated in the domain.
22165 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
22167         * reflection.c (mono_method_body_get_object): Fill out exception info
22168         as well.
22170         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
22171         structure.
22172         
22173 2005-01-19  Martin Baulig  <martin@ximian.com>
22175         * loader.c (mono_get_method_constrained): Make this work again.
22177 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
22179         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
22180         guint16 to match the managed side.
22182         * reflection.c (mono_reflection_body_get_object): Fill out local
22183         variables array.
22185         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
22186         as well.
22188         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
22189         'local_var_sig_token'.
22191 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
22193         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
22194         System.Drawing.
22196         * reflection.c (mono_method_body_get_object): Handle abstract and
22197         runtime methods.
22199 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
22201         * marshal.c, loader.c, class-internals.h, reflection.c:
22202         store the emthod data for a wrapper in an array instead of a list.
22204 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
22206         * marshal.c: change the code to allocate memory more
22207         conservatively for method wrappers.
22209 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
22211         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
22212         fields from MonoClass to the marshal info structure where they belong.
22214 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22216         * class.c, object.c, class-internals.h, marshal.c: rearrange
22217         some fields and tweak some types to lower memory usage.
22219 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
22221         * threads.c (signal_thread_state_change): Handle the case when the
22222         target thread is the current thread.
22224         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
22226         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
22227         emit_ptr_to_object_conv. 
22229         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
22230         marshalling. Fixes #71352.
22232 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
22234         * metadata.h, blob.h: move table enum to blob.h so it can be included
22235         in any header.
22236         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
22237         cut the size of MonoImage/MonoDynamicImage.
22239 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
22241         * profiler.c (mono_profiler_install_simple): Fix default arguments.
22243 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
22245         * reflection.c, reflection.h, icall.c: add a function to check
22246         if an attribute type is defined for a metadata object.
22248 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
22250         * object-internals.h: Added some needed fields from StringBuilder class.
22251         * marshal.c: Set the maxCapacity when creating a StringBuilder.
22253 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
22255         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
22256         threads before shutting down the runtime.
22258         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
22260 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
22262         * object-internal.h, threads.c: implement stacksize and 
22263         parameterized thread start functionality (requires
22264         matching corlib). Marked broken code for later removal.
22266 2005-01-12  Martin Baulig  <martin@ximian.com>
22268         * class-internals.h (MonoGenericClass): Moved the `initialized'
22269         flag to MonoDynamicGenericClass, removed `init_pending'.
22270         (MonoGenericInst): Added `is_reference' flag.
22272 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
22274         * reflection.c (mono_image_create_pefile): Only set the pe_offset
22275         inside the MSDOS header. Fixes #71201.
22277         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
22278         gc thread.
22279         (mono_domain_finalize): Ditto.
22281 2005-01-12  Martin Baulig  <martin@ximian.com>
22283         * class.c (mono_get_shared_generic_class): Use the cache for
22284         non-dynamic generic classes.
22286         * class-internals.h (mono_class_create_generic_2): Removed
22287         function prototype, this function is now static inside class.c.
22289         * class.c (mono_class_create_generic_2): Made this static, only
22290         call it from mono_class_init() and mono_class_setup_parent().
22291         (collect_implemented_interfaces_aux): Call mono_class_init() on
22292         the interfaces we collect.
22293         (mono_class_setup_vtable): Call mono_class_init (class->parent).
22295 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
22297         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
22298         it a real thread handle.
22300         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
22301         MonoJitExceptionInfo, since each catch clause needs its own variable.
22302         
22303 2005-01-11  Dick Porter  <dick@ximian.com>
22305         * image.c (mono_pe_file_open): New variant on mono_image_open()
22306         that does not set up the CLI metadata; used for FileVersionInfo so
22307         it can get the data for windows binaries too.
22308         
22309         * process.c (process_read_string_block): Don't read off the end of
22310         the StringTable block.
22312         These both fix bug 70766.
22314 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
22316         * gc.c: set some fields to NULL at GC cleanup time.
22317         * threads.c: if we quit the main thread, call exit ().
22319 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
22321         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
22323 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
22325         * threads.h, threads.c, object.c: added accessor and settor for
22326         main_thread. Handle it specially when exiting from it: wait
22327         for other foreground threads to exit.
22329 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
22331         * process.c, verify.c: remove some bloat.
22333 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
22335         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
22336         the calling convention to cdecl under win32.
22338 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
22340         * object.c (mono_object_get_size): New function to get the size of
22341         an object instance.
22343         * profiler.c (simple_allocation): Use above.
22345 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
22347         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
22348         ves_icall_System_AppDomain_getRootDomain (as it's not required to
22349         get an appdomain by it's id and we can't assume the root's id is 0).
22350         * domain-internals.h: Change the function prototype to match.
22351         * icall.c: Change the icall table for AppDomain.
22353 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
22355         * locales.c (string_invariant_compare_char): Only compute
22356         GUnicodeTypes in the case where we need them.  Test for ordinality
22357         first and return if so.
22359         From the commit:
22361                 /*
22362                  * FIXME: here we must use the information from c1type and c2type
22363                  * to find out the proper collation, even on the InvariantCulture, the
22364                  * sorting is not done by computing the unicode values, but their
22365                  * actual sort order.
22366                  */
22368 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
22370         * loader.c: for P/Invoke methods, allow the "Internal" shared
22371         library name to refer to the calling process symbol namespace.
22373 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
22375         * Makefile.am: Add the security manager to the build.
22376         * security-manager.c|h: New. Initialization of the security manager.
22378 2005-01-07  Dick Porter  <dick@ximian.com>
22380         * threads.c: 
22381         * monitor.c: Update thread state during Monitor and WaitHandle
22382         waits.  Fixes bug 71031.
22384 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
22386         * reflection.c (property_encode_signature): Correctly handle when the
22387         property has no methods.
22389 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
22391         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
22392         
22393         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
22394         fields from mb, not rmb. Fixes #71017.
22396         * marshal.c (emit_ptr_to_str_conv): Add support for 
22397         ByValTStr -> string conversion. Fixes #71015.
22399         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
22401         * mempool.c (mono_mempool_contains_addr): New helper function.
22403 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
22405         * metadata.c (mono_metadata_compute_size): Fix size calculation of
22406         HasSematics encoded fields.
22407         
22408         * metadata.c (mono_type_to_unmanaged): Improve error message for 
22409         invalid string marshalling.
22411         * metadata.c: Fix warnings.
22412         
22413 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22415         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
22416         profiler support.
22418 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
22420         * domain.c object.c domain-internals.h: Revert part of r38077 since the
22421         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
22422         tests.
22424 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
22426         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
22427         so methods containing these can be AOTed.
22429 2005-01-03  Martin Baulig  <martin@ximian.com>
22431         * loader.c (find_method): Removed the hack for generic instances.
22432         (method_from_memberref): If our parent is a generic instance, pass
22433         its generic type definition to find_method() and then inflate the
22434         method.
22435         (mono_get_method_constrained): Pass the generic type definition to
22436         find_method() and inflate the method later.
22438         * class-internals.h (MonoStats): Added `generic_class_count'.
22440         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
22441         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
22443         * reflection.c (mono_custom_attrs_from_params): Don't ignore
22444         generic type definitions.
22446 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
22448         * loader.c icall.c: Fix warnings.
22450 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
22452         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
22453         blittable types. Fixes #70864.
22455 2004-12-29  Martin Baulig  <martin@ximian.com>
22457         * icall.c
22458         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
22460         * reflection.c (mono_method_get_object): Create a
22461         "System.Reflection.MonoGenericMethod" for inflated methods; don't
22462         call mono_get_inflated_method().
22464         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
22466 2004-12-27  Martin Baulig  <martin@ximian.com>
22468         * class-internals.h (MonoMethod): Added `is_inflated' flag.
22469         (MonoMethodInflated): Added `inflated' field.
22471         * class.c (mono_class_inflate_generic_method): Don't really
22472         inflate the method here; just set the `is_inflated' flag in the
22473         MonoMethod.
22474         (mono_class_get_inflated_method): Actually inflate the method here
22475         if it's not already inflated; we use the MonoMethodInflated's new
22476         `inflated' field as a cache.
22478 2004-12-26  Martin Baulig  <martin@ximian.com>
22480         * class.c
22481         (inflate_generic_class): Moved some code out of inflate_generic_type().
22482         (mono_class_inflate_generic_method): If we're already inflated,
22483         inflate the context and use the declaring method; ie. make sure
22484         the declaring method of an inflated method is always the generic
22485         method definition.
22486         (mono_class_create_from_typedef): Create
22487         `class->generic_container->context->gclass'.
22489 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
22491         * metadata-internals.h, marshal.c, reflection.c: More
22492         MonoGHashTable->GHashTable.
22494         * domain-internals.h, class.c: Change MonoGHashTable's into
22495         GHashTables for some cases where no gc stuff is used
22497         All users: update apis
22499 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
22501         * metadata.c (builtin_types): Make this `const'. Makes this get
22502         put into the shareable section.
22503         (mono_metadata_init): Casts to make gcc happy.
22505 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
22507         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
22509 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
22511         * icall.c: Added an internal call to retrieve the position and length
22512         of assembly-level declarative security attributes (RequestMinimum, 
22513         RequestOptional and RequestRefuse). This is used by the Assembly class
22514         to re-create the corresponding permission sets.
22516 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
22518         * marshal.c: fix the stelemref wrapper to be type correct
22519         (and faster).
22521 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
22523         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
22524         to do key & 0x7fffffff. Hashtable already does this. It just
22525         results in longer code.
22527 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
22529         * appdomain.c: Bump corlib version.
22530         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
22531         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
22532         * reflection.c|h: Add functions to get declarative security infos
22533         (blob position and length) for assemblies, classes and methods.
22535 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
22537         * reflection.c: sort the constant table (bug #70693).
22539 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
22541         * object-internals.h, threads.c, domain.c: add accessors for
22542         the MonoThread and MonoDomain tls keys.
22544 2004-12-18  Martin Baulig  <martin@ximian.com>
22546         * class.c (inflate_generic_type): If we're inflating a generic
22547         instance, set `ngclass->context->container = context->container';
22548         ie. the container we inflated into.
22550         * metadata.c (mono_metadata_parse_generic_param): Reflect above
22551         inflate_generic_type() changes.
22553 2004-12-17  Martin Baulig  <martin@ximian.com>
22555         * class-internals.h
22556         (MonoGenericClass): Replaced `MonoType *generic_type' with
22557         `MonoClass *generic_class'.  Removed `dynamic_info'; if
22558         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
22559         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
22561 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
22563         * exception.c (mono_exception_from_token): New helper function.
22565 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
22567         * assembly.c (mono_assembly_load_with_partial_name): Call 
22568         mono_assembly_loaded before invoking the preload hooks. Fixes
22569         #70564.
22571         * object-internals.h (MonoThread): Change culture_info and 
22572         ui_culture_info into an array.
22574         * threads.c: Cache culture info objects from more than one appdomain.
22576         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
22577         current UI culture.
22579 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
22581         * threads.h threads.c appdomain.c: Clear the culture_info field of
22582         all threads during unloading if they point to an object in the dying
22583         appdomain.
22585 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
22587         * culture-info.h (TextInfoEntry): New struct
22588         * object-internals.h: sync with managed
22589         * locales.c: fill the `text_info_data' field
22590         * culture-info-tables.h: update
22592 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
22594         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
22595         collector.
22597 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
22599         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
22600         (ves_icall_ModuleBuilder_getMethodToken): Ditto
22602 2004-12-12  Martin Baulig  <martin@ximian.com>
22604         * mono-debug-debugger.c (write_type): If we're an enum and the
22605         builtin types have already been initialized, call mono_class_init().
22607 2004-12-11  Martin Baulig  <martin@ximian.com>
22609         * metadata.c (mono_metadata_load_generic_params): Added
22610         `MonoGenericContainer *parent_container' argument; automatically
22611         compute `container->is_method'; pass the correct owner to
22612         get_constraints().      
22614         * reflection.c (compare_genericparam): Sort the GenericParam table
22615         according to increasing owners. 
22617 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
22619         * profiler.c: allow disabling the default profiler.
22621 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
22623         * decimal.c, icall.c: allow disabling System.Decimal support.
22625 2004-12-09  Marek Safar <marek.safar@seznam.cz>
22627         * reflection.c: Add support for null attribute arguments.
22629 2004-12-09  Martin Baulig  <martin@ximian.com>
22631         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
22632         names to get rid of compiler warnings.
22634 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
22636         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
22637         mono_marshal_load_type_info (). Fixes #69625.
22638         (mono_marshal_get_ptr_to_struct): Likewise.
22640 2004-12-08  Martin Baulig  <martin@ximian.com>
22642         * mono-debug.h: Bumped version number to 47.
22644         * mono-debug-debugger.c
22645         (mono_debugger_event_handler, mono_debugger_event): Take two
22646         guint64 arguments insteed of a gpointer and a guint32.  
22648 2004-12-08  Martin Baulig  <martin@ximian.com>
22650         * debug-mono-symfile.h
22651         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
22652         `address' to `native_offset'.
22654 2004-12-08  Martin Baulig  <martin@ximian.com>
22656         * class.c (mono_class_create_from_typespec): Only inflate if we
22657         either have `context->gclass' or `context->gmethod'.
22659 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
22661         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
22663         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
22665         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
22667         * reflection.c (mono_assembly_get_object): Remove the workaround put
22668         in for the release.
22669         
22670         * appdomain.c: Use the corlib_internal field from MonoAssembly.
22672         * appdomain.c: Bump corlib version.
22674         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
22675         be visible in other appdomains.
22677 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
22679         * threads.c: Interlocked inc and dec for longs were messed up,
22680         use a KISS based impl for this. Fixes 70234
22682 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
22684         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
22686 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
22688         * icall.c: fix to follow policy not to allow struct
22689         arguments in icalls.
22691 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22693         * process.c: make the patch that handles spaces in file paths work
22694         on mono/windows too.
22696 2004-12-06  Martin Baulig  <martin@ximian.com>
22698         * class.c (mono_class_create_generic): Call
22699         mono_class_setup_supertypes() if we're dynamic.
22700         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
22702 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
22704         * object-internals.h: Add new fields to MonoThread.
22706         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
22708         * icall.c threads-types.h threads.c: Add new icalls.
22710         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
22712         * object-internals.h (MonoReflectionAssembly): Sync object layout with
22713         managed side.
22715         * appdomain.c: Bump corlib version.
22717         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
22718         internal assemblies. Fixes #69181.
22720 2004-12-05  Martin Baulig  <martin@ximian.com>
22722         * class.c (mono_class_inflate_generic_signature): Make this a
22723         no-op if `context' is NULL or we don't have any type parameters;
22724         also copy `sentinelpos'.        
22726 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
22728         * image.c: Add unbox_wrapper_cache.
22730         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
22732         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
22733         function generator.
22734         
22735         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
22736         Fixes #70173.
22738         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
22739         
22740 2004-12-04  Martin Baulig  <martin@ximian.com>
22742         * loader.c (mono_method_get_signature_full): New public function;
22743         like mono_method_get_signature(), but with an additional
22744         `MonoGenericContext *' argument.
22746         * class.c (mono_class_inflate_generic_signature): Formerly known
22747         as inflate_generic_signature(); make this public.
22749 2004-12-04  Martin Baulig  <martin@ximian.com>
22751         * metadata.c
22752         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
22753         instead of a `MonoGenericContainer *'.  
22754         (mono_metadata_parse_array_full): Likewise.
22755         (mono_metadata_parse_signature_full): Likewise.
22756         (mono_metadata_parse_method_signature_full): Likewise.
22757         (mono_metadata_parse_generic_inst): Likewise.
22758         (mono_metadata_parse_generic_param): Likewise.
22759         (mono_metadata_parse_mh_full): Likewise.
22760         (mono_type_create_from_typespec_full): Likewise.
22762 2004-12-03  Martin Baulig  <martin@ximian.com>
22764         * class-internals.h (MonoGenericContainer): Replaced the
22765         `MonoGenericContext * pointer with a `MonoGenericContext'
22766         structure and made it the first element.
22768 2004-12-03  Martin Baulig  <martin@ximian.com>
22770         * class.c
22771         (inflate_generic_type): Set the `context->container' when creating
22772         a new MonoGenericContext.
22773         (mono_class_inflate_generic_method): Likewise.
22774         (mono_class_create_from_typespec): Just use `context->container'
22775         to get the container.
22777         * loader.c (method_from_methodspec): Set `context->parent' from
22778         `context->container' - and if that's a method container, use its
22779         parent.  Also set the `context->container' when creating a new
22780         MonoGenericContext.
22781         (mono_get_method_from_token): Use just `context->container' to get
22782         the container.
22784         * metadata.c (do_mono_metadata_parse_generic_class): Also set
22785         `gclass->context->container'.
22787         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
22788         the `context->container' when creating a new MonoGenericContext.
22790 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
22792         * reflection.c (compare_genericparam): Sort params with identical
22793         owner by their number. Fixes gen-111 on sparc.
22795 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
22797         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
22798         around the domain changes.
22800         * appdomain.c (mono_domain_unload): Handle the case when the thread
22801         calling Unload is itself being aborted during unloading. Fixes #70022.
22803         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
22805         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
22806         checkpoint_func as an icall so it gets a wrapper.
22807         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
22808         in the cross-appdomain wrappers too.
22810         * threads.c (mono_thread_has_appdomain_ref): Make this public.
22812         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
22814         * reflection.c: Fix some memory leaks.
22815         
22816 2004-12-02  Martin Baulig  <martin@ximian.com>
22818         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
22820         * metadata.c (generic_class_cache): New static hashtable.
22821         (mono_metadata_lookup_generic_class): New public method.
22823 2004-12-02  Martin Baulig  <martin@ximian.com>
22825         * class.c (mono_class_create_from_typedef): Call
22826         mono_class_setup_parent() and mono_class_create_mono_type() before
22827         parsing the interfaces.
22829 2004-12-02  Martin Baulig  <martin@ximian.com>
22831         * metadata.c (generic_inst_cache): New static hashtable.
22832         (mono_metadata_lookup_generic_inst): New public function.
22833         (mono_metadata_inflate_generic_inst): New public function.
22834         (mono_metadata_parse_generic_inst): New public function.
22835         (do_mono_metadata_parse_generic_class): Use the new
22836         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
22837         since this'll also use the cache.
22839         * reflection.c (mono_reflection_bind_generic_method_parameters):
22840         Use mono_metadata_lookup_generic_inst() to use the new cache.
22842         * class.c (inflate_mono_type): Use
22843         mono_metadata_inflate_generic_inst() to inflate a generic
22844         instance; this'll also use the new cache.
22846         * loader.c (method_from_methodspec): Use
22847         mono_metadata_parse_generic_inst() and
22848         mono_metadata_inflate_generic_inst() rather than parsing it
22849         manually, so we can use the new cache.
22851 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
22853         * threads.c (wait_for_tids): Do not incorrectly free threads when 
22854         the wait times out.
22856 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
22858         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
22859         iter->args based on whether parameters are passed in registers (i.e.
22860         MONO_ARCH_REGPARMS is defined)
22862 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
22864         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
22865         the exception message. Fixes #70070.
22866         (method_from_methodspec): Fix warnings.
22868 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22870         * process.c: (complete_path) return the path quoted
22872 2004-12-01  Martin Baulig  <martin@ximian.com>
22874         * class-internals.h (MonoGenericInst): New structure.
22875         (MonoGenericClass): Replaced `type_argc', `type_argv' and
22876         `is_open' with `MonoGenericInst *inst'.
22877         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
22878         `is_open' with `MonoGenericInst *inst'.
22880 2004-11-30  Martin Baulig  <martin@ximian.com>
22882         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
22884         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
22885         to `generic_class_cache'.
22887         * metadata.c
22888         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
22889         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
22890         (mono_generic_inst_is_valuetype): Renamed to
22891         mono_generic_class_is_valuetype().
22893         * class-internals.h
22894         (MonoGenericInst): Renamed to MonoGenericClass.
22895         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
22896         (MonoClass): Renamed `generic_inst' to `generic_class'.
22897         (MonoGenericContext): Renamed `ginst' to `gclass'.
22899         * object-internals.h
22900         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
22902         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
22903         mono_reflection_generic_class_initialize().
22905         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
22906         now known as "System.Reflection.MonoGenericClass".
22907         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
22909 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
22911         * class-internals.h: Added a flag field to MonoClass to cache the
22912         declarative security attributes actions associated with the class.
22913         * domain-internals.h: Added booleans to MonoJitInfo to cache the
22914         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
22915         applicable to the JITted method.
22916         * reflection.c|h: Added functions to extract (as flags) which security
22917         actions are available (declaratively) for a method, class or assembly.
22918         * metadata.c|h: Added functions to search the declarative security
22919         table in the metadata.
22920         
22921 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
22923         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
22924         EXPORTEDTYPES are already in the class name cache, so there is no
22925         need to add extra code here to look at them. Just removes a bit of
22926         cruft.
22928         (ves_icall_System_Environment_get_TickCount): No need for #if
22929         WINDOWS. We already have the code in io-layer.
22931 2004-11-28  Martin Baulig  <martin@ximian.com>
22933         * loader.c
22934         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
22935         Fixes gen-112.cs.
22937 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
22939         * assembly.c (do_mono_assembly_open): Instead of having a
22940         conditional WITH_BUNDLE, incorporate support for bundles here, by
22941         having a global `bundles' variable holding a pointer to the actual
22942         bundles. 
22944         (mono_register_bundled_assemblies): New API call used by the
22945         bundle code. 
22947         See mkbundle.1 for details.
22948         
22949 2004-11-27  Martin Baulig  <martin@ximian.com>
22951         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
22952         the vtable for generic methods.
22954 2004-11-26  Martin Baulig  <martin@ximian.com>
22956         * metadata.c
22957         (mono_metadata_generic_method_hash): New public function.
22958         (mono_metadata_generic_method_equal): Likewise.
22960         * class-internals.h
22961         (MonoGenericContainer): Added `GHashTable *method_hash'.
22963         * reflection.c (ReflectionMethodBuilder): Added
22964         `MonoGenericContainer *generic_container'.
22965         (reflection_methodbuilder_to_mono_method): Don't create a new
22966         MonoGenericContainer each time we're called.
22967         (mono_reflection_bind_generic_method_parameters): Use
22968         `container->method_hash' to cache the results so we don't create a
22969         different method if we're called several times with the same
22970         arguments.
22972         * loader.c (method_from_methodspec): Use the new
22973         `container->method_hash' here, too.
22975 2004-11-26  Martin Baulig  <martin@ximian.com>
22977         * class.c (inflate_generic_signature): Correctly compute
22978         `res->has_type_parameters'.
22979         (mono_class_vtable): Use the `has_type_parameters' flag to
22980         determine whether we're a generic method.
22982         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
22984 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
22986         * object.c (mono_runtime_run_main): Fix a small memory leak.
22988 2004-11-25  Martin Baulig  <martin@ximian.com>
22990         * class.c (set_generic_param_owner): Fixed the loop.
22992 2004-11-25  Martin Baulig  <martin@ximian.com>
22994         * object.c (mono_class_vtable): Don't create any JIT wrappers for
22995         generic methods.
22997 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
22999         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
23000         names. Fixes #69787.
23002 2004-11-24  Martin Baulig  <martin@ximian.com>
23004         * class.c (mono_class_create_generic_2): If we don't have a
23005         `ginst->parent', inflate `gklass->parent' to get our parent.
23007 2004-11-24  Martin Baulig  <martin@ximian.com>
23009         * reflection.c (compare_genericparam): Correctly sort the
23010         GenericParam table; fixes #69779.
23012 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
23014         * reflection.c: When writing a PE file, don't create a huge
23015         buffer in memory. Just write the arrays we have to the file.
23016         This reduces memory usage.
23018         * metadata-internals.h: MonoDynamicStream pefile is no longer used
23019         globally.
23021 2004-11-17  Martin Baulig  <martin@ximian.com>
23023         * class.c (mono_class_init): Don't setup `class->parent' for
23024         dynamic instances; moved this to mono_class_generic_2().
23025         (mono_class_create_generic): Also set `klass->inited' for dynamic
23026         generic instances.
23027         (mono_class_create_generic_2): Don't do anything for dynamic
23028         generic instances.  Set `klass->parent' here and also call
23029         mono_class_setup_parent() here. 
23031         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
23032         `MonoType *parent' argument; set `ginst->parent' before calling
23033         mono_class_create_generic_2(), so we set the correct parent.
23035 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
23037         * reflection.c: allow getting attributes from ModuleBuilder
23038         (used by ikvm).
23040 2004-11-17  Martin Baulig  <martin@ximian.com>
23042         * class.c (mono_class_create_from_typedef): If a type parameter is
23043         inherited from an outer class, set its owner to that class.
23045 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
23047         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
23048           for (int*) written size. This fixes bug #69592.
23050 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
23052         * icall.c: Added IsAuthenticodePresnet internal call.
23053         * image.c|h: New function that check a MonoImage for an Authenticode
23054         signature in the certificate PE data directory.
23055         * security.c|h: New internal call to ask the runtime if an 
23056         Authenticode signature seems referenced in the PE header.
23058 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
23060         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
23062         * reflection.c (mono_image_create_pefile): Free the assembly streams
23063         after writing out the assembly file.
23065         * object.c (mono_runtime_run_main): Fix small memory leak.
23067         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
23068         property access modifiers. Fixes #69389.
23070 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
23072         * domain.c, object.c, object-internals.h, domain-internals.h,
23073         object.h, marshal.c: keep dynamic code info per domain.
23075 2004-11-15  Martin Baulig  <martin@ximian.com>
23077         * class.c (mono_type_get_name_recurse): Put type arguments in
23078         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
23079         see bug #68387.
23081 2004-11-15  Martin Baulig  <martin@ximian.com>
23083         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
23084         (mono_class_setup_vtable): When computing `the_cname' for a
23085         generic instance, don't include the namespace since we'd otherwise
23086         add it twice.
23088 2004-11-15  Martin Baulig  <martin@ximian.com>
23090         * class.c (mono_class_create_generic): Changed return type to void.
23091         (mono_class_create_generic_2): New public function; setup
23092         `class->method', `class->field' and `class->interfaces' here
23093         instead of in mono_class_init().
23095         * class.h (mono_class_create_generic): Moved to class-internals.h.
23097 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
23099         * reflection.c (mono_image_create_pefile): take a file HANDLE.
23100         rather than writing to memory, write to this file. Right now,
23101         we are just writting into a buffer, and copying that. However
23102         we can avoid the buffer later.
23104         (mono_dynamic_stream_reset): new function
23106         * icall.c, object-internals.h: update for the above.
23108 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
23110         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
23111         have been using gc'd memory. First it is slower, unlikely
23112         the comment in the source code said, secondly, it increases
23113         our footprint to do it in the gc.
23115         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
23116         the method so that it does not have to copy to managed code.
23118 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
23120         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
23122 2004-11-12  Martin Baulig  <martin@localhost>
23124         * reflection.c (mono_image_create_token): Allow generic method
23125         definitions here, since they may appear in an `.override'; see
23126         gen-98/gen-99 for an example.
23128 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
23130         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
23131         #69365.
23133         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
23134         descriptive.
23136 2004-11-11  Martin Baulig  <martin@ximian.com>
23138         * class.c (mono_class_setup_vtable): In an explicit interface
23139         implementation, the method name now includes the arity.
23141 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
23143         * object.c (mono_array_full_copy): Fix warning.
23145 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
23147         * appdomain.c: Removed look_for_method_by_name(). Use the new method
23148         mono_class_get_method_from_name() instead.
23149         
23150         * class-internals.h: Added two new types of wrappers. 
23151         Added MonoRemotingTarget enum. Added new trampoline function type, which
23152         takes an additional MonoRemotingTarget value as parameter, so it is
23153         possible to request a trampoline for a specific target.
23154         
23155         * class.c: Added new mono_class_get_method_from_name() method.
23156         
23157         * class.h: In MonoRemoteClass, we can have now to vtables, one for
23158         general remoting sinks and one specific for cross domain calls.
23159         
23160         * debug-helpers.c: Added new wrapper names.
23161         
23162         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
23163         of a remote class.
23164         
23165         * image.c: Porperly delete value objects form the remoting invoke hashtable.
23166         
23167         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
23168         with several other methods (mono_marshal_get_xappdomain_dispatch,
23169         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
23170         and others) can generate a fast remoting wrapper for cross domain calls.
23171         More information can be found in docs/remoting.
23172         Other changes: Removed mono_find_method_by_name, and used
23173         mono_class_get_method_from_name instead.
23174         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
23175         is stored in the remoting invoke hashtable.
23176         
23177         * marshal.h: published the new method for getting the xdomain wrapper,
23178         and also added a method for getting the adequate wrapper for a given
23179         method and target.
23180         
23181         * object-internals.h, object.c: Added a couple of methods for capying and
23182         cloning arrays.
23183         Modified mono_install_remoting_trampoline, which takes the new remoting
23184         trampoline that has a remoting target as parameter.
23185         mono_class_proxy_vtable now also takes a remoting target as parameter, and
23186         will return the most suitable vtable for the target.
23187         Added mono_remote_class_vtable, which returns the vtable of a remote class
23188         (which can be the normal remoting vtable or the xdomain vtable).
23189         
23190         * threads.c: the xdomain invoke and dispatch wrappers must also be
23191         protected against interruptions.
23193 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23195         * icall.c: use memmove in BlockCopyInternal when the source and
23196         destination arrays are the same.
23198 2004-11-09  Martin Baulig  <martin@ximian.com>
23200         * class-internals.h (MonoGenericContainer): Removed `method' and
23201         `signature', replaced them with `is_method' and `is_signature'
23202         flags.  Added `context'.
23204         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
23205         instead of a `MonoGenericContainer *'.
23207         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
23208         for dynamic type parameters.
23209         (mono_metadata_load_generic_params): Setup `container->context'.
23211         * reflection.c (mono_reflection_setup_generic_class): Setup
23212         `tb->generic_container->context'.
23213         (do_mono_reflection_bind_generic_parameters): Use
23214         mono_class_inflate_generic_type() to correctly inflate types,
23215         rather than using our own hack just for MONO_TYPE_VAR.
23217 2004-11-09  Martin Baulig  <martin@ximian.com>
23219         * class.c (mono_class_inflate_generic_method): Small fix; don't
23220         crash here.
23222         * icall.c
23223         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
23224         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
23225         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
23226         (ves_icall_Type_BindGenericParameters): Likewise.
23227         (ves_icall_Type_get_IsGenericInstance): Likewise.
23228         (ves_icall_Type_GetGenericParameterPosition): Likewise.
23229         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
23230         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
23231         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
23233 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
23235         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
23236         assembly versions and public key tokens. Fixes #69113.
23238 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
23240         * metadata.c: fix bug introduced with the type cache changes
23241         on 2004-11-06.
23243 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
23245         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
23246         the MonoClass pointer instead of the token in exception clauses.
23247         * reflection.c: updates for the above and make the code not depend
23248         on the structure of MonoExceptionClause.
23250 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
23252         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
23253         Add support for dynamic assemblies. Fixes #69114.
23255         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
23257 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
23259         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
23260         since most only those methods use it. the code member of
23261         MonoMethodPInvoke was dead, so that can be removed too. Also,
23262         remove inline_count (again, not used), and move slot so that it
23263         can share bits with some other flags. This saves 8 bytes in the
23264         structure and gives us about 50 kb back for mcs helloworld.cs
23266         * *.[ch]: Do naming changes for the above.
23268         * loader.c (mono_method_get_header): Lazily init the header
23269         on first access.
23270         (mono_get_method_from_token): don't init the header here
23271         (mono_free_method): the header may never be allocated
23273         Overall, this saves 150 kb of unmanaged allocations
23274         for mcs helloworld.cs. That accounts for 10% of the unmanaged
23275         memory at runtime.
23276         
23277         * loader.c, loader.h (mono_method_get_header): new accessor.
23279         * *.[ch]: use the above method. Prepares us to lazily load
23280         the header.
23282         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
23283         three warnings, which are actual bugs (see 69206).
23285         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
23286         unused. Saves a cool 4 bytes / method.
23288 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
23290         * metadata.c (builtin_types): Add types for System.Object here.
23291         (mono_metadata_parse_type_full): Cache MonoType*'s that are
23292         for a class or valuetype from klass->this_arg or klass->byval_arg.
23294         On mcs for a hello world, this gets us down from 21836 MonoType's
23295         to 14560.
23297         (mono_metadata_free_type): Account for the above change.
23299 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
23301         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
23302         exception instead of asserting if name is null.
23303         (ves_icall_System_AppDomain_GetData): Ditto.
23305 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
23307         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
23308         EnumBuilder.
23310         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
23311         Return NULL when the domain does not have entry_assembly set.
23313         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
23314         Add a 'resource_modules' argument.
23315         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
23317         * reflection.c (mono_reflection_create_runtime_class): Move setting
23318         of wastypebuilder here, so mono_get_type_object () returns a MonoType
23319         for enums too.
23321         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
23322         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
23323         Throw an ArgumentNullException if 'ptr' is null.
23325         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
23326         assemblies here. Fixes #69020.
23328 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
23330         * reflection.c (build_compressed_metadata): Fix the previous patch for
23331         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
23332         the stack.
23334 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
23336         * assembly.c (mono_assembly_names_equal): Allow a match if one of
23337         the cultures is false. Fixes #69090.
23339         * reflection.c (build_compressed_metadata): Fix invalid memory read 
23340         detected by valgrind.
23341         
23342         * reflection.c (mono_reflection_get_type): Avoid triggering a 
23343         TypeResolve multiple times for the same type. Fixes #65577.
23345 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
23347         * marshal.c: Avoid using ldftn to call managed functions. It is
23348         much slower than just a call.
23350         * reflection.c (mono_module_get_object): free the basename we
23351         allocate here from glib.
23352         
23353         * reflection.c (ensure_runtime_vtable): make sure to free
23354         overrides.  Also, we were allocating an array of MonoMethod not an
23355         array of MonoMethod*.
23357         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
23359         * image.c (mono_image_close): free image->guid here.
23361 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
23363         * reflection.c: Fix some spec conformance issues with the PE file
23364         structures so mcs compiled apps run on the Net 2.0 beta.
23366 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
23368         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
23369         Implement this. Fixes #67264.
23371         * debug-helpers.h debug-helpers.c marshal.c: Move 
23372         mono_find_method_by_name to debug-helpers.c.
23374 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
23376         * object.c (mono_release_type_locks): type_initialization_hash is
23377         a GHashTable.
23379         * reflection.c object.c object-internals.h: Fix warnings.
23381         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
23382         without accessors. Fixes #61561.
23384         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
23385         application base from the root domain if not set. Fixes #65641.
23386         (mono_runtime_init): Fix warning.
23388 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23390         * appdomain.c: call mono_thread_pool_init.
23391         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
23392         of worker threads based on the number of CPUs and the environment
23393         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
23394         for non-windows (windows) systems.
23396 2004-10-27  Chris Toshok  <toshok@ximian.com>
23398         * mono-debug-debugger.c (write_class): don't call mono_class_init
23399         here, as even with the check for (!klass->init_pending), we get
23400         into a situation where we're hitting cycles in class
23401         initialization.  Fixes #68816.
23403 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
23405         * image.c: Avoid overwriting values in the loaded_images_hash when an
23406         assembly is loaded multiple times. Fixes #61152.
23408         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
23409         so multiple satellite assemblies for the same name can be loaded.
23410         Fixes #68259.
23412         * mono_domain_assembly_preload: Actually return the loaded assembly, 
23413         not NULL.
23415         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
23416         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
23418         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
23419         pending finalizers are not invoked after the appdomain has been 
23420         unloaded. Fixes #67862.
23422 2004-10-22  Martin Baulig  <martin@ximian.com>
23424         * mono-debug-debugger.c
23425         (mono_debugger_runtime_invoke): Don't box valuetypes.
23427 2004-10-22  Chris Toshok  <toshok@ximian.com>
23429         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
23430         don't hide private methods.
23432 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
23434         * icall.c: Allows the runtime to "share" (when known) the public key
23435         token of an assembly. This avoid the need to recalculate the token 
23436         (from the public key) in managed code.
23438 2004-10-21  Chris Toshok  <toshok@ximian.com>
23440         * debug-helpers.c (append_class_name): argh, revert last patch.
23441         
23442 2004-10-21  Chris Toshok  <toshok@ximian.com>
23444         * debug-helpers.c (append_class_name): use '+' as the delimiter,
23445         not '/', so that it matches what the debugger uses to look up
23446         methods.
23448 2004-10-21  Martin Baulig  <martin@ximian.com>
23450         * mono-debug-debugger.c (mono_debugger_throw_exception): New
23451         public method; this is called each time an exception is thrown and
23452         allows the debugger to use exception catch points.
23454 2004-10-21  Martin Baulig  <martin@ximian.com>
23456         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
23457         the stack pointer and the exception object in some struct and pass
23458         that to the debugger.
23460 2004-10-21  Chris Toshok  <toshok@ximian.com>
23462         * mono-debug-debugger.c (do_write_class): add instance/static
23463         event support.  We don't expose "raise" or "other" yet.
23464         (event_is_static): new method.
23466 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
23468         * mono-debug-debugger.c
23469         (mono_debugger_handle_exception): Remove
23470         bogus return value for fussy compilers.
23472 2004-10-20  Martin Baulig  <martin@ximian.com>
23474         * mono-debug-debugger.c
23475         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
23476         (mono_debugger_handled_exception): Likewise.
23478 2004-10-20  Martin Baulig  <martin@ximian.com>
23480         * mono-debug-debugger.h (MonoDebuggerEvent): Added
23481         MONO_DEBUGGER_EVENT_EXCEPTION.
23483         * mono-debug-debugger.c (mono_debugger_handle_exception): New
23484         public function to send the debugger a notification for an
23485         exception and inform it about a catch/finally clause.
23487 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
23489         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
23490         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
23491         fix 2.95 build. 
23493         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
23495 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
23497         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
23498         marshalled as [In,Out]. Fixes #58325.
23500 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
23502         * reflection.c (mono_method_body_get_object): Implement some fields.
23504 2004-10-12  Martin Baulig  <martin@ximian.com>
23506         * reflection.c (mono_reflection_bind_generic_parameters): Small
23507         fix, correctly retrieve our parent from a generic instance.
23509 2004-10-12  Martin Baulig  <martin@ximian.com>
23511         * metadata.c (mono_metadata_generic_param_equal): We always have
23512         an owner.
23514         * class.c
23515         (mono_class_from_generic_parameter): We need to have an owner.
23516         (my_mono_class_from_generic_parameter): Likewise.
23518         * reflection.c (mono_reflection_setup_generic_class): Renamed to
23519         mono_reflection_create_generic_class() and added a new
23520         mono_reflection_setup_generic_class().  
23521         (mono_reflection_initialize_generic_param): If we're a nested
23522         generic type and inherited from the containing class, set our
23523         owner to the outer class.
23525 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
23527         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
23529         * reflection.c (mono_method_body_get_object): New function to create
23530         a MethodBody object.
23532         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
23534 2004-10-11  Martin Baulig  <martin@ximian.com>
23536         * metadata.c (_mono_metadata_type_equal): Renamed to
23537         do_mono_metadata_type_equal() and made static.
23539 2004-10-11  Martin Baulig  <martin@ximian.com>
23541         * appdomain.c: Bump corlib version number to 28.
23543 2004-10-10  Martin Baulig  <martin@ximian.com>
23545         * class-internals.h
23546         (MonoGenericInst): Added `MonoGenericContainer *container'.
23547         (MonoGenericMethod): Likewise.
23548         (MonoGenericContext): Likewise.
23549         (MonoGenericParam): Added `MonoGenericContainer *owner'.
23551         * metadata.c
23552         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
23553         (do_mono_metadata_parse_generic_inst): Likewise.
23554         (mono_metadata_parse_type_full): New public method.  This is the actual
23555         mono_metadata_parse_type() implementation - with an additional
23556         `MonoGenericContainer *' argument.
23557         (mono_metadata_parse_array_full): Likewise.
23558         (mono_metadata_parse_signature_full): Likewise.
23559         (mono_metadata_parse_method_signature_full): Likewise.
23560         (mono_metadata_parse_mh_full): Likewise.
23561         (mono_type_create_from_typespec): Likewise.
23562         (mono_metadata_interfaces_from_typedef_full): New public method;
23563         this is similar to the other _full() methods, but we take a
23564         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
23565         (mono_metadata_parse_generic_param): Take an additional
23566         `MonoGenericContainer *' argument and lookup the MonoGenericParam
23567         from that container.
23568         (mono_metadata_generic_param_equal): New static method to compare
23569         two type parameters.
23570         (_mono_metadata_type_equal): New static method; takes an
23571         additional `gboolean signature_only' argument - if true, we don't
23572         compare the owners of generic parameters.
23573         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
23574         with a TRUE argument - do a signature-only comparision.
23576         * loader.c: Use the new _full() methods and pass the
23577         MonoGenericContainer to them.
23579         * object-internals.h (MonoReflectionTypeBuilder): Added
23580         `MonoGenericContainer *generic_container' field.
23581         (MonoReflectionMethodBuilder): Likewise.
23583 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
23585         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
23586         case initial images of dynamic assemblies.
23588         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
23590         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
23592         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
23593         length of event->other array.
23594         (typebuilder_setup_events): Ditto.
23596         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
23597         'assembly_by_name' and add an 'assemblies' list.
23599         * assembly.h assembly.c: Add a new search hook for determining whenever
23600         an assembly is already loaded. Use this instead of searching in the
23601         loaded_assemblies list.
23603         * domain.c appdomain.c: Implement the new search hook so loaded 
23604         assemblies are now scoped by appdomain. Fixes #67727.
23606 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
23608         * threads.c (mono_thread_attach): Initialize synch_lock field so
23609         mono_thread_detach works again.
23611         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
23612         'lib' too. Fixes #63130.
23614 2004-10-06  Jackson Harper  <jackson@ximian.com>
23616         * culture-info-tables.h: regenerated.
23618 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
23620         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
23621         implemented by other interfaces in the result. Fixes #65764.
23622         
23623         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
23624         Handle unloadable modules without crashing.
23626         * image.c (load_modules): Revert the previous patch since modules must
23627         have a fixed index inside the array.
23628         
23629         * image.c (load_modules): Don't include native modules in the modules
23630         array.
23632 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
23634         * reflection.h: Add param_defaults field.
23636         * reflection.c: Add support for parameter defaults in dynamic methods.
23637         Fixes #64595.
23639         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
23640         an empty string when a type has no namespace. Fixes #64230.
23642 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
23644         * tabledefs.h: Added "internal" security actions to support non-CAS
23645         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
23646         Note: they do not seems to be used anymore in 2.0 (new metadata format)
23648 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
23650         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
23651         constructor of abstract class. Fixes #61689.
23653 2004-10-04  Martin Baulig  <martin@ximian.com>
23655         * class-internals.h (MonoGenericContainer): New type.
23656         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
23657         `MonoGenericContainer *generic_container'.
23658         (MonoClass): Replaced `gen_params' and `num_gen_params' with
23659         `MonoGenericContainer *generic_container'.
23661         * metadata.c (mono_metadata_load_generic_params): Return a
23662         `MonoGenericContainer *' instead of a `MonoGenericParam *';
23663         removed the `num' argument.
23665 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
23667         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
23668         for dynamic images.
23670         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
23671         machine fields.
23673         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
23675         * reflection.c: Save pe_kind and machine values into the generated
23676         image file.
23678         * appdomain.c: Bump corlib version number.
23680         * object-internals.h: Reorganize layout of LocalBuilder.
23682         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
23683         New helper function.
23685         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
23686         created MonoType for dynamic types. Fixes #66180.
23688 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
23690         * threadpool.c: the ares hashtable needs a critical section around it.
23691         this prevents some nasty segfaults
23693 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
23695         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
23696         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
23697         bug 67324).
23698         
23699 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
23701         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
23702         
23703 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
23705         * image.c: Always canonicalize image file names, to avoid loading
23706         the same assembly twice when referenced using a relative path.
23708 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
23710         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
23712         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
23714         * marshal.c: Fix warnings.
23716 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
23718         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
23719         attempting to marshal the delegate_trampoline as the method_addr.
23720         This patch has a static hashtable of marshalled delegates so that 
23721         we can map delegate_trampoline addresses back to delegates.  This
23722         allows a delegate passed to managed code to be passed back into native
23723         code.  Fixes #67039
23725 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
23727         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
23729         * reflection.c (method_encode_code): Align method headers properly.
23730         Fixes #66025.
23732 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
23734         * marshal.c: In the runtime invoke wrapper, reset the abort
23735         exception if it is cached. This avoids the automatic rethrowal of 
23736         the exception after the catch of the wrapper. Also check for pending
23737         interruptions before calling the managed method. This is done using
23738         the new method emit_thread_force_interrupt_checkpoint, since the
23739         normal checkpoint method is ignored when running the invoke wrapper.
23740         * object.c: If the abort exception is rethrown, set the abort_exc
23741         field of the thread, so it will be rethrown aftere every catch.
23742         * threadpool.c: Only run an interruption checkpoint if what has been
23743         requested is a stop of the thread (aborts will be ignored).
23744         * threads.c: By default, a thread will now never be interrumped while
23745         running the runtime invoke wrapper (this ensures that runtime_invoke
23746         will always return to the caller if an exception pointer is provided).
23747         There is a new special method mono_thread_force_interruption_checkpoint()
23748         to force an interruption checkpoint even if running a protected
23749         wrapper, which is used by the same runtime invoke wrapper to do a check
23750         at a safe point.
23752 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
23754         * object.c, object-internals.h: Implemented mono_release_type_locks,
23755         which releases the cctor locks held by a thread.
23756         * threads.c, threads.h: In thread_cleanup, release cctor locks held
23757         by a thread. Added mono_thread_exit() method to be used to safely stop
23758         a thread.
23760 2004-09-28  Raja R Harinath  <rharinath@novell.com>
23762         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
23763         Move null check before dereference.  Avoid indexing beyond the end
23764         of the 'modules' array.
23766 2004-09-28  Raja R Harinath  <rharinath@novell.com>
23768         * metadata-internals.h (MonoImage): Add module_count field.
23769         * image.c (load_modules): Set image->module_count.
23770         (mono_image_load_file_for_image): Use image->module_count.
23771         * reflection.c (mono_image_load_module): Append to image->modules array 
23772         of dynamic assembly.
23773         (mono_module_get_object): Fix loop to actually increment index.
23774         Use image->module_count.
23775         * assembly.c (mono_assembly_load_references): Use image->module_count.
23776         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
23777         Likewise.
23779 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
23781         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
23782         Avoid assert on generic types.
23784 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
23786         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
23788         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
23790         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
23791         function to convert a MarshalSpec structure to its managed counterpart.
23793         * reflection.c: Fix warnings.
23794         
23795         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
23796         field.
23798         * icall.c (mono_create_icall_signature): Fix build.
23800 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
23802         * icall.c: Add MakePointType icall.
23804         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
23805         warnings.
23807 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23809         * threadpool.c: reuse allocated slots in the queue.
23811 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
23813         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
23815         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
23817         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
23818         previous change.
23820         * tabledefs.h: Add constants for pinvoke attributes BestFit and
23821         ThrowOnUnmappableChar.
23823         * icall.c (ves_icall_Type_GetPacking): New icall.
23825 2004-09-24  Martin Baulig  <martin@ximian.com>
23827         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
23829 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23831         * appdomain.c:
23832         (mono_domain_set): allow setting a domain that is being unloaded.
23833         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
23834         being unloaded.
23836 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
23838         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
23839         the GetCustomAttributes icall.
23841 2004-09-23  Martin Baulig  <martin@ximian.com>
23843         * object-internals.h (MonoReflectionGenericParam): Replaced
23844         'has_ctor_constraint', `has_reference_type' and `has_value_type'
23845         with `guint32 attrs'.
23847 2004-09-23  Martin Baulig  <martin@ximian.com>
23849         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
23851 2004-09-23  Martin Baulig  <martin@ximian.com>
23853         * object-internals.h (GenericParameterAttributes): New enum.
23855 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
23857         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
23858         
23859         * class.c (init_events): Fill out event->other field.
23861         * class.c: Fix warnings.
23863         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
23865 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
23867         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
23868         walk which doesn't supply the IL offset.
23870 2004-09-22  Martin Baulig  <martin@ximian.com>
23872         * reflection.c (mono_reflection_setup_internal_class): If we're
23873         System.ValueType, System.Object or System.Enum, set
23874         `klass->instance_size' and create the vtable.
23875         (mono_reflection_create_internal_class): If we're an enum type,
23876         get the base class from our current corlib.
23878 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
23880         * reflection.h (MonoResolveTokenError): New type.
23882         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
23883         icall.
23885         * icall.c: Add an 'error' argument to the ResolveToken icalls.
23887 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
23889         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
23890         Support also calling constructors, but only for already allocated objects.
23892 2004-09-17  Geoff Norton <gnorton@customerdna.com>
23894         * reflection.c (type_get_qualified_name): If the klass is null
23895         return the typename to avoid a NullRefEx.
23896         (encode_cattr_value): Get the qualified name of the boxed type,
23897         not the underlying enumtype.  Fixes #62984.
23899 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
23901         * marshal.c: Fix problems with previous checkin.
23903 2004-09-21    <vargaz@freemail.hu>
23905         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
23906         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
23908         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
23910 2004-09-21  Geoff Norton <gnorton@customerdna.com>
23912         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
23913         should only return a type for pointers, arrays, and passbyref types.
23914         Fixes bug #63841.
23916 2004-09-21  Martin Baulig  <martin@ximian.com>
23918         * domain.c (mono_debugger_check_runtime_version): New public
23919         function.
23921         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
23923 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
23925         * reflection.c: Added missing sort to the declarative security 
23926         attributes table. MS implementation stops seeing the attributes if the
23927         token number regress in the table (as shown by ildasm and permview).
23929 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
23931         * object-internals.h (MonoReflectionModule): Add 'token' field.
23932         
23933         * reflection.c (mono_reflection_get_token): Add support for Module
23934         and Assembly.
23935         (mono_module_get_object): Set 'token' field.
23936         (mono_module_file_get_object): Set 'token' field.
23938         * icall.c: Add new Assembly and Module icalls.
23940         * appdomain.c: Bump corlib version.
23942 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
23944         * loader.h loader.c class.h class.c: Add helper functions for obtaining
23945         tokens of metadata objects.
23947         * reflection.h reflection.c (mono_reflection_get_token): New function
23948         to obtain the token of a metadata object.
23950         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
23952 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
23954         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
23955         
23956         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
23958 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
23960         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
23961         * object-internals.h: Added 3 MonoArray* members to MonoReflection
23962         AssemblyBuilder to access the permissions set in the class lib.
23963         * reflection.c: Added security attributes encoding step in 
23964         mono_image_build_metadata.
23965         * tabledefs.h: Added new security actions defined in 2.0:
23966         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
23968 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
23970         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
23971         macro parameter.
23973 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
23975         * locales.c: nullify the ICU_collator member of CompareInfo when it is
23976           finalized. There where random SIGSEVs at program termination, when
23977           an object being finalized was trying to do a string comparison and
23978           the current culture was already finalized.
23980 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23982         * threads.c: call thread_cleanup before finishing the thread if we get
23983         there.
23985 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
23987         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
23988         assemblies from the parent. Fixes #65665.
23990 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
23992         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
23993         modifiers.
23995 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
23997         * reflection.h: add prototype for mono_get_dbnull_object
23998         * reflection.c: add prototypes for get_default_param_value_blobs 
23999         and mono_get_object_from_blob for fussier compilers
24001 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
24003         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
24004         false deadlock checks in class initialization.
24006 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
24008         * image.c (mono_image_addref): Fix comment.
24010         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
24011         possible.
24013 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
24015         * reflection.c (mono_param_get_objects): Modified to return
24016         ParameterInfo.DefaultValue object.
24018         (get_default_param_value_blobs):
24019         (mono_get_object_from_blob):
24020         (mono_get_dbnull_object): New helper routines. 
24022         * object.c (mono_get_constant_value_from_blob): New helper routine
24023         carved out from get_default_field_value ()
24025         * object-internals.h (mono_get_constant_value_from_blob): Added
24026         function declaration.
24028 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
24030         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
24031         referenced assemblies. Fixes #62135.
24033         * exception.h exception.c (mono_get_exception_file_not_found2): New
24034         helper function.
24036 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
24038         * class.h class.c: Add mono_type_get_underlying_type ().
24040 2004-09-09  Geoff Norton <gnorton@customerndna.com>
24042         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
24043         Fix GetTypes() to support dynamically created assemblies.
24045 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
24047         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
24048         
24049         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
24050         previous patch.
24052         * reflection.h reflection.c loader.c: Allow dynamic construction of
24053         pinvoke methods. Fixes #65571.
24054         
24055         * reflection.c (mono_reflection_get_type): Revert previous change since
24056         it causes regressions.
24058 2004-09-08  Martin Baulig  <martin@ximian.com>
24060         * class.c (class_compute_field_layout): Don't call
24061         mono_class_layout_fields() for open generic instances.
24063 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
24064         * threads.c appdomain.c: fix typo in GC macro
24066 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24068         * threads.c: don't call mono_thread_detach() in start_wrapper(),
24069         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
24071 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
24073         * image.c (mono_image_close): Applied patch from 
24074         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
24075         assembly is loaded multiple times from data.
24076         
24077         * image.c (mono_image_open): Fix warning.
24079 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
24081         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
24082         once. Fixes #58334.
24083         
24084         * reflection.c (mono_reflection_create_runtime_class): Initialize
24085         klass->nested_classes. Fixes #61224.
24087 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
24089         * threads.c: sched_yield() on exit, to allow threads to quit.
24091 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
24093         * object.c (mono_unhandled_exception): Remove leftover debug code.
24095 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
24097         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
24099 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
24101         * marshal.c (emit_marshal_array): Really null terminate string arrays.
24102         
24103         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
24105 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
24107         * marshal.c (emit_marshal_array): Null terminate string arrays.
24108         
24109         * marshal.c (raise_auto_layout_exception): Fix warning.
24111         * reflection.c (mono_param_get_objects): Initialize the default value
24112         with DBNull.Value, not null. Fixes #62123.
24114 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
24116         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
24117         throw an exception with a cute explanation.
24119 2004-09-06  Dick Porter  <dick@ximian.com>
24121         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
24122         Close the new process's thread handle, as we don't use it.  The
24123         handle stays around forever otherwise.
24125 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
24127         * object.c (arith_overflow): Fix warning.
24129         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
24130         calling conventions in method refs. Fixes #65352.
24132         * reflection.c: Fix warnings.
24134 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
24136         * icall.c: Add a new icall for Array.Clear
24138 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
24140         * object.c: When allocating an array, we have to throw
24141         an overflow exception if any of the lengths are < 0.
24143 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
24145         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
24146         properly. Also move implementation of string array marshalling to 
24147         managed code. Fixes #42316.
24149 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24151         * assembly.c: provide more information when loading an assembly fails.
24153 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24155         * filewatcher.c: don't expect the development fam package to be
24156         installed.
24158 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
24160         * marshal.c: Make a copy of the signature cookie since it will be
24161         freed by the caller.
24162         
24163         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
24165         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
24167         * metadata.c (mono_metadata_free_marshal_spec): New function to free
24168         marshal specs.
24170         * marshal.c: More refactoring.
24171         
24172         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
24173         smaller functions.
24175 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
24177         * object.c: In mono_message_invoke, fill the output parameter array after
24178           calling the managed method (it was done before the call). This fixes
24179           bug #59299.
24181 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
24183         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
24184         as well.
24186 2004-09-02  Martin Baulig  <martin@ximian.com>
24188         * class.c (mono_class_instance_size): Don't allow generic type
24189         definitions or open generic instances.
24190         (mono_class_array_element_size): If we're a value type, call
24191         mono_class_instance_size() on the original class.
24193         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
24194         handle generic instances.
24196         * mono-debug-debugger.c (write_type): Handle generic instances
24197         like classes.
24199 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
24201         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
24202         the allocation request fails. Fixes #65089.
24204         * object.c (mono_runtime_free_method): Do not call mono_free_method.
24205         
24206         * object.c (mono_runtime_free_method): New function to free a dynamic
24207         method.
24209         * marshal.c (mono_delegate_free_ftnptr): New function to free the
24210         delegate trampoline.
24212         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
24213         with hasthis as dynamic,
24215         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
24217         * domain.c (mono_jit_info_table_remove): New function to remove an
24218         entry from the jit info table.
24220         * class-internals.h (MonoMethod): Add 'dynamic' field.
24222         * loader.c: Fix warnings.
24224 2004-09-01  Martin Baulig  <martin@ximian.com>
24226         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
24227         instead of mono_debugger_lock() because the latter one is a no-op
24228         unless running in the debugger.
24230 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
24232         * class.c (class_compute_field_layout): Classes with auto-layout or
24233         reference fields are not blittable.
24234         
24235 2004-09-01  Dick Porter  <dick@ximian.com>
24237         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
24238         mono_image_get_filename() to get the assembly location.
24240         * icall.c:
24241         * metadata.h: Fix compile warnings
24243 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
24245         * class.c (class_compute_field_layout): System.Object is blittable.
24247         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
24248         as in/out. Fixes #59909.
24250 2004-09-01  Martin Baulig  <martin@ximian.com>
24252         * metadata.h (MONO_TYPE_ISREFERENCE): Call
24253         mono_metadata_generic_inst_is_valuetype() if we're a generic
24254         instance to check whether our underlying type is a reference type.
24256 2004-09-01  Martin Baulig  <martin@ximian.com>
24258         * metadata.c (mono_type_size): If we're a generic instance, call
24259         mono_class_value_size() for value types.
24261 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
24263         * marshal.c: Implement more custom marshalling functionality. Fixes
24264         #64915.
24266 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
24268         * mono-debug.c, debug-mono-symfile.c: add some locking love.
24270 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
24272         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
24274         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
24276         * icall.c: Fix some warnings.
24278         * threads.c (abort_appdomain_thread): Fix unref errors.
24279         (mono_thread_current): Fix THREAD_DEBUG define.
24281 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
24283         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
24285         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
24287 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
24289         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
24290         string arrays.
24292 2004-08-28  Martin Baulig  <martin@ximian.com>
24294         * metadata.c
24295         (mono_metadata_generic_inst_is_valuetype): New public function.
24297         * metadata.h (MONO_TYPE_ISSTRUCT): Call
24298         mono_metadata_generic_inst_is_valuetype() if we're a generic
24299         instance to check whether our underlying type is a valuetype.
24301 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
24303         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
24304         #63768.
24306 2004-08-25  Martin Baulig  <martin@ximian.com>
24308         * loader.c (mono_get_method_from_token): Abstract methods can also
24309         be generic and thus have type parameters.
24311         * metadata-internals.h
24312         (MonoDynamicImage): Added `GPtrArray *gen_params'.
24314         * reflection.c (mono_image_get_generic_param_info): Don't create a
24315         metadata row, just add an entry to the `gen_params' array.
24316         (build_compressed_metadata): Sort the `gen_params' array and then
24317         actually create the metadata.
24319 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24321         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
24323 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
24325         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
24327 2004-08-24  Martin Baulig  <martin@ximian.com>
24329         * class.cs (mono_class_is_subclass_of): Like an interface, a
24330         generic instance also derives from System.Object.
24332 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
24334         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
24335         custom modifiers to be in any order. Fixes #61990.
24337 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
24339         * object.c: Register mono_object_new_fast icall.
24340         
24341         * object.c (mono_class_get_allocation_ftn): Return to calling
24342         mono_object_new_fast, since it seems faster to compute the object 
24343         size in unmanaged code than passing it as a parameter.
24345         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
24347         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
24348         this function with Boehm as the oom handler, so we don't have to check
24349         the result of GC_malloc.
24351         * object.c: Remove checks for oom.
24353         * object.h object.c (mono_class_get_allocation_ftn): New function to
24354         return the icall which can be used to allocate an instance of a given
24355         class. 
24357         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
24359         * class-internals.h: Add 'enabled' field.
24361 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
24363         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
24365 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
24366         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
24367         value 0x0010.
24369 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
24371         * appdomain.c: use the Tls function for appdomain too,
24372         at Zoltan's request. Actually return in mono_context_get
24374         * appdomain.c, profiler.c, threads.c: use __thread
24376 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
24378         * appdomain.c threads.c: Call GC_CreateThread on windows.
24380         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
24381         multiple libraries since this don't work on windows.
24383 2004-08-18  Martin Baulig  <martin@ximian.com>
24385         * class-internals.h
24386         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
24387         MonoMethodHeader.
24389         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
24390         MonoMethodNormal since we also need it for abstract and interface
24391         methods.
24393         * reflection.c
24394         (build_compressed_metadata): Sort the GenericParam table.
24395         (mono_image_create_token): Added `gboolean create_methodspec'
24396         argument; this is false when generating a MethodImpl token.
24397         (reflection_methodbuilder_to_mono_method): Abstract and interface
24398         methods may also have generic parameters.
24400 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
24402         * appdomain.c: thread local alloc
24404 2004-08-17  Martin Baulig  <martin@ximian.com>
24406         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
24408         * icall.c
24409         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
24410         argument.
24412         * class.c (mono_type_get_full_name): New public function.
24413         (mono_type_get_name): Don't include the type arguments.
24415 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
24417         * Makefile.am: Build static versions of libmetadata and libmonoruntime
24418         for inclusion into the mono executable.
24420 2004-08-16  Martin Baulig  <martin@ximian.com>
24422         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
24423         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
24425 2004-08-14  Martin Baulig  <martin@ximian.com>
24427         * class.c (dup_type): Also copy the `byref' field.
24429 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
24431         * reflection.c (create_dynamic_mono_image): Revert the last change 
24432         since it breaks bootstrap.
24434 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
24436         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
24438         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
24439         not free them with g_free.
24441 2004-08-11  Martin Baulig  <martin@ximian.com>
24443         * reflection.c (mono_reflection_setup_internal_class): Also call
24444         mono_class_setup_mono_type() if we already have a `tb->type.type'.
24446 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
24448         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
24449         called during default (first) AppDomain creation. Keep track of
24450         Evidence when loading assemblies.
24452 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
24454         * opcodes.c, opcodes.h: reduce runtime relocations.
24456 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
24458         * culture-info.h, locales.c: fixes and chages to sue the new
24459         optimized format of the locale data.
24460         * culture-info-tables.h: regenerated.
24462 2004-08-06  Geoff Norton <gnorton@customerdna.com>
24463         
24464         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
24466 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
24468         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
24469         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
24470         * domain-internals.h: icall declaration.
24471         * icall.c: icall registration.
24472         * object-internals.h: New fields in MonoAssembly for CAS.
24474 2004-08-05  Duncan Mak  <duncan@ximian.com>
24476         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
24477         CEE_LDELEM_ANY.
24479 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
24481         * reflection.c: fix to deal with object[] arrays in custom ctors
24482         (bug #62550).
24484 2004-08-05  Martin Baulig  <martin@ximian.com>
24486         * class.c (mono_class_array_element_size): Added support for
24487         generic instances and correctly handle "recursive" types.
24489 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
24491         * assembly.c: Fix warnings.
24493 2004-08-04  Martin Baulig  <martin@ximian.com>
24495         * class.c
24496         (mono_type_get_name_recurse): Added `gboolean include_arity'
24497         argument specifying whether or not we should include the generic
24498         arity in the type name.
24499         (_mono_type_get_name): New static function.
24500         (mono_class_setup_vtable): If we're a generic instance, don't
24501         include the generic arity in the names of explicit method
24502         implementations.        
24504 2004-08-03  Martin Baulig  <martin@ximian.com>
24506         * class.c (mono_type_get_name_recurse): Enclose the generic type
24507         arguments in `<', '>'.
24509 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24511         * gc.c: make GC warning messages use the trace API, they are just
24512         noise to most of the users.
24514 2004-08-03  Martin Baulig  <martin@ximian.com>
24516         * debug-mono-symfile.c (read_string): Correctly read the string.
24518 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
24520         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
24521         
24522         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
24523         icalls.
24524         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
24526 2004-07-30  Martin Baulig  <martin@ximian.com>
24528         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
24529         Reflect latest symbol writer changes.   
24531 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
24533         * object.c: always create an object if null is passed
24534         to Invoke() where a valuetype is expected.
24536 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
24538         * marshal.c (mono_marshal_init): make managed
24539         signatures match native ones better for 64bits.
24541 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24543         * appdomain.c: hack to build correctly the private bin path on windows.
24544         Fixes bug #61991.
24546 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
24548         * assembly.c: Load mscorlib from the correct framework directory
24549           (mono/<version>/mscorlib.dll).
24550         * appdomain.h: Added prototypes for new functions.
24551         * internals.h: Added some prototypes.
24552         * domain.c: When initializing the runtime, get from the executable and
24553           the configuration files the runtime version that the app supports.
24554           Added support methods for reading app.exe.config. Added list of versions
24555           supported by the JIT. Added two new methods: mono_init_from_assembly,
24556           which initializes the runtime and determines the required version from
24557           the provided exe file, and mono_init_version, which initializes
24558           the runtime using the provided version.
24559         * icall.c: Get machine.config from version-specific directory.
24560         * reflection.c: When generating an image, embed the version number
24561           of the current runtime.
24563 2004-07-28  Dick Porter  <dick@ximian.com>
24565         * socket-io.c
24566         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
24567         returned sockaddr size before creating the remote address object.
24568         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
24569         61608.
24571 2004-07-28  Dick Porter  <dick@ximian.com>
24573         * locales.c (string_invariant_compare_char): Fix invariant char
24574         compares between upper and lower cases.  Fixes bug 61458.
24576 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
24577         
24578         * marshal.c: actually cache stelem.ref wrappers.
24579         
24580 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
24582         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
24583         sections and remove the mono_cli_rva_map () function.
24585 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
24587         * debug-mono-symfile.c: fix one more endianess issue, from a patch
24588         by Geoff Norton (<gnorton@customerdna.com>).
24590 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24592         * class.c: fix class loads for pointer types (typeof(int) !=
24593         typeof(int*)).
24595 2004-07-27  Martin Baulig  <martin@ximian.com>
24597         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
24598         reading the debugging information from an external ".mdb" file.
24600 2004-07-24  Martin Baulig  <martin@ximian.com>
24602         * reflection.c (mono_image_get_type_info): Only write a class
24603         layout entry if we actually have a size or a packing size.
24605 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
24607         * reflection.c (type_get_fully_qualified_name): 
24608         insert cast to get type checking of ?: with non-gcc compilers
24610 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
24612         * rand.c: use g_getenv for both lookups of
24613         MONO_EGD_SOCKET
24615 2004-07-17  Martin Baulig  <martin@ximian.com>
24617         * reflection.c (mono_reflection_bind_generic_method_parameters):
24618         Set `gmethod->reflection_info'.
24620 2004-07-17  Martin Baulig  <martin@ximian.com>
24622         * class.c (mono_class_create_from_typedef): Insert the newly
24623         created class into the hash table before computing the interfaces
24624         since we could be called recursively.
24626 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
24628         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
24629         function to implement stelem.ref in managed code
24630         * class-internals.h, debug-helpers.c: a new wrapper type
24631         for the above.
24633 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
24635         * gc.c: allow GC handles to work even when no GC is compiled in.
24636         Fix part of bug #61134 (GetAddrOfPinnedObject).
24638 2004-07-13  Peter Williams  <peter@newton.cx>
24640         * process.c (complete_path): Make sure we don't attempt to execute
24641         directories.
24643 2004-07-12  Geoff Norton <gnorton@customerdna.com>
24645         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
24646           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
24647           and will add/subtract the hour if needed
24649 2004-07-12  Martin Baulig  <martin@ximian.com>
24651         * reflection.c (mono_field_get_object): If we have
24652         `field->generic_info', take the attributes from
24653         `field->generic_info->generic_type'.    
24655 2004-07-12  Martin Baulig  <martin@ximian.com>
24657         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
24658         This function must be called before initializing the runtime.
24659         (mono_debug_init_1): New function; call this after initializing
24660         the runtime, but before loading the assembly.  It tells the
24661         debugger to load corlib and the builtin types.
24663         * mono-debug-debugger.c: Did some larger changes in the debugging
24664         code; support recursive class declarations, make sure we actually
24665         add all classes.
24667 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24669         * debug-helpers.c: undo my previous patch and fixed the real issue in
24670         ../mini/exceptions-x86.c
24672 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24674         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
24675         when no HOME env. variable was set and a NullRef was thrown in a .cctor
24676         called from other .cctors.
24678 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
24680         * loader.c: Removed the mono_loader_wine_init hack now that we are
24681         doing a managed version of Windows.Forms.
24683 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
24685         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
24686         threadpool.c, threads.c: remove static data from rootset.
24688 2004-07-09  Dick Porter  <dick@ximian.com>
24690         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
24691         Don't do any more processing if the matched length was 0.  It was
24692         increasing the size of the string before.  Fixes bug 61167.
24694 2004-07-09  Dick Porter  <dick@ximian.com>
24696         * socket-io.h:
24697         * socket-io.c
24698         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
24699         Add support for SO_PEERCRED if its available.
24701 2004-07-09  Peter Bartok <pbartok@novell.com>
24702         * loader.c: winelib.exe.so error message is now only displayed if
24703         MONO_DEBUG is set. To help us avoid questions when people are trying
24704         out the new Managed.Windows.Forms.
24706 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
24708         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
24709         for isinst and castclass wrappers.
24711         * class-internals.h icall.c: Move registration and lookup of JIT icalls
24712         to libmetadata from the JIT, so they could be used by the marshalling
24713         code and the interpreter.
24715         * marshal.c: Register marshalling related JIT icalls here instead of
24716         in mini.c. Use CEE_MONO_ICALL instead of the family of 
24717         CEE_MONO_PROC<x> opcodes to call marshalling functions.
24719         * metadata.h: Remove unneeded marshalling conversions.
24721         * opcodes.c: Update for new opcodes.
24722         
24723 2004-07-08  Martin Baulig  <martin@ximian.com>
24725         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
24726         (mono_debug_get_domain_data): Make this function static.
24728 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
24730         * gc.c, object.h: add nice GC handle API for embedders.
24732 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
24734         * reflection.c: more changes for the new api
24736         * object.c: When we reflect on a field w/ a constant value, it
24737         will not have a memory location, so we must access metadata. Also,
24738         allow easier reading of strings so that we can read them from
24739         the constant data.
24741         * class.c (mono_class_layout_fields): no need for literal fields here.
24743         * class-internals.h: api changes for const fields
24745         * icall.c (ves_icall_get_enum_info): use new apis for const fields
24747 2004-07-06  Martin Baulig  <martin@ximian.com>
24749         * mono-debug.h: Increment version number to 44.
24751         * mono-debug.c (mono_debug_add_wrapper): The second argument is
24752         now a gpointer, rewrote this whole method.
24754         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
24755         function.  Add information about the wrapper in a new "misc table".
24757         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
24758         for the new misc table.
24760 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
24762         * metadata-internals.h image.c: Add a cache for helper signatures.
24764         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
24766 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
24768         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
24769         delegates from a delegate. Fixes #61033.
24770         
24771         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
24772         marshalling of stringbuilder arrays. Fixes #59900.
24774 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
24776         * icall.c: Add EnumBuilder:setup_enum_type icall.
24778 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
24780         * icall.c: Added a new icall for the property version of
24781         OffsetOfStringData.
24783 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
24785         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
24786         it has a constant size across platforms.
24788         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
24789         stack trace.
24791 2004-06-29  Martin Baulig  <martin@ximian.com>
24793         * mono-debug.c (mono_debug_add_method): Protect the whole function
24794         in mono_debugger_lock(), not just parts of it.
24796 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
24798         * reflection.c: make sure padding bytes in heaps are zeroed.
24800 2004-06-24  David Waite  <mass@akuma.org>
24802         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
24803         image.c, loader.c, locales.c, marshal.c, metadata.c,
24804         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
24805         string-icalls.c, threads.c: change to C90-style comments from C99 /
24806         C++ -style
24808 2004-06-24  Dick Porter  <dick@ximian.com>
24810         * threads.c
24811         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
24812         return createdNew.  Fixes bug 60412.
24814         * threads-types.h: 
24815         * icall.c: Add createdNew parameter to CreateMutex icall
24817 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
24819         * reflection.c, object-internals.h: save default value in params.
24821 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24823         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
24824         no need to build a new path combining that with the application base.
24825         Fixes bug #60442.
24827 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
24829         * reflection.c: fixed minor standard compliance issues.
24831 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
24833         * reflection.c: fixed issue with encoding some custom attributes
24834         (arrays in properties and fields, bug #60411).
24836 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24838         * reflection.c: fix start address when copying the public key token.
24840 2004-06-23  Martin Baulig  <martin@ximian.com>
24842         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
24843         the `exc' object in a static object to put it into the GC's root set.
24845 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
24847         * reflection.c: make mono_reflection_setup_internal_class ()
24848         callable a second time to setup a new parent class.
24850 2004-06-23  Dick Porter  <dick@ximian.com>
24852         * threads.c: Check for WAIT_IO_COMPLETION return values.
24854 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
24856         * appdomain.c: Removed the g_free on the public key token. Now copy 
24857         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
24858         * assembly.c: Added public key token string value when loading 
24859         assemblies. Fix bug #60439.
24860         * icall.c: Added missing informations (like public key) in 
24861         GetReferencedAssemblies. Fix #60519.
24862         * image.h: Changed definition for public key token from const char*
24863         public_tok_value to guchar public_key_token [17];
24864         * reflection.c: Updated for changes to public key token.
24866 2004-06-22  Lluis Sanchez Gual
24868         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
24869         for the field in base classes.
24871 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
24873         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
24874         mark headers as not supported, they are installed only for use by the
24875         debugger.
24877 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
24879         * *.c, *.h: avoid namespace pollution in public headers.
24881 2004-06-21  Martin Baulig  <martin@ximian.com>
24883         * exception.c (mono_get_exception_security): It's in
24884         "System.Security", not in "System".
24886         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
24887         the exception classes.
24889 2004-06-21  Martin Baulig  <martin@ximian.com>
24891         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
24892         Protect the exception object from being finalized.
24894 2004-06-21  Martin Baulig  <martin@ximian.com>
24896         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
24897         public function.
24899 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
24901         * reflection.c: Load the assembly in mono_reflection_type_from_name,
24902         if it was not loaded before. Fix parts of #60439.
24904 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
24906         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
24907         code that was broken since Ben's change: wrappers are now
24908         dependent on the method signature only again.
24910 2004-06-21  Martin Baulig  <martin@ximian.com>
24912         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
24913         added interface support.
24915 2004-06-21  Martin Baulig  <martin@ximian.com>
24917         * class.c (mono_vtable_get_static_field_data): New public method.
24919 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
24921         * filewatcher.c : Windows build fix to be compliant with API changes.
24923 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
24925         * class.h, class.c: more accessors.
24926         * metadata.h, metadata.c: prepare for hiding MonoType and
24927         MonoMethodSignature: people should use the accessors from now on
24928         outside of the tree.
24930 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
24932         * *.c, *.h: more API cleanups.
24934 2004-06-18  Jackson Harper  <jackson@ximian.com>
24936         * assembly.c: Trace loading assemblies.
24937         * loader.c: Trace loading native libraries.
24938         * mono-config.c: Trace loading config files.
24939         
24940 2004-06-18  Dick Porter  <dick@ximian.com>
24942         * locales.c: Tell ICU the lengths of strings, it can cope with
24943         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
24945 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
24947         * image.c: swapped name/filename;
24949 2004-06-18  Martin Baulig  <martin@ximian.com>
24951         * mono-debug-debugger.c (write_class): Write the parent class at
24952         the end of the header.
24954 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
24956         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
24958 2004-06-17  Raja R Harinath  <rharinath@novell.com>
24960         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
24961         (bundle_obj): New conditional define.
24962         (BUILT_SOURCES): Remove.
24963         ($(bundle_srcs)): Make parallel-make safe.
24964         (libmonoruntime_la_LIBADD): Make unconditional.
24965         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
24966         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
24968 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
24970         * culture-info-tables.h: It was inconsistent with the latest
24971           supp info files.
24973 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
24975         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
24976         be loaded.
24978         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
24979         with gcc 2.95.
24981 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
24983         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
24984         cleaned up public header threads.h.
24986 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
24988         * Makefile.am, *.c, *.h: more API cleanups.
24990 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
24992         * Makefile.am: removed monosn from compilation.
24993         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
24994         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
24995         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
24996         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
24997         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
24998         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
25000 2004-06-15  Jackson Harper  <jackson@ximian.com>
25002         * assembly.c: Make locales lower case when searching the GAC for
25003         assemblies. gacutil will always make locales lowercase when
25004         installing so this effectively makes them case insensitive.
25005         
25006 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
25008         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
25009         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
25010           parameter which allows to choose whether the wait can be interrupted or 
25011           not. Also added the method mono_monitor_enter(), which locks the monitor
25012           using an infinite wait and without allowing interruption.
25013           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
25014           interrupted.
25015         * object.h: Added new fields in MonoThread. suspend_event holds the event
25016           used to susped/resume the thread. synch_lock is the lock object to use for
25017           modifying the thread state.
25018         * threads.c: Use the new synch_lock object for locking, instead of "this",
25019           which can generate deadlocks.
25020           Moved thread state change in Thread.Sleep and Thread.Join from managed
25021           to unmanaged code. This avoids a deadlock when the thread was suspended
25022           just after acquiring the thread lock.
25023           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
25024           Implemented Thread.Suspend using an event instead of ThreadSuspend,
25025           which is not fully implemented in the io-layer.
25026         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
25028 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
25030         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
25031         threads-types.h: more API cleanups.
25033 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
25035         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
25036         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
25037         threadpool.c, threads.c: first pass at the exported API cleanup.
25039 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
25041         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
25043 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25045         * icall.c: added internalGetHome.
25047 2004-06-14  Dick Porter  <dick@ximian.com>
25049         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
25050         possible to return successfully when '.' or '..' were the only
25051         entries in a directory, but were skipped.  The MonoIOStat was not
25052         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
25053         Fixes bug 59574.
25055 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
25057         * reflection.c: make binaries run on .Net 1.1 by default.
25059 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
25061         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
25063 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
25065         * marshal.c: keep track of struct size with explicit layout
25066         (bug #59979).
25068 2004-06-12  Martin Baulig  <martin@ximian.com>
25070         * mono-debug-debugger.c: Comment out a debugging g_message().
25072 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
25074         * reflection.c, reflection.h: do not free custom attrs that are cached.
25075         * icall.c: use braces to make code clearer.
25077 2004-06-11  Martin Baulig  <martin@ximian.com>
25079         * class.h (MonoInflatedField): New type.
25080         (MonoClassField): Replaced `MonoType *generic_type' with
25081         `MonoInflatedField *generic_info'.
25083         * icall.c
25084         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
25086 2004-06-11  Martin Baulig  <martin@ximian.com>
25088         * reflection.c (mono_image_create_method_token): Correctly encode
25089         varargs methods.
25091 2004-06-11  Martin Baulig  <martin@ximian.com>
25093         * metadata.c (mono_metadata_parse_method_signature): When parsing
25094         a MethodDef which has VarArgs, also set sentinelpos if we don't
25095         have any parameters.
25097 2004-06-11  Martin Baulig  <martin@ximian.com>
25099         * verify.c (mono_method_verify): In CEE_CALL, use
25100         mono_method_get_signature() to get the method's signature, unless
25101         we're a PInvoke method.
25103 2004-06-10  Jackson Harper  <jackson@ximian.com>
25105         * assembly.c: Use <path>/lib/mono/gac for the extra paths
25106         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
25107         logical name as the supplied path is just a prefix to the gac not
25108         the direct path to it.
25109         
25110 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
25112         * reflection.c: make the token for a created method match
25113         the token of the MethodBuilder it was created from
25114         (IKVM requires this behaviour now).
25116 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
25118         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
25119         reflection.c, socket-io.c: leak fixes.
25121 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
25123         * icall.c: handle sentinel pos in vararg methods in position different
25124         from 0.
25126 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25128         * culture-info-tables.h: freshly generated.
25130 2004-06-09  Martin Baulig  <martin@ximian.com>
25132         * loader.c (mono_get_method_constrained): Call `mono_class_init
25133         (constrained_class)'.   
25135 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
25137         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
25138         any methods. Fixes #59629.
25140 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
25142         * culture-info-tables.h: reflecting locale-builder updates.
25144 2004-06-08  Dick Porter  <dick@ximian.com>
25146         * object.h:
25147         * locales.c: Fixed compile warnings, including a real bug in
25148         CompareInfo_internal_compare.
25149         
25150 2004-06-08  Dick Porter  <dick@ximian.com>
25152         * locales.c
25153         (ves_icall_System_Globalization_CompareInfo_internal_index):
25154         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
25155         Double-check the resuls of usearches, because ICU currently
25156         ignores most of the collator settings here.  Fixes bug 59720.
25157         
25158 2004-06-08  Dick Porter  <dick@ximian.com>
25160         * locales.c
25161         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
25162         Fix memory leak and segfault-causing typo.  No idea how this one
25163         lasted so long without being noticed.
25165 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
25167         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
25168         any methods. Fixes #59629.
25170 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25172         * assembly.c:
25173         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
25174         own the critical section before). Removed dead code (that's done
25175         in the preload hook).
25177         (mono_assembly_load_with_partial_name): call the preload hook.
25179 2004-06-08  Martin Baulig  <martin@ximian.com>
25181         * metadata.c (mono_metadata_signature_alloc): Default
25182         `sentinelpos' to -1.
25184         * reflection.c (mono_image_get_array_token): Likewise.
25186 2004-06-08  Martin Baulig  <martin@ximian.com>
25188         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
25190         * metadata.c (mono_metadata_parse_method_signature): When parsing
25191         a MethodDef which has VarArgs, set sentinelpos.
25193         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
25194         `gint16' since we're using -1 for non-varargs methods.
25196         * reflection.c
25197         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
25198         (method_encode_signature): Added varargs support.
25199         (method_builder_encode_signature): Likewise.
25200         (mono_image_get_varargs_method_token): New static method.
25201         (mono_image_create_method_token): New public method; this is
25202         called via an icall instead of mono_image_create_token() when
25203         calling a varargs method.       
25205 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
25207         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
25209 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
25211         * culture-info-tables.h : Reflecting the latest locale-builder that
25212           fixed empty array representation ({} to {0}).
25214 2004-06-07  Jackson Harper  <jackson@ximian.com>
25216         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
25217         looking up extra gac paths. This allows MONO_GAC_PATH to act
25218         exactly like a prefix.
25219         
25220 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
25222         * reflection.c (mono_reflection_type_from_name): Make a copy of the
25223         type name before modifying it. Fixes #59405.
25225 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
25227         * culture-info.h: added fields for "all datetime patterns".
25228         * locales.c: (  ves_icall_System_Globalization_CultureInfo
25229           _construct_datetime_format ()): fill xxx_patterns fields.
25230         * object.h: added fields for "all datetime patterns" to
25231           MonoDateTimeFormatInfo.
25232         * culture-info-tables.h: reflecting locale-builder updates.
25234 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
25236         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
25237         the event has no add and remove methods. Fixes #59629.
25239 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
25241         * object.c: Fixed possible integer overflow when allocating large
25242         strings.
25244 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
25246         * culture-info-tables.h: reflecting locale-builder updates.
25248 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
25250         * culture-info-tables.h: reflecting locale-builder updates.
25252 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
25254         * culture-info-tables.h: reflecting locale-builder updates.
25256 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
25258         * threads.c: Made Thread.Sleep abortable.
25260 2004-06-02  Martin Baulig  <martin@ximian.com>
25262         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
25264         * debug-mono-symfile.h: Bumped symbol file version number to 37.
25266 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
25268         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
25270 2004-05-30  Jackson Harper  <jackson@ximian.com>
25272         * reflection.c: Do not hardcode assembly versions or public key
25273         tokens anymore. All of this except the corlib section was dead
25274         code anyways.
25275         
25276 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
25278         * object.c (mono_runtime_invoke_array): Automatically create boxed
25279         objects for byref valuetypes if needed. Fixes #59300.
25280         
25281         * object.c (mono_method_return_message_restore): Handle 
25282         MONO_TYPE_OBJECT as well.
25284 2004-05-28  Jackson Harper  <jackson@ximian.com>
25286         * reflection.c: The modified type encoding was causing build
25287         problems. Reverted for now.
25288         
25289 2004-05-28  Jackson Harper  <jackson@ximian.com>
25291         * reflection.c/h: Take an assembly ref so that we dont create
25292         fully qualified names when encoding types in the same assembly as
25293         the custom attribute being emitted.
25294         * appdomain.c: Increment version number.
25295         
25296 2004-05-26  Duncan Mak  <duncan@ximian.com>
25298         * icall.c
25299         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
25300         Set the full version number (major, minor, build, revision).
25302 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
25304         * marshal.c (emit_struct_conv): increment src/dst after blit
25305         (mono_marshal_get_managed_wrapper,
25306         mono_marshal_get_native_wrapper): make sure we have marshalling
25307         info before marshalling params (info computation affects
25308         blittable)
25310         * class.c (class_compute_field_layout): correctly deal with
25311         blittable
25312         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
25313         value types (as per what windows dows by default)
25314         (mono_class_setup_mono_type): System.ValueType is blittable
25315         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
25316         blittable
25318         * marshal.c (mono_marshal_load_type_info): flag types  as
25319         non-blittable if the native layout doesn't match the managed
25320         layout
25322 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25324         * appdomain.c: don't add stuff in the private search path that is
25325         above the application base. If application base is not set, there's
25326         no private search path.
25328 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
25330         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
25331         byref struct arguments in native->managed marshalling.
25333 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
25335         * marshal.c (mono_marshal_get_runtime_invoke): correctly
25336         cache methods using signature (special case for methods
25337         that are value type or string class)
25338         
25339         * image.c (mono_image_close): clean up allocated GSList's
25340         in runtime_invoke_cache.
25342 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25344         * mono-config.c: set the correct path for mono_cfg_dir on windows when
25345         there's no MONO_CFG_DIR environment variable defined.
25347 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25349         * threads.c: windows version must be >= 0x0500 to include OpenThread.
25351 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
25353         * threadpool.c: Really wait for 500ms after the async call, even if the wait
25354           is interrumped.
25355         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
25356           before waiting for it, and call CloseHandle after the wait to unref it.
25357           This will make sure that handles are not disposed too early.
25359 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25361         * appdomain.c:
25362         * appdomain.h:
25363         * icall.c: removed
25364         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
25365         needed now.
25367         * object.c: se the application_base only for the domain that runs
25368         Main. Fixes bug #59216,
25370 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25372         * appdomain.c:
25373         * object.c: only the domain in which Main is run have
25374         SetupInformation.ConfigurationFile set, so moved a few lines from
25375         appdomain.c to object.c.
25377 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25379         * appdomain.c: we tried to load [name].(dll|exe), but according
25380         to bug #57710, we must also try [culture]/[name].(dll|exe) and
25381         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
25382         There's a test case attached to bug #58922.
25384 2004-05-27  Dick Porter  <dick@ximian.com>
25386         * icall.c:
25387         * file-io.c: Implemented icalls for locking and unlocking regions
25388         in a file.
25389         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
25390         FALSE on error (fixes both compiler warning and real bug.)
25392 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
25394         * culture-info-tables.h: reflecting locale-builder updates.
25396           (Added missing ChangeLog entry for 05/26)
25398 2004-05-27  Jackson Harper  <jackson@ximian.com>
25400         * locales.c: Fix some cut and paste errors.
25401         
25402 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25404         * mono-config.c: set the correct path for config. directory on windows.
25406 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
25408         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
25409           on win32.
25411 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
25413         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
25414         from pinvoke functions.
25415         
25416         * marshal.c (mono_ftnptr_to_delegate): Implement this.
25418 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
25420         * culture-info-tables.h: reflecting locale-builder updates.
25422 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
25424         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
25425         #59086.
25427 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
25429         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
25430         * icall.c: Modified icalls for RNG.
25431         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
25432         Windows (CryptoAPI).
25434 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
25436         * locales.c: Fix build.
25438 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
25440         * culture-info-tables.h: reflecting locale-builder updates.
25442 2004-05-25  Jackson Harper  <jackson@ximian.com>
25444         * locales.c: When creating the current culture use the $LANGs
25445         specific culture. So DateTimeFormat and NumberFormat entries are created.
25446         
25447 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
25449         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
25450         a char array as parameter.
25452 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
25454         * image.c: In mono_image_open(), always use an absolute path name to
25455           look for already loaded images.
25457 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
25459         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
25460         missing in the windows build (like older cygwin include files).
25462 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
25464         * icall.c: Fixed check for possible integer overflow in Buffer_
25465         BlockCopy icall. Replaced comments style // by /* */.
25467 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
25469         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
25470         
25471         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
25472         check after MONO_VTADDR. Fixes pinvoke2.exe.
25474         * marshal.h marshal.c metadata.h: Add beginnings of support for
25475         ftnptr -> delegate marshalling.
25477 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
25479         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
25480         * threads.c: Fix warnings.
25482 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
25484         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
25485         * icall.c: Registered icalls for Suspend and Resume.
25486         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
25487           Thread.Abort.
25488         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
25489         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
25490         * process.c: Use WaitForSingleObjectEx.
25491         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
25492           checkpoints.
25493         * threads.c, threads.h: Make use of new Ex wait methods. Improved
25494           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
25495           for Suspend and Resume. Added new mono_thread_stop, used for stoping
25496           background threads. Added basic support for Abort in Windows.
25497           Start new threads using a managed delegate invoke wrapper. This wrapper
25498           has an interruption checkpoint that is needed since an interruption
25499           can be requested before the thread leaves the unmanaged code that starts 
25500           the thread.
25501         * marshal.c: Added interruption checkpoint after every native call, and
25502           also before managed calls for wrappers called from unmanaged code to
25503           go into managed code.
25504         * object.h: Added new field in MonoThread to keep track of interruption
25505           requests.
25507 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
25509         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
25510         calls.
25512 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25514         * appdomain.c:
25515         * assembly.c:
25516         * gc.c:
25517         * locales.c:
25518         * mono-config.c:
25519         * rand.c: getenv -> g_getenv (windows!)
25521         * process.c: complete_path is also used on non-windows platforms.
25523 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25525         * icall.c: new signature for Process_Start.
25527         * process.[ch]: new signature for Process_Start. If we're on windows
25528         and UseShellExecute is false, we have to search for the program by
25529         ourselves if we don't get a full path.
25531 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
25533         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
25534         marshalling and call CleanUpNativeData if needed. Fixes #58646.
25536 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25538         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
25539         Fixes bug #58373.
25541 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25543         * process.c: use double quotes to quote program name and arguments on
25544         windows. Fixes bug #58575.
25546 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25548         * file-io.c: don't return "." and ".." when using windows Find*File.
25550 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
25552         * marshal.c: Don't pass wrappers to message init because method 
25553         addressed used to lookup metadata. part of remoting[2|3] fix.
25555 2004-05-15  Jackson Harper  <jackson@ximian.com>
25557         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
25558         path is essentially the same as MONO_PATH except that it points to
25559         GACs instead of lib directories.
25560         * loader.h: The user gac is gone so we dont need function to
25561         enable/disable it.
25562         * mono-config.c: user gac option is now gone.
25563         
25564 2004-05-15  Jackson Harper  <jackson@ximian.com>
25566         * culture-info.h: Make defines more consistent, add calendar data
25567         to the culture info table.
25568         * culture-info-tables.h: Add basic calendar data. Basically
25569         everyone gets default gregorian until all the data is
25570         updated.
25571         * locales.c: Use the new consistent defines. Set calendar data for
25572         culture info objects.
25573         * object.h: add a field for calendar data to CultureInfo
25574         
25575 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
25577         * image.c: image->runtime_invoke_cache is keyed on signatures now.
25578         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
25579         a signature.
25580         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
25581         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
25582         an extra param that is the pointer of the method to invoke. The IL for
25583         the invoke method is no longer specific to the method, but to the
25584         signature of the method. Thus, we can share the same code for multiple
25585         methods. This reduces the number of methods that have to be compiled.
25587 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
25589         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
25591         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
25593         * icall.c: Optimize Buffer.BlockCopy.
25595 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25597         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
25598         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
25599         quote). Changed them to "MMMM yyyy".
25601 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
25603         * rand.c
25604         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
25606 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
25608         * reflection.h: Updated after changes to managed structures.
25610         * appdomain.c: Bump corlib version.
25612 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25614         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
25615         windows.
25617 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25619         * Makefile.am: link to ../os/libmonoos.la on windows.
25621         * assembly.c:
25622                 -If MONO_DEBUG, warn about non-existing directories in
25623                 MONO_PATH.
25624                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
25625                 compile time variable.
25626                 -Removed init_default_path and call mono_set_rootdir from
25627                 libmonoos.a instead (windows only).
25629         * assembly.h: declare mono_assembly_getrootdir().
25631         * domain.c:
25632         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
25634         * loader.c: s/getenv/g_getenv/
25636 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
25638         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
25640         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
25642         * metadata.h: Add new marshalling conversions.
25644         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
25645         function.
25647         * reflection.c (mono_reflection_get_type): Lookup the type in all
25648         modules of a multi-module assembly. Fixes #58291.
25650 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
25652         * threads.c: Before aborting a background, set the StopRequested
25653         state.  This avoids throwing the Abort exception.
25654         In mono_thread_manage, don't continue with the shutdown until all
25655         aborted threads have actually stopped.
25657 2004-05-10  Jackson Harper  <jackson@ximian.com>
25659         * locales.c: Remove the modifier from culture names.
25660         
25661 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25663         * Makefile.am: monosn is not installed any more. It has been deprecated
25664         in favor of sn.
25666 2004-05-07  Jackson Harper  <jackson@ximian.com>
25668         * locales.c
25669         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
25670         Fix array construction, add bailout if the length is 0.
25672 2004-05-07  Dick Porter  <dick@ximian.com>
25674         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
25675         machine doesn't have a DNS entry.  Patch by Urs Muff
25676         (umuff@quark.com), fixes bug 57928.
25678 2004-05-06  Jackson Harper  <jackson@ximian.com>
25680         * reflection.c: Handle null PublicTokens properly. alloc mem for
25681         assembly names culture so we dont crash when freeing it.
25682         
25683 2004-05-06  Jackson Harper  <jackson@ximian.com>
25685         * assembly.c: Check the usergac when loading with partial names.
25686         
25687 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
25689         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
25690         does nothing for now (not required for Linux/Windows) but the class
25691         library can call it (and a newer or modified runtime could need it).
25692         * icall.c: Registred icall.
25694 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25696         * loader.c: prints a message on module loading error we set MONO_DEBUG
25697         environment variable.
25699 2004-05-05  Jackson Harper  <jackson@ximian.com>
25701         * appdomain.c: Handle PublicKeyToken=null properly.
25702         
25703 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
25705         * environment.c|h: Added icall ves_icall_System_Environment_
25706         GetOSVersionString to get the current OS version as a string.
25707         * icall.c: Registred icall.
25709 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
25711         * object.c: in mono_object_get_virtual_method(), take into account that
25712         non-virtual methods don't have a slot in the vtable. Check needed when
25713         the object is a proxy.
25715 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
25717         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
25718         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
25720         * object.c (mono_class_compute_gc_descriptor): Fix warning.
25722         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
25723         passed when a valuetype is expected.
25725         * object.c (mono_unhandled_exception): Only set the exit code if the
25726         exception happens in the main thread. Fixes thread5.exe.
25728         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
25729         invalid names. Fixes #58047.
25731 2004-05-03  Jackson Harper  <jackson@ximian.com>
25733         * assembly.c: This line was committed accidently and is unneeded.
25734         
25735 2004-05-03  Jackson Harper  <jackson@ximian.com>
25737         * icall.c: Add new icall for Assembly::LoadWithPartialName
25738         * assembly.c/.h: new function that probes the GAC to load partial
25739         assembly names by Paolo Molaro.
25740         
25741 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25743         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
25744         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
25745         (type_get_fully_qualified_name): Added PublicKeyToken when building a
25746         full type name.
25748 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25750         * appdomain.c: fixed check for 'neutral' culture and removed warning.
25751         * reflection.c: fix bug when parsing a full type name and Version is not
25752         the last thing in the string.
25754 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
25756         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
25757         crashes when it is freed.
25759 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25761         * assembly.c: print the compat warning to stderr.
25763 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
25765         * assembly.c (mono_assembly_load_references): Add a compatibility
25766         hack to run old applications that might be still referencing the
25767         3300-based assemblies, only do this for System.xxx.
25769 2004-05-01  Jackson Harper  <jackson@ximian.com>
25771         * appdomain.c: If the culture is neutral we set it to "".
25772         
25773 2004-04-29  Jackson Harper  <jackson@ximian.com>
25775         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
25777 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
25779         * string-icalls.c: added low overhead function for copying chars
25780         * icall.c: added needed icall for the above function
25782 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25784         * icall.c: fix return value of get_global_assembly_cache.  Implemented
25785         Environment.GetLogicalDrives.
25787 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
25789         * rand.c: try and talk to egd or prngd
25790         for random bytes if opening devices fail.
25792 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
25794         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
25795         alignment for the type using the native alignment of its members 
25796         instead of using klass->min_align.
25798         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
25800 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25802         * file-io.c:
25803         * socket-io.c: added check for sys/aio.h.
25805 2004-04-28  Dick Porter  <dick@ximian.com>
25807         * threads.c: Don't abort a thread thats already aborting, when
25808         terminating everything.
25810 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25812         * icall.c: added 2 new async calls for Socket.
25814         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
25815         IO on *nix systems.
25817         * threadpool.c: removed unused variable.
25819 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
25821         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
25823 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25825         * locales.c: put back string_invariant_tolower () and
25826         string_invariant_toupper ().
25828 2004-04-26 David Waite <mass@akuma.org>
25830         * file-io.h:
25831         * socket-io.h:
25832         * threads.h:
25833         * unicode.h: remove comma from end of enumeration declarations
25835 2004-04-26 David Waite <mass@akuma.org>
25837         * debug-mono-symfile.h:
25838         * decimal.c:
25839         * mono_debug.h:
25840         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
25843 2004-04-26  Jackson Harper  <jackson@ximian.com>
25845         * appdomain.c: Increment version number.
25846         
25847 2004-04-26  Jackson Harper  <jackson@ximian.com>
25849         * appdomain.c: Set assembly references public token value when
25850         PublicKeyToken is specified, not the hash_value. Free public token
25851         values when free assembly name data. Previously the public key
25852         token was hex decoded, however we are using hex encoded public key
25853         tokens, so this is not neccasary.
25854         * assembly.c: Lookup assemblies in the gac if their public token
25855         value is set. Add function to allow enabling user gac
25856         lookups. Specify whether or not the assembly was loaded from the
25857         GAC. Compare full assembly names when checking the cache for
25858         assemblies (Temporarily disabled see comment in code). Remove
25859         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
25860         specifies trace-loader they get extra info to stdout on the
25861         loading of assemblies.
25862         * image.h: Add a field for an assembly references public token
25863         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
25864         whether an assembly has been loaded from the GAC.
25865         * image.c: Remove a corlib -> mscorlib name mapping.
25866         * loader.h: Add function to enable/disable the user gac.
25867         * mono-config.c: Check if the usergac is enabled in the config
25868         file.
25869         * icall.c: New icall to determine whether or not an assembly has
25870         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
25871         * tabldefs.h: Add constant for assemblyref flag that specifies a
25872         full public key is used instead of a public token.
25873         * reflection.c: Remove mscorlib -> corlib mappings. Set
25874         PublicTokenValue instead of hash value. This value is a hex
25875         string so it does not need to be expanded.
25877 2004-04-26  Martin Baulig  <martin@ximian.com>
25879         * mono-debug-debugger.c (mono_debugger_initialize): Set
25880         `mono_debugger_initialized' before calling mono_debug_lock().
25882 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
25884         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
25885           InternalToUpper/InternalToLower.
25886         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
25887           removed invariant culture shortcut.  This is now done in managed code.
25888         * locales.c: (string_invariant_toupper/tolower) removed.
25890 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25892         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
25893         Added Poll internal call.
25895         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
25896         call for Poll. Select was too heavy for polling a single socket.
25898         * threadpool.[ch]: added mono_threadpool_cleanup.
25899         * threads.c: use it. Don't use Thread_Abort on windows.
25901 2004-04-23  Martin Baulig  <martin@ximian.com>
25903         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
25905 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
25907         * icall.c: Registred new icalls for key pair protection and added an
25908         icall for Environment.GetFolderPath on Windows.
25909         * security.c|h: Added new icalls for key pair protection.
25911 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25913         * socket-io.c: don't display the non-supported family warning for known
25914         families. Now this is not displayed on windows when checking support
25915         for IPv4/IPv6.
25917 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25919         * class.c: don't display the layout warning for static fields.
25921 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
25923         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
25924         * locales.c, locales.h: Added new icalls for culture-specific
25925         Char.ToLower and Char.ToUpper.
25927 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25929         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
25930         by David Waite.
25932 2004-04-20  Martin Baulig  <martin@ximian.com>
25934         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
25935         of the type name before passing it to mono_reflection_type_from_name().
25937 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
25939         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
25940         encodings here. Fixes #56965.
25942 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
25944         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
25945         fix test on strstr result not that I can see anything that
25946         relies on the result.
25948 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
25950         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
25951         Fixes #57081.
25953         * marshal.c (mono_marshal_get_string_encoding): New helper function.
25955         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
25956         function to determine which marshalling to use for strings. Fixes
25957         #56965.
25959         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
25961         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
25963 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
25965         * icall.c: #include mono-config.h
25967 2004-04-15  Jackson Harper  <jackson@ximian.com>
25969         * culture-info-tables.h: Fix date formats for en-US culture.
25970         
25971 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
25973         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
25974         ThreadPool.SetMinThreads.
25975         * threadpool.c: Implemented ThreadPool.GetMinThreads and
25976         ThreadPool.SetMinThreads.
25978 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
25980         * mono-config.c: also load the .config file in the directory
25981         where the assembly was found.
25983 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
25985         * assembly.c: load per-assembly config files.
25986         * icall.c: decrapified code to get the config dir and moved to
25987         mono-config.c.
25988         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
25989         per-assembly config files. When doing a dll map lookup give precedence
25990         to the per-assembly data.
25992 2004-04-14  Martin Baulig  <martin@ximian.com>
25994         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
25995         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
25996         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
25998         * mono-debugger-debugger.c: While the debugger is locked, remember
25999         whether the symbol tables have changes and send one single
26000         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
26002 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
26004         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
26006         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
26007         function.
26009         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
26010         account when marshalling string arrays. Fixes #56965.
26012 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
26014         * icall.c: Add new icalls mapping for security.
26015         * security.c|h: Add internal calls for WindowsIdentity,
26016         WindowsImpersonationContext and WindowsPrincipal.
26018 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
26020         * class.c: Added comment to ensure the System.MonoDummy class
26021         is removed when no longer necessary
26023 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
26025         * appdomain.c: Pass arguments to the bootstraping exceptions to
26026         minimize JITed methods at boot
26028         * metadata.c (mono_exception_from_name_two_strings): Allow for the
26029         second string to be null.
26031         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
26032         Change the protocol to minimize the JIT methods at startup.  Now
26033         it Returns the internal codepage, if the value of "int_code_page"
26034         is 1 at entry, and we can not compute a suitable code page
26035         number, returns the code page as a string.
26037 2004-04-13  Jackson Harper  <jackson@ximian.com>
26039         * culture-info-tables.h: Fix number of decimal digits for all
26040         english locales.
26042 2004-04-13  Jackson Harper  <jackson@ximian.com>
26044         * icall.c: Clairfy out of sync error message. It is not always
26045         your corlib that is out of sync.
26047 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
26049         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
26050         properties when only the set accessor is overriden. Fixes #55874.
26052 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
26054         * assembly.c (mono_assembly_load_references): Make this thread safe.
26055         Fixes #56327.
26057 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
26059         * monosn.c: Add missing initialization calls.
26061 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
26063         * locales.c:
26064         ves_icall_System_Globalization_CultureInfo_construct_number_format
26065         Fix g_assert so it compiles on fussier compilers re int/ptr
26066         mismatch
26068 2004-04-08  Dick Porter  <dick@ximian.com>
26070         * socket-io.h:
26071         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
26072         53992.  Also rearrange the code so that the internal calls return
26073         an error value and exceptions are thrown from managed code.
26075         * icall.c: Add type info to the socket icalls.
26077 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26079         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
26080         owes me a beer.
26082 2004-04-07  Martin Baulig  <martin@ximian.com>
26084         * class.c (mono_class_from_generic_parameter): Don't default
26085         `klass->parent' to `mono_defaults.object_type'.
26087 2004-04-07  Martin Baulig  <martin@ximian.com>
26089         * reflection.c (mono_reflection_initialize_generic_parameter): Set
26090         `param->pklass->reflection_info'.       
26092 2004-04-07  Jackson Harper  <jackson@ximian.com>
26094         * culture-info-tables.h: Fix date separator symbol.
26095         
26096 2004-04-07  Martin Baulig  <martin@ximian.com>
26098         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
26099         from System.Type to System.MonoType.
26101 2004-04-07  Martin Baulig  <martin@ximian.com>
26103         * reflection.h
26104         (MonoReflectionGenericParam): Added `has_reference_type' and
26105         `has_value_type' fields.
26107         * reflection.c (mono_image_get_generic_param_info): Encode the
26108         correct flags if we have the `class' or `struct' constraint.
26110 2004-04-07  Martin Baulig  <martin@ximian.com>
26112         * reflection.h
26113         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
26115 2004-04-07  Jackson Harper  <jackson@ximian.com>
26117         * appdomain.c: Revert extra patches, just wanted to bump the
26118         version number.
26119         
26120 2004-04-07  Jackson Harper  <jackson@ximian.com>
26122         * Makefile.am: Add culture-info private headers.
26123         * icall.c: Add new icalls for contructing locales.
26124         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
26125         * locales.h: Declare new culture info construction methods.
26126         * object.h: Add new fields used to avoid the CultureMap to
26127         MonoCultureInfo.
26128         * culture-info.h: Definition of structs used in the culture info
26129         tables.
26130         * culture-info-tables.h: Autogenerated tables that contain culture
26131         info data. This file was generated with the locale-builder tool.
26132         * appdomain.c: Incement corlib version number.
26133         
26134 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
26136         * appdomain.c: (mono_runtime_init) move mono_thread_init
26137         to before mono_object_new calls so critical sections
26138         are initialized before use.
26140 2004-04-07  Martin Baulig  <martin@ximian.com>
26142         * icall.c
26143         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
26144         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
26145         (ves_icall_MonoGenericParam_initialize): Removed.
26146         (monogenericparam_icalls): Removed.
26147         (generictypeparambuilder_icalls): Added new table for
26148         System.Reflection.Emit.GenericTypeParameterBuilder.
26150         * reflection.c
26151         (mono_reflection_define_generic_parameter): Removed.
26152         (mono_reflection_initialize_generic_parameter): This is now called
26153         from GenericTypeParameterBuilder's .ctor.
26155 2004-04-06  Martin Baulig  <martin@ximian.com>
26157         * class.c (mono_class_init): Don't inflate nested classes in a
26158         generic instance.
26159         (mono_type_get_name_recurse): Include the generic arguments for
26160         generic instances and generic type declarations.
26161         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
26162         (_mono_class_get_instantiation_name): Removed.
26163         (mono_class_create_generic): Always use `gklass->name' as our name.
26165         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
26167         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
26168         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
26169         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
26170         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
26171         closed generic methods here.
26173         * reflection.c
26174         (mono_reflection_generic_inst_get_nested_types): Removed.
26175         (inflate_mono_method): Copy the generic parameters from the
26176         MonoMethodHeader into out MonoGenericMethod.
26178 2004-04-06  Martin Baulig  <martin@ximian.com>
26180         * row-indexes.h
26181         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
26183         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
26185         * reflection.c (build_compressed_metadata): If we have any entries
26186         in the GenericParam, MethodSpec or GenericParamConstraint tables,
26187         set the header version to 1.1.
26189 2004-04-06  Martin Baulig  <martin@ximian.com>
26191         * class.c (mono_class_init): If we're a generic instance,
26192         initialize our nested classes, too.
26193         (_mono_class_get_instantiation_name): Deal with the new `!%d'
26194         suffix. 
26196 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26198         * process.c: quote the argument passed to the shell on windows.
26200 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
26202         * threads.c (mono_alloc_special_static_data): Allow this to be
26203         called during startup.
26205 2004-04-02  Martin Baulig  <martin@ximian.com>
26207         * icall.c
26208         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
26210 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
26212         * icall.c: Fix build.
26214 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
26216         * Makefile.am: Added security.c|h.
26217         * icall.c: Added icall for get_UserName;
26218         * security.c: New file for security related icalls. Added function
26219         get_UserName for System.Environment (fix #56144).
26220         * security.h: New. Header file for security.c
26222 2004-04-02  Dick Porter  <dick@ximian.com>
26224         * icall.c: Deleted the icalls that were obsoleted some time ago
26225         by the ICU string code, and which were mixed into the icall
26226         rearranging.  Fixes bug 55969.
26228         * string-icalls.h: 
26229         * string-icalls.c: Deleted the code that those icalls reference.
26231 2004-04-01  Martin Baulig  <martin@ximian.com>
26233         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
26235         * class.c (mono_class_from_generic_parameter): Don't set 
26236         TYPE_ATTRIBUTE_INTERFACE.
26237         (my_mono_class_from_generic_parameter): Likewise.
26239 2004-04-01  Martin Baulig  <martin@ximian.com>
26241         * loader.c (find_method): Added an optional `MonoClass *ic'
26242         argument to search in a specific interface.
26243         (mono_get_method_constrained): New public function.
26245 2004-04-01  Martin Baulig  <martin@ximian.com>
26247         * reflection.c (mono_image_get_generic_field_token): Use the
26248         `handleref' cache here.
26250 2004-04-01  Martin Baulig  <martin@ximian.com>
26252         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
26254         * reflection.c (create_generic_typespec): Use the `typespec' hash
26255         here, not the `typeref' one.    
26257 2004-04-01  Martin Baulig  <martin@ximian.com>
26259         * class.c (mono_class_inflate_generic_type): Moved the
26260         functionality into a new static inflate_generic_type() which
26261         returns NULL if it didn't do anything.  Only increment the
26262         `mono_stats.inflated_type_count' if we actually inflated
26263         something.
26264         (mono_class_get_full): Check the classes type to see whether we
26265         need to inflate it; also inflate MONO_TYPE_(M)VAR.
26267 2004-04-01  Jackson Harper  <jackson@ximian.com>
26269         * reflection.c: Set culture for assembly references.
26270         
26271 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
26273         * reflection.[ch], icall.[ch], Fix support for pinning variables.
26275 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26277         * assembly.c:
26278         (do_mono_assembly_open): the critical section also covers
26279         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
26281 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26283         * threads.c:
26284         (mono_manage_threads): abort the background threads when finishing.
26285         Fixes bug #47232.
26287 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26289         * gc.c: only close the done_event handle if there was no timeout.
26290         C-ified comments.
26292 2004-03-30  Martin Baulig  <martin@ximian.com>
26294         * icall.c (icall_entries): It's called "System.Activator", not
26295         "System.Activation".    
26297 2004-03-30  Martin Baulig  <martin@ximian.com>
26299         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
26300         (mono_class_create_from_typespec): Likewise.
26302 2004-03-30  Martin Baulig  <martin@ximian.com>
26304         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
26305         `has_ctor_constraint' and `initialized'.
26307 2004-03-30  Martin Baulig  <martin@ximian.com>
26309         * reflection.c (encode_new_constraint): New static function to add
26310         the constructor constraint attribute to a type parameter.
26311         (encode_constraints): Call encode_new_constraint() if necessary.
26313         * reflection.h
26314         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
26316         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
26317         
26318 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
26320         * reflection.c, icall.c: add support for pinning variables. 
26322 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
26324         * marshal.c (mono_marshal_get_managed_wrapper):
26325         init bool local with zero rather than null.
26327 2004-03-29  Martin Baulig  <martin@ximian.com>
26329         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
26330         the "official" behavior here.
26331         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
26333 2004-03-29  Martin Baulig  <martin@ximian.com>
26335         * icall.c: Reflect latest API changes.
26337 2004-03-29  Martin Baulig  <martin@ximian.com>
26339         * loader.c (mono_get_method_from_token): Also call
26340         mono_metadata_load_generic_params () for abstract and interface
26341         methods; replace the type arguments in the method signature with
26342         the ones which are loaded from the metadata.
26344 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
26346         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
26347         of the lock is not the current thread. MS.NET don't do it, in spite of
26348         what the documentation says. See bug #56157.
26350 2004-03-28  Martin Baulig  <martin@ximian.com>
26352         * class.c (mono_class_init): Don't call init_properties() and
26353         init_events() for generic instances; set `prop->parent' when
26354         inflating properties.
26356         * reflection.c (mono_generic_inst_get_object): Call
26357         `mono_class_init (ginst->klass)'.
26358         (mono_type_get_object): Only create a MonoGenericInst if your
26359         generic type is a TypeBuilder.
26360         (do_mono_reflection_bind_generic_parameters): Only set
26361         `ginst->is_dynamic' if our generic type is a TypeBuilder.
26363 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
26365         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
26366         Fixes #56091.
26368 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26370         * icall.c: added Kill_internal icall.
26371         * process.[ch]: added Kill_internal icall.
26373 2004-03-25  Martin Baulig  <martin@ximian.com>
26375         * class.h (MonoStats): Added `generic_instance_count',
26376         `inflated_method_count', `inflated_type_count' and
26377         `generics_metadata_size'.       
26379 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26381         * reflection.c: no warnings now.
26383 2004-03-25  Martin Baulig  <martin@ximian.com>
26385         * class.c (mono_class_get_full): New public function; does a
26386         mono_class_get(), but also takes a `MonoGenericContext *'.
26388         * loader.c (mono_field_from_memberref): Renamed to
26389         `field_from_memberref', made static and added `MonoGenericContext *'
26390         argument.
26391         (mono_field_from_token): Added `MonoGenericInst *' argument.
26392         (method_from_memberef): Likewise.
26393         (mono_get_method_from_token): Likewise.
26394         (mono_get_method_full): New public function; does a
26395         mono_get_method(), but also takes a `MonoGenericContext *'.
26397         * verify.c (mono_method_verify): Get the method's generic context
26398         and pass it to mono_field_from_token(), mono_get_method_full() and
26399         mono_class_get_full().
26401 2004-03-25  Martin Baulig  <martin@ximian.com>
26403         * class.c (mono_class_inflate_generic_type): Take a
26404         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
26405         `MonoGenericMethod *'.
26407 2004-03-25  Martin Baulig  <martin@ximian.com>
26409         * loader.h (MonoMethodInflated): Store the MonoGenericContext
26410         instead of the MonoGenericMethod here.
26412 2004-03-25  Martin Baulig  <martin@ximian.com>
26414         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
26415         each time we create a new MonoGenericInst, we also create a new
26416         context which points back to us.
26418         * class.c (inflate_method): Use `ginst->context' instead of
26419         creating a new context.
26421         * loader.c (method_from_memberref): Use
26422         `klass->generic_inst->context' instead of creating a new context.
26424 2004-03-25  Martin Baulig  <martin@ximian.com>
26426         * class.h (MonoGenericContext): New struct.
26427         (MonoGenericMethod): Removed `generic_inst'.
26429         * class.c (mono_class_inflate_generic_method): Take a
26430         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
26432 2004-03-25  Martin Baulig  <martin@ximian.com>
26434         * loader.h (MonoMethodInflated): New typedef.
26436         * metadata.h (MonoMethodSignature): Removed `gen_method', make
26437         `generic_param_count' consume just 30 bits, added `is_inflated'
26438         and `has_type_parameters' flags (one bit each).
26440         * class.c (mono_class_inflate_generic_method): Create a
26441         MonoMethodInflated instead of a MonoMethodNormal and set
26442         `is_inflated' in the method signature.
26444         * class.h (MonoGenericMethod): Removed `generic_method'.
26446 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
26448         * image.c: Make sure the name of a MonoImage is always an absolute path.
26449           This fixes bug #54415.
26451 2004-03-24  Martin Baulig  <martin@ximian.com>
26453         * class.c (mono_class_setup_vtable): If we're a generic instance,
26454         use our generic type's vtable size.
26456 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
26458         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
26459         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
26460         problems.
26462 2004-03-23  Martin Baulig  <martin@ximian.com>
26464         * class.h (MonoDynamicGenericInst): Added `int count_events' and
26465         `MonoEvent *events'.
26467         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
26468         (typebuilder_icalls): Added "get_event_info"; calls
26469         mono_reflection_event_builder_get_event_info(). 
26471         * reflection.c (mono_reflection_generic_inst_initialize): Added
26472         `MonoArray *events'.
26473         (mono_reflection_event_builder_get_event_info): New function.
26475 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
26477         * object.h: add mono_type_initialization_init
26479         * object.c (mono_runtime_class_init): 
26480         implement class constructor synchronization rules
26481         to cope with threading issues.  
26482         add mono_type_initialization_init
26484         * appdomain.c (mono_runtime_init): call 
26485         mono_type_initialization_init
26487         * class.h: removing initializing field from MonoVTable
26489 2004-03-23  Martin Baulig  <martin@ximian.com>
26491         * class.c (my_mono_class_from_generic_parameter): Use
26492         `param->name' if it's not NULL. 
26494 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
26496         * class.c: do not insert non-virtual methods in the vtable.
26497         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
26498         that means the method is non-virtual. This never would have
26499         happened before.
26501 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
26503         * profiler.c: Added lock for accessing coverage_hash.
26505 2004-03-22  Martin Baulig  <martin@ximian.com>
26507         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
26508         `method->method->signature->generic_param_count != 0' to make it
26509         work for interface methods.
26511 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26513         * process.c: quote the string passed to the shell using g_shell_quote.
26515 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26517         * threads.c:
26518         (mono_threads_manage): don't remove the finalizer thread and self
26519         from the threads hash table so that mono_thread_manage can be called
26520         more than once.
26522 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26524         * process.c: quote the arguments when UseShellExecute is true. Fixes
26525         bug #55790.
26527 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26529         * threads.c: set mono_thread_detach as a cleanup routine for every
26530         thread. This way it's always executed upon thread termination, either
26531         aborted or finished normally. No more xsp hangs!
26533 2004-03-17  Martin Baulig  <martin@ximian.com>
26535         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
26536         `int count_nested' and a `MonoType **nested'.
26538         * reflection.c (mono_reflection_bind_generic_parameters): Moved
26539         most of the functionality into a new static
26540         do_mono_reflection_bind_generic_parameters() and don't take a
26541         `MonoType *nested_in' argument any more.  Don't compute nested
26542         types here.
26543         (mono_reflection_generic_inst_get_nested_types): New public method
26544         to get nested types.
26546         * class.c (mono_class_create_generic): Set `klass->nested_in' if
26547         we're a nested class.
26549         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
26550         mono_reflection_generic_inst_get_nested_types() to compute the
26551         nested types.
26553 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
26555         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
26556         descriptive error message under windows.
26557         
26558 2004-03-17  Martin Baulig  <martin@ximian.com>
26560         * class.c (dup_type): Added `const MonoType *original' argument;
26561         copy the attrs from the original type.
26563 2004-03-17  Martin Baulig  <martin@ximian.com>
26565         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
26566         `m->generic_inst_cache' here.
26568 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
26570         * exception.h exception.c: Add stack_overflow_exception.
26572 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26574         * threadpool.c:
26575         (overlapped_callback): call SetEvent *after* invoking the callback.
26576         No need to call CloseHandle.
26578 2004-03-16  Martin Baulig  <martin@ximian.com>
26580         * reflection.c (mono_image_get_fieldref_token): Take a
26581         `MonoReflectionField *' instead of a `MonoClassField *' and a
26582         `MonoClass *'; store the `MonoReflectionField *' in the hash.
26584 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26586         * appdomain.c: don't add the culture to the filename we're looking for
26587         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
26589 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26591         * locales.c: don't ignore symbols when doing case insensitive compares.
26592         Thanks Dick! Fixes bug #54046.
26594         * threads.c: surround 'threads' usage with enter/leave in
26595         mono_thread_manage.
26597 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
26599         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
26600         implicitly marshalled as [Out]. Fixes #55450.
26602         (mono_marshal_get_runtime_invoke): Zero out the result if there is
26603         an exception.
26605 2004-03-16  Martin Baulig  <martin@ximian.com>
26607         * class.c (mono_class_from_generic_parameter): Use the actual
26608         parameter name. 
26610 2004-03-16  Martin Baulig  <martin@ximian.com>
26612         * reflection.c (type_get_signature_size): New static function.
26613         Compues the size of the type in a method signature.
26614         (method_get_signature_size): New static function; calls
26615         type_get_signature_size() to compute the actual size of the
26616         method's signature.
26617         (method_encode_signature): Use method_get_signature_size() to get
26618         the signature's size rather than using `nparams * 10'.
26620 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26622         * file-io.h: define here WapiOverlapped on windows. I don't want the
26623         regular OVERLAPPED one.
26625         * file-io.c:
26626         * threadpool.c: somehow, BindIoCompletionCallback is not found.
26627         Disabling AIO on windows.
26629 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26631         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
26632         bug #55385.
26634 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26636         * appdomain.c: upgraded corlib version.
26638         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
26639         and BeginWrite. Allow opening files for asynchrnous operations.
26641         * file-io.h: new struct that maps FileStreamAsyncResult.
26642         * icall.c: added new icalls.
26643         * process.[ch]: support setting child process environment variables
26644         and use the SHELL or COMSPEC when UseShellExecute is true.
26646         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
26647         callback for async. IO is here and also BindHandle.
26649         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
26650         from here.
26652 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
26654         * reflection.c (create_custom_attr): Allow len == 0.
26656         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
26657         computation on big-endian machines.
26659 2004-03-13  Martin Baulig  <martin@ximian.com>
26661         * class.h (MonoGenericInst): Added `int count_ifaces'.
26663         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
26664         `ginst->count_ifaces' instead `klass->interface_count' since we
26665         may get called before the vtable is created.
26667         * loader.c (mono_method_get_param_names): If we're a generic
26668         instance, return and don't initialize the class.
26670         * reflection.c (mono_reflection_setup_generic_class): Don't call
26671         ensure_runtime_vtable().
26672         (mono_reflection_bind_generic_parameters): Set
26673         `ginst->count_ifaces'.
26675 2004-03-11  Jackson Harper <jackson@ximian.com>
26677         * icall.c:
26678         * unicode.c:
26679         * unicode.h: Remove unused System.Char icalls.
26680         
26681 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
26683         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
26684         code when we P/Invoke the first library in Windows.Forms, instead
26685         of when we first open the assembly.
26687         * assembly.c: Drop the lookup from here.
26689 2004-03-10  Martin Baulig  <martin@ximian.com>
26691         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
26692         class for properties, fields and events.  Finally fixes #54945.
26694 2004-03-10  Martin Baulig  <martin@ximian.com>
26696         * metadata.c (mono_metadata_class_equal): New static function;
26697         checks whether two generic instances or two generic parameters are
26698         equal.
26699         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
26700         compare classes.        
26702 2004-03-10  Martin Baulig  <martin@ximian.com>
26704         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
26706         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
26707         argument and write it into the `reflection_info' field.
26709         * icall.c
26710         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
26711         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
26713 2004-03-09  Jackson Harper  <jackson@ximian.com>
26715         * char-conversions.h: use 8 bits for numeric data its all we need
26716         * icall.c: numeric data is only 8 bits now.
26718 2004-03-09  Martin Baulig  <martin@ximian.com>
26720         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
26722         * class.c (init_properties, init_events): Initialize the new
26723         `parent' field.
26725         * reflection.c (typebuilder_setup_properties): Likewise.
26726         (typebuilder_setup_events): Likewise.
26728         * reflection.h (MonoEventInfo): Replaced `parent with
26729         `declaring_type' and `reflected_type'.
26731         * icall.c (ves_icall_get_property_info): Distinguish between
26732         declaring and reflected type.
26733         (ves_icall_get_event_info): Likewise.
26735 2004-03-09  Martin Baulig  <martin@ximian.com>
26737         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
26738         (ves_icall_Type_GetField): Correctly set field->klass.
26740 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
26742         * loader.h: Fix warning.
26744 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
26746         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
26747         library routine if present.  Notice that it will still continue
26748         executing even if its missing, for those working on the Gtk#
26749         edition of Windows.Forms.
26751         * assembly.c (do_mono_assembly_open): If loading the
26752         System.Windows.Forms call mono_loader_wini_init.
26754 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
26756         * class.h: Added MonoRemoteClass struct.
26757         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
26758         function for MonoStrings.
26759         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
26760         Added internal call for getting the proxy type.
26761         * marshal.c: Get the type of transparent proxies from its remote_class.
26762         Added methods that generate the IL for type checks and casts:
26763         mono_marshal_get_isinst, mono_marshal_get_castclass, 
26764         mono_marshal_get_proxy_cancast.
26765         * marshal.h: Declaration of the previous new methods.
26766         * object.c: Added new moethods for creating and updating MonoRemoteClass
26767         instances: mono_remote_class, mono_upgrade_remote_class, 
26768         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
26769         * verify.c: FIx transparent_proxy_fields layout.
26770         * appdomain.c: Bump corlib version.
26772 2004-03-04  Jackson Harper  <jackson@ximian.com>
26774         * icall.c: Add icall to access char conversion tables.
26775         * char-conversions.h: Character conversion tables.
26776         * Makefile.am: Add char-conversions.h private header file.
26777         
26778 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
26780         * appdomain.c (unload_thread_main): Increase unloading timeout to
26781         10 sec as a temporary workaround for Nant problems.
26783 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
26785         * gc.c: Add checks for GC_enable and GC_disable.
26787         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
26788         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
26789         (bug #54988).
26790         
26791 2004-02-27  Martin Baulig  <martin@ximian.com>
26793         * reflection.c (mono_reflection_bind_generic_parameters): Take a
26794         `MonoReflectionType *' instead of a `MonoType *'.
26796 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
26798         * gc.c (run_finalize): Avoid finalizing the object representing the
26799         finalizer thread.
26800         (finalizer_thread): Fix warning.
26802 2004-02-25  Martin Baulig  <martin@ximian.com>
26804         * class.c (_mono_class_get_instantiation_name): Added `int offset'
26805         argument for nested types.
26806         (mono_class_create_generic): Added support for nested generictypes.
26808         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
26809         `GList *nested'.
26811         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
26813         * reflection.c (method_encode_signature): Increase the minimum
26814         value of `size' from 10 to 11.
26815         (mono_reflection_bind_generic_parameters): Take `int type_argc'
26816         and `MonoType **types' arguments instead of the `MonoArray
26817         *types'; added `MonoType *nested_in'.  Recursively instantiate
26818         nested classes. 
26820 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
26822         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
26823         stack_overflow_ex members which are used by exception handling.
26825         * appdomain.c (mono_runtime_init): Initialize the new members.
26827         * gc.c (mono_gc_enable): New helper function.
26828         * gc.c (mono_gc_disable): New helper function.
26830 2004-02-23  Martin Baulig  <martin@ximian.com>
26832         * icall.c: I must have been really stupid - make it actually work
26833         this time ;-)
26835 2004-02-23  Martin Baulig  <martin@ximian.com>
26837         * loader.c (method_from_memberref): Only inflate the method if
26838         it's in another klass.
26840 2004-02-23  Martin Baulig  <martin@ximian.com>
26842         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
26843         (mono_class_init): If we're a generic instance and an interface,
26844         compute `class->interface_id'; also create `class->interfaces'
26845         here and inflate them.
26847         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
26848         `ginst->is_open'.
26849         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
26851         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
26853 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
26855         * reflection.c (method_encode_code): Improved the error message
26856         generated by the exception.
26858 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26860         * icall.c: Martin did not do what he said in the ChangeLog for
26861         2004-02-18, but put back the changes for properties and events.
26862         Commenting those changes out again and adding comment to bug #54518.
26863         
26864         * process.c: removed warning.
26866 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
26868         * marshal.c (emit_struct_conv): Print an error message instead of
26869         asserting when a type does not have the StructLayout attribute.
26871 2004-02-20  Martin Baulig  <martin@ximian.com>
26873         * reflection.c (mono_type_get_object): Also use the cache for
26874         generic instances.
26875         (mono_reflection_bind_generic_parameters): Always compute
26876         `ginst->ifaces'.        
26878 2004-02-20  Martin Baulig  <martin@ximian.com>
26880         * class.h (MonoGenericMethod): Removed `klass'.
26882         * class.c (mono_class_inflate_generic_method): Added `MonoClass
26883         *klass' argument.
26885 2004-02-20  Martin Baulig  <martin@ximian.com>
26887         * reflection.c (method_encode_methodspec): Actually use the
26888         uninflated signature for the memberref.
26890 2004-02-20  Martin Baulig  <martin@ximian.com>
26892         * class.h (MonoGenericMethod): Removed `declaring'.
26894         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
26895         is NULL, compute it here.
26897 2004-02-20  Martin Baulig  <martin@ximian.com>
26899         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
26901         * metadata.c (mono_metadata_generic_inst_hash): New method.
26902         (mono_metadata_generic_inst_equal): New method.
26904         * reflection.c (mono_reflection_bind_generic_parameters): Use the
26905         `klass->image->generic_inst_cache' cache to avoid creating
26906         duplicate MonoGenericInst's.
26908         * class.c (mono_class_inflate_generic_type): Use the cache.
26910 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
26912         * object.c: fixed gc descriptor calculation for embedded valuetypes.
26914 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26916         * icall.c: added Socket.WSAIoctl icall.
26918         * socket-io.[ch]: implemented
26919         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
26921 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
26923         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
26925 2004-02-18  Urs C Muff  <umuff@quark.com>
26927         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
26928         this work on PPC and other big-endian architectures.
26930         * debug-mono-symfile.h: Prepended the names of all the `guint32'
26931         fields with an underscore to make sure they're only accessed by
26932         the read32() macro.
26934 2004-02-18  Martin Baulig  <martin@ximian.com>
26936         * icall.c: Put the klass->refclass changes back for methods and
26937         fields, but not for properties and events.  We're currently not
26938         distinguishing between DeclaringType and ReflectedType for
26939         properties and events, that's what caused the regressions.
26941 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26943         * object.c:
26944         (mono_async_result_new): the handle can be NULL.
26946         * threadpool.c: Use an event instead of a semaphore, don't initialize
26947         it until needed. This saves quite a few semaphores from being created
26948         when using the threadpool.
26950 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
26952         * object.c (mono_string_is_interned_lookup): Fix interning of long
26953         strings. Fixes #54473.
26955         * domain.c (ldstr_equal): Optimize if the two strings are equal.
26957         * icall.c: Revert the klass->refclass changes since they introduce
26958         regressions (bug #54518).
26960 2004-02-18  Martin Baulig  <martin@ximian.com>
26962         * class.c (mono_class_init): If we're a generic instance and don't
26963         come from a TypeBuilder, inflate our members here.
26964         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
26965         (mono_class_create_generic): New public method.
26966         (mono_class_initialize_generic): Removed.
26967         (get_instantiation_name): Renamed to
26968         _mono_class_get_instantiation_name() and made it public.
26970 2004-02-18  Martin Baulig  <martin@ximian.com>
26972         * class.c (mono_class_inflate_generic_type): Clear the new
26973         instance's `nginst->klass' when inflating a generic instance.
26974         (mono_class_is_subclass_of): Added (basic) support for generic
26975         instances.
26977 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
26979         * appdomain.h, domain.c: use a MonoCodeManager instead of a
26980         MonoMempool to hold compiled native code.
26982 2004-02-17  Martin Baulig  <martin@ximian.com>
26984         * class.h (MonoDynamicGenericInst): Added `count_properties' and
26985         `properties'.
26987         * reflection.c (mono_reflection_generic_inst_initialize): Added
26988         `MonoArray *properties' argument.
26990         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
26992 2004-02-17  Martin Baulig  <martin@ximian.com>
26994         * icall.c (ves_icall_Type_GetFields): Renamed to
26995         ves_icall_Type_GetFields_internal() and added a
26996         `MonoReflectionType *rtype' argument; pass it to
26997         mono_field_get_object() to set the field's "reflected" type.
26998         (ves_icall_Type_GetConstructors): Likewise.
26999         (ves_icall_Type_GetEvents): Likewise.
27000         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
27001         argument; pass it to mono_method_get_object() to set the method's
27002         "reflected" type.       
27004 2004-02-17  Martin Baulig  <martin@ximian.com>
27006         * class.h (MonoDynamicGenericInst): New type.
27007         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
27009         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
27010         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
27011         (ves_icall_MonoGenericInst_GetFields): New interncall.
27013         * class.c (mono_class_from_generic): Don't call
27014         mono_class_initialize_generic() if this is a dynamic instance;
27015         ie. it's being created from a TypeBuilder.
27016         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
27017         `class->byval_arg.type'.
27019         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
27020         to `inflate_method' and made static.
27021         (mono_reflection_inflate_field): Removed.
27022         (mono_reflection_generic_inst_initialize): New public method.
27024         * reflection.h (MonoReflectionGenericInst): Removed `methods',
27025         `ctors' and `fields'; added `initialized'.
27027 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
27029         * debug-helpers.c (mono_method_full_name): Fix output for empty
27030         namespaces.
27032 2004-02-12  Martin Baulig  <martin@ximian.com>
27034         * class.h (MonoClassField): Added `MonoType *generic_type'.
27036         * reflection.c (mono_image_get_fieldref_token): Added support for
27037         instantiated generic types.
27038         (field_encode_inflated_field): Removed.
27039         (mono_image_get_inflated_field_token): Removed.
27040         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
27042         * reflection.h (MonoReflectionInflatedField): Removed.
27044 2004-02-12  Martin Baulig  <martin@ximian.com>
27046         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
27047         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
27049         * reflection.c (mono_image_get_methodspec_token): Take a
27050         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
27051         (mono_image_create_token): Check whether we have a
27052         `method->signature->gen_method' and call
27053         mono_image_get_methodspec_token() if appropriate.
27054         (inflated_method_get_object): Removed.
27055         (mono_reflection_bind_generic_method_parameters): Return a
27056         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
27057         (mono_reflection_inflate_method_or_ctor): Likewise.
27059         * reflection.h (MonoReflectionInflatedMethod): Removed.
27061 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
27063         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
27064         for custom valuetype marshalling.
27066         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
27068 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27070         * icall.c: fixed WSAGetLastError_internal name.
27072 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
27074         * threads.c (mono_thread_attach): Allow this to be called multiple
27075         times for a thread.
27076         
27077         * threads.c (build_wait_tids): Do not wait for ourselves.
27079         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
27080         appdomain list is empty.
27082         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
27083         memory returned by mono_string_builder_to_utf16, since it points into
27084         managed memory. Thanks to Bernie Solomon for noticing this.
27086         * icall.c: Add AppDomainSetup icalls.
27088         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
27090         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
27091         types.
27093         * reflection.c (reflection_methodbuilder_to_mono_method): Save
27094         custom attributes to the method_aux struct. Also fix array indexes etc.
27096         * loader.c (mono_method_get_param_names): Make dynamic case work again.
27097         
27098 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
27100         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
27101         (both static and runtime) and reduce startup time.
27103 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
27105         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
27106         AsAny marshalling conversion instead of crashing.
27108         * marshal.c: Fix warnings.
27110 2004-02-09  Martin Baulig  <martin@ximian.com>
27112         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
27114         * reflection.h (MonoReflectionInflatedMethod): Removed the
27115         `declaring' field, it's now in the unmanaged MonoGenericMethod.
27117         * reflection.c (method_encode_methodspec): Removed the `method'
27118         argument; we get it from `gmethod->declaring'.
27119         (inflated_method_get_object): Removed the `declaring' argument.
27121 2004-02-09  Martin Baulig  <martin@ximian.com>
27123         * class.h (MonoGenericMethod): New type.
27124         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
27125         `generic_method'.
27127         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
27128         a `MonoGenericMethod *gen_method' one.
27130         * class.c (mono_class_inflate_generic_type): Take an additional
27131         `MonoGenericMethod * argument.  This is only non-NULL if we're
27132         inflating types for a generic method.   
27133         (mono_class_inflate_generic_signature): Renamed to
27134         inflate_generic_signature() and made static; take a
27135         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
27136         (inflate_generic_header): Take a `MonoGenericMethod *' argument
27137         instead of a `MonoGenericInst *' one.
27138         (mono_class_inflate_generic_method): Likewise.
27140         * reflection.c (encode_generic_method_sig): Take a
27141         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
27142         (method_encode_methodspec): Likewise.
27143         (inflated_method_get_object): Likewise. 
27145         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
27146         field with a `MonoGenericMethod *gmethod' one.  
27148 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
27150         * class.h (mono_class_has_parent): add parens to expansion
27151         so you can ! this.
27153 2004-02-08  Martin Baulig  <martin@ximian.com>
27155         * image.h (MonoImage): Removed `generics_cache'.
27157         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
27158         instead of a `MonoType *' argument; removed the `inflate_methods'
27159         argument.  Don't inflate methods here.
27161         * loader.c (find_method): If it's a generic instance, call
27162         mono_class_init() on the `sclass->generic_inst->generic_type'.
27164         * metadata.c (mono_type_size): Make this work on uninitialized
27165         generic instances; call it on the `ginst->generic_type's class.
27167         * reflection.c (mono_reflection_bind_generic_parameters): Call
27168         mono_class_from_generic() to create the `ginst->klass'.
27170 2004-02-08  Martin Baulig  <martin@ximian.com>
27172         * class.h (MonoClass): Changed type of `generic_inst' from
27173         `MonoType *' to `MonoGenericInst *'.
27175 2004-02-08  Martin Baulig  <martin@ximian.com>
27177         * icall.c (ves_icall_Type_BindGenericParameters): Just call
27178         mono_type_get_object(), this is now creating a `MonoGenericInst'
27179         for MONO_TYPE_GENERICINST.
27180         (ves_icall_MonoGenericInst_GetParentType): Likewise.
27181         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
27183         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
27184         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
27185         (inflated_method_get_object): Added `MonoClass *refclass' argument.
27186         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
27187         and reflected type.
27189         * reflection.h (MonoReflectionInflatedMethod): Removed
27190         `declaring_type' and `reflected_type'.
27192 2004-02-08  Martin Baulig  <martin@ximian.com>
27194         * class.h (MonoGenericInst): Added `MonoType *parent' and
27195         `MonoType **ifaces'.
27197         * reflection.h (MonoReflectionGenericInst): Removed `klass',
27198         `parent' and `interfaces'.
27200         * reflection.c (mono_reflection_bind_generic_parameters): Take a
27201         `MonoType *' argument and return a `MonoType *'.
27203         * icall.c
27204         (ves_icall_MonoGenericInst_GetParentType): New interncall.
27205         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
27207 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
27209         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
27210         valuetype marshalling.
27212 2004-02-06  Martin Baulig  <martin@ximian.com>
27214         * class.c
27215         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
27216         (my_mono_class_from_generic_parameter): Likewise.
27218 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
27220         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
27221         contents of the symbol files lazily.
27223         * object.h (MonoThread): Add 'name' and 'name_len' fields.
27225         * threads.h threads.c icall.c: New icalls for getting and setting the
27226         threads name.
27228 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
27230         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
27231         Raise an exception when the domain is not found.
27233 2004-02-03  Martin Baulig  <martin@ximian.com>
27235         * reflection.c (mono_image_get_methodspec_token): Use the
27236         uninflated signature; fixes gen-33.
27238 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
27240         * gc.c threads.c: Make the finalizer thread a normal managed thread so
27241         the finalizer code can use thread functionality.
27243         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
27244         the finalizer thread.
27246         * threads.c: Make some functions more robust.
27248         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
27250         * metadata.h: Add new marshalling conventions.
27252         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
27253         stringbuilder marshalling. Fixes #53700.
27255         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
27257         * reflection.c (mono_image_get_type_info): Save declarative security
27258         info.
27260         * reflection.c (mono_image_get_field_info): Handle uninitialized 
27261         unmanaged fields as well.
27263         * appdomain.c: Bump corlib version.
27265 2004-02-01  Martin Baulig  <martin@ximian.com>
27267         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
27268         method type arguments.  
27270 2004-01-30  Duncan Mak  <duncan@ximian.com>
27272         * marshal.h: Add prototype for
27273         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
27274         and
27275         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
27276         fix the build.
27278 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
27280         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
27281         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
27283 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
27285         * marshal.c (mono_marshal_get_native_wrapper): Add support for
27286         custom marshalling of valuetypes.
27288         * marshal.c: Fix some warnings.
27290 2004-01-29  Martin Baulig  <martin@ximian.com>
27292         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
27293         for generic method parameters.
27295         * reflection.c (method_encode_methodspec): Write the uninflated
27296         signature into the methodspec table.
27297         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
27298         is always the uninflated method.
27299         (reflection_methodbuilder_to_mono_method): Copy the generic
27300         parameters from the MethodBuilder into `header->gen_params'.
27302 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
27304         * class.c (mono_class_from_generic_parameter): Fix warning.
27306 2004-01-27  Martin Baulig  <martin@ximian.com>
27308         * class.c (mono_class_from_generic_parameter): Don't create
27309         `klass->methods' here.  
27311 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
27313         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
27314         extension since it does not work with libraries named lib<FOO>.dll.so.
27316 2004-01-25  Martin Baulig  <martin@ximian.com>
27318         * class.c (mono_class_inflate_generic_type): Added support for
27319         MONO_TYPE_GENERICINST.
27321         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
27322         inflate methods on open constructed types.      
27324 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27326         * object.c: fire ProcessExit event in the root AppDomain after running
27327         Main. Fixes bug #53299.
27329 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
27331         * socket-io.c: include the new socket-wrappers.h header.
27332         Use the wrappers instead of the unix socket functions to make the code
27333         more clear.
27335 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
27337         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
27339         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
27340         Fixes #22532.
27342 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
27344         * reflection.c (mono_image_create_pefile): Handle the case when the
27345         entry point is not a MethodBuilder.
27347         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
27348         field to ReflectionMethod since it is not allways a builder.
27350         * reflection.c (type_get_fully_qualified_name): New helper function to
27351         return the fully qualified name of a type.
27353         * reflection.c (encode_marshal_blob): Always emit the fully qualified
27354         type name for custom marshallers.
27356         * reflection.c (mono_marshal_spec_from_builder): Ditto.
27358         * class.c (mono_class_setup_vtable): If a parent class already 
27359         implements an interface, use the implementing methods from that class.
27360         Fixes #53148.
27362 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27364         * threadpool.c: just return instead of ExitThread to allow for thread
27365         clean up earlier.
27367 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
27369         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
27370         when closing resource modules.
27372         * reflection.c (mono_image_create_pefile): Handle the case when the
27373         entry point is not a MethodBuilder.
27375         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
27376         field to ReflectionMethod since it is not allways a builder.
27378 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
27380         * marshal.c (mono_marshal_get_managed_wrapper): 
27381         mono_marshal_alloc takes native int so CONV_I
27382         the arg for 64bits.
27384 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
27386         * reflection.c (fixup_cattrs): New function to fixup the methoddef
27387         tokens in the cattr table. Fixes #53108.
27389 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27391         * loader.c: don't trim ".dll" before looking up in the config file.
27392         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
27394 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
27396         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
27397         Return the module which contains the resource as well.
27398         (ves_icall_System_Reflection_Module_Close): New icall.
27400         * appdomain.c: Bump corlib version number.
27402         * image.c (mono_image_addref): New public function.
27404         * assembly.c: Call mono_image_addref.
27406         * reflection.c (mono_module_get_object): Increase reference count of 
27407         the image.
27409         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
27410         Fixes #22532.
27412         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
27413         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
27414         proper exceptions on DllImport problems.
27416 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
27418         * class.c, metadata.c: eliminate CSIZE macro.
27420 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
27422         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
27423         * object.h: Added async_callback field in MonoAsyncResult.
27424         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
27425         * verify.c: Added async_callback in MonoAsyncResult layout.
27427 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
27429         * reflection.c (mono_reflection_get_custom_attrs): Add support
27430         for Modules.
27432 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
27434         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
27435         marshalling.
27436         (mono_marshal_method_from_wrapper): Add null pointer check.
27438 2004-01-16  Martin Baulig  <martin@ximian.com>
27440         * debug-mono-symfile.h: Set version number to 36 and reflect
27441         latest symbol writer changes.
27443 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
27445         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
27446         multi-dimensional arrays.
27447         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
27448         (mono_class_from_mono_type): Use bounded_array_class_get.
27449         
27450         * class.c (mono_bounded_array_class_get): New function which takes
27451         a 'bounded' bool argument to distinguish vectors from one dimensional
27452         arrays.
27454         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
27455         bounded_array_class_get if the array has bounds.
27457         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27458         Search modules loaded using AssemblyBuilder:AddModule as well.
27460 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27462         * appdomain.c: increased corlib version.
27463         * filewatcher.c: removed g_print.
27464         * icall.c:
27465         (get_property_info): only allocate what is actually requested.
27466         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
27468 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27470         * Makefile.am: added filewatcher.[ch]
27471         * filewatcher.[ch]: FileSystemWatcher runtime support.
27472         * icall.c: added new FSW icalls.
27474 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
27476         * string-icalls.c: fix stringbuilder regression as suggested by
27477         Iain McCoy <iain@mccoy.id.au>.
27479 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
27481         * process.c (process_read_stringtable_block): Recognize '007f' as
27482         a language neutral stringtable block.
27484 2004-01-12  Patrik Torstensson
27486         * object.h (MonoStringBuilder) : Changed layout to support our
27487         new stringbuilder class.
27488         * marshal.c: Change marshalling to support the new layout of 
27489         string builder.
27490         * appdomain.c: increased version number because new layout of
27491         string builder.
27493 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
27495         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
27496         assembly name as an string instead of an AssemblyName, since it is
27497         easier to extract info from it.
27499         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
27500         the culture subdirectories too. Fixes #52231.
27502 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27504         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
27505         It takes 2 new parameters with an optional name for the method to look
27506         for and case ignoring info.
27508         * threadpool.c: removed unused variable.
27510 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27512         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
27513         It takes 2 new parameters with an optional name for the property to look
27514         for and case ignoring info.
27515         Fixes bug #52753.
27517 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
27519         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
27520         Fix #52451.
27522 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27524         * appdomain.c:
27525         * assembly.c: escape the uri before passing it to g_filename_from_uri.
27526         Fixes bug #52630.
27528 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
27530         * reflection.c: Add support for more than one unmanaged resource.
27532         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
27533         in field->def_value, as done in all other cases.
27535         * reflection.c (mono_reflection_get_custom_attrs): Add support for
27536         TypeBuilders.
27538         * reflection.c (mono_reflection_create_runtime_class): Remove 
27539         errorneous assignment to klass->element_class, since it is already
27540         done in mono_reflection_setup_internal_class.
27542 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27544         * gc.c: added missing LeaveCriticalSection.
27545         * icall.c: indented a couple of lines.
27546         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
27547         if we call EndInvoke inside a callback. Fixes bug #52601.
27549 2004-01-07  Martin Baulig  <martin@ximian.com>
27551         * mono-debug-debugger.h
27552         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
27554 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
27556         * appdomain.c: Use messages in NotImplementedException.
27558         * exception.c (mono_get_exception_not_implemented): Now this takes
27559         a message argument.
27561         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
27562         exception instead of g_asserting an aborting when something is not
27563         implemented.
27565         Add some inline docs.
27567 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
27569         * reflection.h: Update after changes to object layout.
27571         * reflection.c: Implement saving of unmanaged aka win32 resources.
27573         * appdomain.c: Bump version number.
27575         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
27576         Handle missing domains gracefully.
27578 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
27580         * file-io.c : On Windows, there are much more invalid_path_chars.
27582 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
27584         * class.h, object.c: prepare for GetType () speedup.
27586 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
27588         * profiler.c: workaround for --profile null reference exception on
27589           cygwin. Patch by Patrik Torstensson.
27591 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
27593         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
27594         make work for unaligned access.
27596 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
27598         * class.c: small cleanup (class->fields [i] -> field).
27599         * image.c: check address of metadata is valid.
27601 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
27603         * assembly.h assembly.c (mono_assembly_loaded): New public function to
27604         search the list of loaded assemblies.
27606         * reflection.c (mono_reflection_type_from_name): Use 
27607         mono_assembly_loaded instead of mono_image_loaded.
27609         * reflection.c: Fix warnings.
27611 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
27613         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
27614         is dynamic. This is needed since an assembly can contain both dynamic and
27615         non-dynamic images.
27617         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
27618         assembly->dynamic.
27620         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
27622         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
27623         to store modules loaded using AddModule.
27625         * reflection.c (mono_image_fill_file_table): Generalize this so it works
27626         on Modules.
27628         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
27630         * reflection.c (mono_image_fill_export_table_from_module): New function to
27631         fill out the EXPORTEDTYPES table from a module.
27633         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
27634         into a separate function. Also handle loaded non-dynamic modules.
27636         * reflection.c (mono_image_basic_init): Fix memory allocation.
27638         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
27640         * assembly.c (mono_assembly_load_references): Make this public.
27642 2003-12-19  Martin Baulig  <martin@ximian.com>
27644         * class.c (mono_class_initialize_generic): Made this static, take
27645         a `MonoGenericInst *' instead of a `MonoClass *'.
27646         (mono_class_from_generic): Call mono_class_initialize_generic()
27647         unless we're already initialized or being called from
27648         do_mono_metadata_parse_generic_inst().
27650         * class.h (MonoGenericInst): Added `initialized' and
27651         `init_pending' flags.
27653         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
27654         `mono_class_init (gklass)' or mono_class_initialize_generic()
27655         here; set `generic_inst->init_pending' while parsing the
27656         `type_argv'.
27658 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
27660         * locales.c: include string.h for memxxx prototypes
27662 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
27664         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
27665         constructor when accessing literal fields.
27667 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
27669         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
27671         * reflection.c (assembly_add_resource_manifest): New function to fill
27672         the MANIFESTRESOURCE table.
27674         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
27676         * reflection.h: Update to changes in class layout.
27678         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
27679         Reenable call to mono_runtime_is_shutting_down ().
27681         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
27682         determine if the runtime is shutting down.
27684 2003-12-16  Jackson Harper <jackson@ximian.com>
27686         * icall.c: comment out call to mono_runtime_is_shutting_down to
27687         fix build.
27688         
27689 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
27691         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
27692         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
27694 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
27696         * reflection.c: move definition of swap_with_size
27697         to before its first call
27699 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
27701         * appdomain.c (mono_runtime_is_shutting_down): New public function.
27703         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
27704         icall.
27706         * object.c: Fix warnings.
27708         * icall.c (ves_icall_Type_Get...): Only consider inherited static
27709         members if FlattenHierarchy is set.
27711         * reflection.c (mono_image_add_decl_security): New function to emit
27712         declarative security.
27714         * reflection.h reflection.c: Add support for declarative security.
27716         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
27717         
27718 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
27720         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
27721         
27722         * appdomain.c verify.c: Moved corlib version checking into its own
27723         function in appdomain.c since it needs to create vtables etc.
27725 2003-12-13  Patrik Torstensson <p@rxc.se>
27727         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
27728         instead of unwrapped server.
27730 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
27732         * verify.c (check_corlib): Fix field index.
27734 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
27736         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
27737         GetGacPath icall.
27739 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
27741         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
27742         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
27743         cope with sizeof(size_t) != sizeof(guint32).
27745 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27747         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
27748         in case of failure.
27750 2003-12-10  Mark Crichton <crichton@gimp.org>
27752         * icall.c: removed the GetNonZeroBytes.  We now handle this case
27753         in managed code.
27755         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
27757 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
27759         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
27760         marked as deleted.
27762 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
27764         * verify.c (check_corlib): Handle the case when the version field is 
27765         initialized by a static constructor.
27767 2003-12-08  Patrik Torstensson  <p@rxc.se>
27769     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
27771 2003-12-08  Martin Baulig  <martin@ximian.com>
27773         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
27774         a MonoReflectionGenericParameter, also take the parameter index
27775         and name as arguments.
27776         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
27777         (ves_icall_MonoGenericParam_initialize): New interncall.
27778         (ves_icall_Type_make_byref_type): New interncall.
27780         * reflection.h (MonoReflectionGenericParam): Derive from
27781         MonoReflectionType, not just from MonoObject.  Added `refobj' and
27782         `index' fields.
27784         * reflection.c (mono_reflection_define_generic_parameter): Create
27785         and return a new MonoReflectionGenericParam; don't initialize the
27786         constraints here.
27787         (mono_reflection_initialize_generic_parameter): New public method;
27788         initializes the constraints and creates the `param->pklass'.
27790 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
27792         * reflection.h reflection.c: Use the new fields 'num_types', 
27793         'num_fields' and 'num_methods' to track the number of types etc.
27795         * verify.c (check_corlib): Check corlib version number.
27797 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
27799         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
27800         function works on all methods.
27802 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
27804         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
27805         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
27806         the custom_type_info flag of the transparent proxy.
27807         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
27808         objects that supports IRemotingTypeInfo.
27809         * object.h: Added custom_type_info field in transparent proxy.
27811 2003-12-06  Martin Baulig  <martin@ximian.com>
27813         * class.c (mono_class_create_from_generic): Removed.
27814         (mono_class_from_generic): Check `ginst->klass' before doing
27815         anything else.  This is important to fully support "recursive"
27816         generic types.
27818         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
27819         empty `generic_inst->klass' before doing anything else.
27821 2003-12-06  Dick Porter  <dick@ximian.com>
27823         * verify.c: 
27824         * object.h:
27825         * icall.c:
27826         * locales.c: Use C structs to access class fields.  Don't do a
27827         conversion between MonoString and UChar because both are
27828         platform-endian UTF-16.  Compare now takes startindex and count
27829         parameters.  Add a char overload for IndexOf.  Speed up the
27830         invariant string IndexOf.
27832 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
27834         * Makefile.am (monosn_LDADD): Fix parallel build.
27836 2003-12-04  Martin Baulig  <martin@ximian.com>
27838         * icall.c
27839         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
27840         (ves_icall_Type_make_array_type): New interncall.       
27842 2003-12-04  Martin Baulig  <martin@ximian.com>
27844         * locales.c: also change it in the !HAVE_ICU case.
27846 2003-12-04  Dick Porter  <dick@ximian.com>
27848         * icall.c:
27849         * locales.c: construct_compareinfo is now in CompareInfo, not
27850         CultureInfo.
27852 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
27854         * image.c (mono_image_load_file_for_image): Cache loaded images in the
27855         image->files array.
27857         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
27858         table as well.
27860         * assembly.c (mono_assembly_load_references): Only load references
27861         once.
27863         * class.c (mono_class_from_name): Avoid linear search of the 
27864         EXPORTEDTYPE table.
27866         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
27868 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
27870         * image.h (MonoImage): Add 'field_cache' field.
27872         * loader.c (mono_field_from_token): Cache field lookups.
27873         
27874         * reflection.c (mono_module_get_object): Fix name property.
27876         * icall.c (ves_icall_get_enum_info): Update after changes to 
27877         mono_metadata_get_constant_index ().
27879         * icall.c: Get rid of get_type_info icall, use a separate icall for
27880         each type property to avoid needless memory allocations. Fixes #51514.
27882         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
27883         to avoid needless binary searches.
27885         * class.c (class_compute_field_layout): Move the initialization of
27886         field->def_value to mono_class_vtable ().
27888         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
27889         non-corlib types.
27891         * object.c (mono_object_allocate): Make it inline.
27893         * object.c (mono_object_allocate_spec): Make it inline.
27894         
27895 2003-12-02  Dick Porter  <dick@ximian.com>
27897         * locales.c (create_NumberFormat): NumberFormatInfo construction.
27898         Patch by Mohammad DAMT (mdamt@cdl2000.com).
27900 2003-12-01  Dick Porter  <dick@ximian.com>
27902         * threads.c: Fix signature and call in CreateMutex and
27903         CreateEvent.
27905 2003-12-01  Dick Porter  <dick@ximian.com>
27907         * icall.c: 
27908         * locales.c: Implement string compares and searching
27910         * object.h: Add extra Thread field
27912 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
27914         * reflection.c (fixup_method): Add support for MonoCMethod.
27916 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
27918         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
27920         * reflection.c (assembly_name_to_aname): Allow extra characters in
27921         assembly names. Fixes #51468.
27923 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
27925         * exception.c (mono_exception_from_name_domain): New helper function.
27927         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
27928         exception object in the correct domain.
27930         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
27931         formatting + make a copy a the input data.
27933         * loader.c (mono_get_method_from_token): Methods which contain
27934         native code do not have entries in the ImplMap.
27936         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
27937         Thanks to Gonzalo for spotting this.
27938         
27939         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
27940         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
27942         * assembly.h (mono_assembly_load_from): Split the second part of 
27943         assembly loading into a new public function.
27945         * exception.h (mono_get_exception_bad_image_format): New function.
27947 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
27949         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27950         Enumerate all modules inside a dynamic assembly. Fixes #51293.
27951         
27952         * icall.c: Add new icall for creating dynamic methods.
27954         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
27956         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
27958         * reflection.c (mono_reflection_create_dynamic_method): New icall to
27959         create a dynamic method.
27961         * reflection.c (resolve_object): New helper function.
27963         * reflection.c: Generalize ReflectionMethodBuilder and the functions
27964         which manipulate it so they can also work on dynamic methods.
27966         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
27967         creating the MonoReflectionMethodAux structure if it is not needed.
27968         
27969         * reflection.h verify.c: Update after changes to object layout.
27971         * reflection.c (method_builder_encode_signature): Fix compilation on
27972         gcc 2.95.x.
27974 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
27976         * appdomain.h: Added support for context static fields. Added static_data
27977           field to MonoAppContext and renamed thread_static_fields to a more
27978           generic special_static_fields in MonoAppDomain, since it can now contain
27979           context static fields.
27980         * domain.c: Updated hashtable name.
27981         * object.c: Replaced field_is_thread_static() for a more generic
27982           field_is_special_static() which also checks for context static attribute.
27983           In mono_class_vtable(), added support for static context fields.
27984         * threads.c: Changed methods that manage thread static fields to more
27985           generic methods so they can be reused both for thread and context static
27986           data.
27987         * threads.h: Declared some new methods.
27989 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
27991         * reflection.h: Update after changes to the managed types.
27993         * reflection.c (encode_custom_modifiers): New helper function.
27995         * reflection.c (method_encode_signature): Emit custom modifiers.
27997         * reflection.c (field_encode_signature): Emit custom modifiers.
27999 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
28001         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
28003         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
28004         implementation.
28006         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
28007         icall.
28009         * object.c (mono_field_get_value_object): New function.
28011         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
28012         specific.
28014 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
28016         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
28017         return a preallocated out-of-memory exception instance.
28019         * object.c (out_of_memory): Use the new function.
28021         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
28022         flag is before the custom modifiers. Fixes #49802.
28024 2003-11-16  Martin Baulig  <martin@ximian.com>
28026         * class.c (mono_class_is_open_constructed_type): Implemented the
28027         MONO_TYPE_GENERICINST case.
28029 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
28031         * assembly.c (mono_assembly_fill_assembly_name): New function to
28032         fill out the MonoAssemblyName structure.
28033         (mono_assembly_open): Use the new function.
28035         * icall.c (fill_reflection_assembly_name): New helper function.
28037         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
28038         new function.
28040         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
28042 2003-11-15  Martin Baulig  <martin@ximian.com>
28044         * class.c (mono_class_is_open_constructed_type): New public
28045         function; checks whether a type is an open constructed type,
28046         ie. whether it still contains type parameters.
28047         (mono_class_inflate_generic_type): If we're a type parameter and
28048         the inflated type is also a MONO_TYPE_(M)VAR, return the original
28049         type.
28051         * class.h (MonoGenericInst): Added `guint32 is_open'.
28053         * loader.c (method_from_methodspec): Check whether we're an open
28054         or closed constructed type and set `ginst->is_open'.
28056         * reflection.c (mono_reflection_bind_generic_parameters): Check
28057         whether we're an open or closed constructed type and set
28058         `ginst->is_open'.
28059         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
28060         from open constructed types.
28062 2003-11-15  Martin Baulig  <martin@ximian.com>
28064         * reflection.c (mono_reflection_bind_generic_parameters): If we're
28065         a generic instance (instead of a generic type declaration) with
28066         unbound generic parameters, bind them to our actual types.
28068 2003-11-14  Martin Baulig  <martin@ximian.com>
28070         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
28072         * reflection.c (mono_reflection_bind_generic_parameters): If we're
28073         an interface type, populate `res->interfaces' with instantiated
28074         versions of all the interfaces we inherit.
28076 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
28078         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
28079         when MONO_PATH is set but doesn't contain the install dir.
28081 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28083         * icall.c:
28084         (ves_icall_Type_GetInterfaces): don't return an interface twice when
28085         it's also implemented in base classes. Fixes bug #50927.
28087 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
28089         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
28090         if this method is called from a finalizer. Fixes #50913.
28092 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
28094         * threads.c: Implement VolatileRead/VolatileWrite
28096         * icall.c: Add new icalls for VolatileRead/VolatileWrite
28098 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
28100         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
28101         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
28102         2.95.3.
28104         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
28105         from Peter Ross (pro@missioncriticalit.com).
28106         
28107 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
28109         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
28111 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
28113         * assembly.c (mono_assembly_load_references): Disable check because it
28114         triggers on older corlibs which lots of people have.
28116 2003-11-12  Jackson Harper  <jackson@ximian.com>
28118         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
28119         load corlib.dll if mscorlib.dll is not found.
28120         * assembly.h: Remove corlib name define.
28121         * class.c:
28122         * domain.c:
28123         * image.c: Change corlib name to mscorlib.
28124         
28125 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
28127         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
28129 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
28131         * appdomain.h: Added loader_optimization here to sync with the C#
28132         code, and add disallow_binding_redirects field.
28134 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
28136         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
28138         * reflection.c (mono_image_build_metadata): Fix crash on modules
28139         with no types.
28141         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
28143         * icall.c (ves_icall_get_method_info): Return callingConvention as
28144         well.
28146         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
28147         namespaces from the EXPORTEDTYPE table as well.
28149         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
28150         from all modules inside the assembly.
28151         
28152 2003-11-11  Martin Baulig  <martin@ximian.com>
28154         * reflection.c (mono_reflection_bind_generic_parameters): Make
28155         this work for interfaces.
28157 2003-11-11  Martin Baulig  <martin@ximian.com>
28159         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
28161 2003-11-11  Martin Baulig  <martin@ximian.com>
28163         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
28164         "MonoInflatedMethod" and "MonoInflatedCtor".
28166 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
28168         * reflection.c (resolution_scope_from_image): Use the assembly table
28169         from the manifest module, since other modules don't have it.
28171         * debug-helpers.c (mono_type_full_name): New helper function.
28173         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
28175         * image.c (mono_image_load_file_for_image): New public function which
28176         is a replacement for the load_file_for_image in class.c.
28178         * assembly.c (mono_assembly_load_module): A wrapper for the function
28179         above which does assembly association and reference loading too.
28181         * class.c (mono_class_from_name): Call mono_assembly_load_module.
28183 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28185         * appdomain.c: not all of the attributes for the full assembly name
28186         are required and the order doesn't matter. Fixes bug #50787.
28188 2003-11-10  Dick Porter  <dick@ximian.com>
28190         * locales.c: Use platform-endian UTF16
28192 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
28194         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
28195         
28196 2003-11-10  Martin Baulig  <martin@ximian.com>
28198         * metadata.c
28199         (mono_metadata_load_generic_params): Make this actually work.
28201         * reflection.c (mono_reflection_bind_generic_parameters): If our
28202         parent is a generic instance, pass all the `types' to it, no
28203         matter whether it has the same number of type parameters or not.
28205 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
28207         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
28209         * assembly.c (mono_assembly_load_references): Move the image<->assembly
28210         assignment code to this function so it gets called recursively for all
28211         modules.
28213         * image.c (load_modules): Remove the assembly assignment since it is
28214         now done by mono_assembly_load_references.
28215         
28216         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
28217         Add 'module' argument.
28218         (mono_module_get_types): New helper function.
28219         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
28221 2003-11-08  Martin Baulig  <martin@ximian.com>
28223         * class.c (mono_class_inflate_generic_method): Interface method
28224         don't have a header.
28226         * reflection.c (mono_image_get_methodspec_token): Take an
28227         additional `MonoGenericInst *' argument instead of reading it from
28228         the header; this is necessary to support interfaces.
28229         (mono_image_create_token): Pass the `MonoGenericInst *' from the
28230         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
28231         (inflated_method_get_object): Take an additional `MonoGenericInst *'
28232         argument.
28234         * reflection.h (MonoReflectionInflatedMethod): Added
28235         `MonoGenericInst *ginst'.
28237 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
28239         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
28241 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
28243         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
28245 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
28247         * reflection.c 
28248         (reflection_methodbuilder_from_method_builder):
28249         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
28250         initialize a ReflectionMethodBuilder structure.
28251         (mono_image_get_methodbuilder_token):
28252         (mono_image_get_ctorbuilder_token): New functions to emit memberref
28253         tokens which point to types in another module inside the same assembly.
28255         * reflection.c: Use the new helper functions.
28256         
28257         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
28259         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
28260         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
28262         * reflection.c (resolution_scope_from_image): Emit a moduleref if
28263         neccesary.
28265         * reflection.c (mono_image_build_metadata): Emit metadata only for the
28266         current module. Emit the manifest only for the main module.
28268         * reflection.c (mono_image_create_token): Add assertion when a 
28269         memberref needs to be created.
28271         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
28273         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
28274         larger buffer for the custom attribute blob. Fixes #50637.
28275         
28276 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28278         * threadpool.c: notify listener on async processing handles after
28279         invoking the async callback. Thanks to Zoltan.
28281 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
28283         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
28284         avoid code duplication.
28286         * reflection.h (MonoDynamicImage): New type which is currently unused,
28287         but will be used through the ref.emit code in place of 
28288         MonoDynamicAssembly.
28290         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
28291         object layout.
28293         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
28294         a MonoDynamicImage instead of just a MonoImage.
28295         
28296         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
28297         icalls to ModuleBuilder but keep their semantics, so they will work
28298         with moduleb->assemblyb. This will change later.
28299         
28300 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
28302         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
28303         object layout.
28305         * reflection.c (mono_image_build_metadata): Avoid creation of a default
28306         main module, since it is now done by the managed code.
28308 2003-11-03  Martin Baulig  <martin@ximian.com>
28310         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
28311         `ginst->klass' here.
28312         (method_encode_methodspec): Don't use the `ginst->generic_method's
28313         klass if it's a generic instance, use `ginst->klass' in this case.
28315 2003-11-03  Martin Baulig  <martin@ximian.com>
28317         * reflection.c (mono_image_get_generic_method_param_info):
28318         Removed, use mono_image_get_generic_param_info() instead.
28319         (mono_image_get_type_info): Write the GenericParam table before
28320         the Method table.  This is neccessary because in the GenericParam
28321         table, type parameters of the class (ie. '!0' etc.) must come
28322         before the ones from its generic methods (ie. '!!0' etc).
28324 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
28326         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
28328 2003-11-02  Martin Baulig  <martin@ximian.com>
28330         * reflection.c (create_generic_typespec): Take a
28331         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
28332         the generic parameters from it.
28334 2003-11-02  Martin Baulig  <martin@ximian.com>
28336         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
28337         instead of a `MonoClassField *' since we just need the type.
28338         (create_generic_typespec): New static function.  Creates a
28339         TypeSpec token for a generic type declaration.
28340         (mono_image_get_generic_field_token): New static function.
28341         (mono_image_create_token): If we're a FieldBuilder in a generic
28342         type declaration, call mono_image_get_generic_field_token() to get
28343         the token.
28345 2003-11-02  Martin Baulig  <martin@ximian.com>
28347         * reflection.h
28348         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
28349         `MonoReflectionGenericInst *declaring_type' and
28350         `MonoReflectionGenericInst *reflected_type' fields.
28352         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
28353         `MonoReflectionGenericInst *declaring_type' and a
28354         `MonoReflectionGenericInst *reflected_type' argument instead of a
28355         single `MonoReflectionGenericInst *type' one.  Set
28356         `res->declaring_type' and `res->reflected_type' from them.
28357         (mono_reflection_inflate_field): Likewise.      
28359 2003-11-02  Martin Baulig  <martin@ximian.com>
28361         * class.c (mono_class_setup_vtable): Don't store generic methods
28362         in the vtable.  
28364 2003-11-02  Martin Baulig  <martin@ximian.com>
28366         * reflection.h (MonoReflectionGenericInst): Added
28367         `MonoReflectionType *declaring_type'.
28369         * reflection.c (mono_reflection_bind_generic_parameters): Use
28370         `if (tb->parent)' instead of `klass->parent'.
28372 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
28374         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
28375         with an empty ASSEMBLY table.
28377         * reflection.c (mono_image_build_metadata): Avoid using the same loop
28378         variable in the inner and outer loops.
28380 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
28382         * metadata.h (mono_metadata_make_token): Put parentheses around macro
28383         argument.
28385         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
28386         
28387         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
28388         icalls. Instead, do everything in managed code. This is needed since
28389         it is hard to restore the original domain etc. in unmanaged code in the
28390         presence of undeniable exceptions.
28392         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
28393         New icalls to push and pop appdomain refs.
28395 2003-10-31  Martin Baulig  <martin@ximian.com>
28397         * class.c (inflate_generic_type): Renamed to
28398         mono_class_inflate_generic_type() and made it public.
28400         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
28401         New interncall.
28403         * loader.c (mono_field_from_memberref): Also set the retklass for
28404         typespecs.
28406         * fielder.c (mono_image_get_inflated_field_token): New static
28407         method; creates a metadata token for an inflated field.
28408         (mono_image_create_token, fixup_method): Added support for
28409         "MonoInflatedField".
28410         (fieldbuilder_to_mono_class_field): New static function.
28411         (mono_reflection_inflate_field): New public function.
28413         * reflection.h
28414         (MonoReflectionGenericInst): Added `MonoArray *fields'.
28415         (MonoReflectionInflatedField): New typedef.     
28417 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
28419         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
28420         for Solaris and other platforms without s6_addr16
28422 2003-10-30  Martin Baulig  <martin@ximian.com>
28424         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
28425         argument instead of two.
28426         (mono_class_inflate_generic_signature): Likewise.
28427         (inflate_generic_header): Likewise.
28428         (mono_class_inflate_generic_method): Likewise.  In addition, if
28429         `ginst->klass' is set, it becomes the new `method->klass'.
28431         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
28432         field.
28434         * reflection.c (encode_generic_method_sig): Write a 0xa as the
28435         first byte. [FIXME]
28436         (method_encode_methodspec): If we have generic parameters, create
28437         a MethodSpec instead of a MethodRef.
28438         (fixup_method): Added support for "MonoInflatedMethod" and
28439         "MonoInflatedCtor".
28440         (mono_image_create_token): Added support for "MonoInflatedMethod"
28441         and "MonoInflatedCtor".
28442         (inflated_method_get_object): New static function; returns a
28443         managed "System.Reflection.MonoInflatedMethod" object.
28444         (mono_reflection_bind_generic_method_parameters): Return a
28445         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
28446         (mono_reflection_inflate_method_or_ctor): Likewise.
28447         (mono_image_get_generic_method_param_info): Initialize unused
28448         fields to zero.
28449         (mono_image_get_generic_param_info): Likewise.
28451         * reflection.h (MonoReflectionInflatedMethod): New public
28452         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
28453         "S.R.MonoInflatedCtor" classes.
28455         * loader.c (method_from_memberref): If we're a TypeSpec and it
28456         resolves to a generic instance, inflate the method.
28458 2003-10-28  Dick Porter  <dick@ximian.com>
28460         * object.c (mono_runtime_run_main): Convert command-line arguments
28461         into utf8, falling back to the user's locale encoding to do so.
28463 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
28465         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
28466         at this time.
28468         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
28470         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
28471         up icalls at method definition time. Partially fixes #33569.
28473 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
28475         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
28476         marshalling of arrays. Fixes #50116.
28478         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
28480         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
28481         points to a vtable in the dying appdomain.
28483         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
28484         listeners into unmanaged code inside the lock.
28486         * object.c (mono_class_vtable): Turn off typed allocation in non-root
28487         domains and add some comments.
28489 2003-10-25  Martin Baulig  <martin@ximian.com>
28491         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
28493         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
28495         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
28496         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
28497         currently parsing.  Create the generic class and store it in
28498         `generic_inst->klass' before parsing the type arguments.  This is
28499         required to support "recursive" definitions; see mcs/tests/gen-23.cs
28500         for an example.
28501         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
28502         to support recursive typespec entries.
28504         * class.c (mono_class_setup_parent): If our parent is a generic
28505         instance, we may get called before it has its name set.
28506         (mono_class_from_generic): Splitted into
28507         mono_class_create_from_generic() and mono_class_initialize_generic().
28509 2003-10-25  Martin Baulig  <martin@ximian.com>
28511         * icall.c (ves_icall_Type_BindGenericParameters): Return a
28512         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
28513         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
28514         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
28516         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
28517         (create_typespec): Likewise.
28518         (mono_reflection_bind_generic_parameters): Return a
28519         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
28520         (mono_reflection_inflate_method_or_ctor): New public function.
28522         * reflection.h (MonoReflectionGenericInst): New typedef.        
28524 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
28526         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
28527         inside the domain lock. Fixes #49993.
28528         
28529         * object.c (mono_class_vtable): When typed allocation is used, 
28530         allocate vtables in the GC heap instead of in the mempool, since the
28531         vtables contain GC descriptors which are used by the collector even
28532         after the domain owning the mempool is unloaded.
28534         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
28536         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
28537         reflect what it does. Also invalidate mempools instead of freeing
28538         them if a define is set.
28540         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
28541         of the appdomain.
28542         
28543         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
28544         hold the finalizable objects in this domain.
28546         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
28547         appdomain.
28549         * appdomain.c (mono_domain_set): New function to set the current
28550         appdomain, but only if it is not being unloaded.
28552         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
28553         appdomain which is being unloaded.
28554         
28555         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
28556         unloading of the root appdomain.
28558         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
28559         icall to execute a method in another appdomain. Intended as a 
28560         replacement for InternalSetDomain, which can confuse the code 
28561         generation in the JIT.
28563         * appdomain.c (mono_domain_is_unloading): New function to determine
28564         whenever an appdomain is unloading.
28566         * appdomain.c (mono_domain_unload): New function to correctly unload
28567         an appdomain.
28569         * assembly.c (mono_assembly_load_references): Check that an assembly
28570         does not references itself.
28572         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
28573         domain manually, it asks the finalizer thread to do it, then waits for
28574         the result. Also added a timeout.
28576         * icall.c: Register the new icalls.
28578         * threads.h threads.c: Export the mono_gc_stop_world and 
28579         mono_gc_start_world functions.
28580         
28581         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
28582         function to fill out the mempool with 0x2a.
28584 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
28586         * reflection.h (MonoReflectionMethodAux): New structure to store
28587         information which is rarely used, thus is not in the MonoMethod
28588         structure.
28590         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
28591         store the aux info.
28593         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
28594         and marshalling info into the aux structure.
28596         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
28597         from the aux structure.
28599         * loader.c (mono_method_get_param_names): Retrieve the param names from
28600         the aux structure.
28601         
28602 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
28604         * exception.h exception.c: Add AppDomainUnloadedException && fix 
28605         warning.
28607 2003-10-21  Dick Porter  <dick@ximian.com>
28609         * socket-io.c
28610         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
28611         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
28613 2003-10-21  Martin Baulig  <martin@ximian.com>
28615         * reflection.c (mono_reflection_bind_generic_parameters):
28616         `klass->parent' is NULL for interfaces.
28618 2003-10-21  Martin Baulig  <martin@ximian.com>
28620         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28622 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
28624         * exception.c (mono_exception_from_name_msg): New helper function for
28625         creating exceptions and initializing their message field.
28627         * exception.c: Simplify functions using the new helper.
28629         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
28630         New function.
28632         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
28633         mono_raise_exception, since otherwise gcc doesn't generate the function
28634         epilog for raise_exception, confusing the stack unwinding in the JIT.
28635         Fixes #45043.
28637         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
28638         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
28639         Fixes #49499.
28641 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28643         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
28644         utf8.
28646 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
28648         * icall.c: Removed GetUninitializedObject method because
28649           AllocateUninitializedClassInstance does the same.
28651 2003-10-18  Martin Baulig  <martin@ximian.com>
28653         * class.c (inflate_generic_signature): Renamed to
28654         mono_class_inflate_generic_signature() and made it public.
28655         (my_mono_class_from_generic_parameter): New static function; if we
28656         don't already have the generic parameter's MonoClass, create a
28657         very simple one which is just used internally in the runtime and
28658         not passed back to managed code.
28660         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
28662         * metadata.h (MonoMethodSignature): Moved the
28663         `MonoGenericParam *gen_params' to the MonoMethodHeader.
28664         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
28666         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
28667         ves_icall_MonoMethod_GetGenericArguments(); this is now an
28668         interncall on the MonoMethod class, not on MethodInfo.
28669         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
28670         calling mono_reflection_bind_generic_method_parameters() directly.
28672         * loader.c (mono_method_get_signature): If this is a MethodSpec;
28673         return the already computed `method->signature'.
28674         (method_from_methodspec): New static function to load a method
28675         from a MethodSpec entry.
28676         (mono_get_method_from_token): Call the new method_from_methodspec()
28677         for MethodSpec tokens.  
28678         (mono_get_method_from_token): If we're a generic method, load the
28679         type parameters.
28681         * reflection.c (mono_image_get_memberref_token): Allow
28682         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
28683         table.
28684         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
28685         (mono_image_create_token): First check whether it's a generic
28686         method (so we'd need to create a MethodSpec), then do the other
28687         two alternatives.
28688         (mono_reflection_bind_generic_method_parameters): Return a
28689         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
28690         called directly from the interncall.
28692 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
28694         * reflection.c (load_public_key): Move loading of the public key
28695         into managed code.
28697         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
28699         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
28700         fields.
28702         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
28703         culture, hash_alg and public_key. Fixes #49555.
28705 2003-10-17  Martin Baulig  <martin@ximian.com>
28707         * class.h (MonoGenericInst): Moved this declaration here and added
28708         `MonoMethod *generic_method'.
28710         * icall.c
28711         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
28712         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
28714         * metadata.c (mono_metadata_type_equal): Two types of
28715         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
28716         index; ie. don't compare the address of the `MonoGenericParam'
28717         structure.
28718         (mono_metadata_load_generic_params): Removed the `MonoMethod
28719         *method' argument.
28721         * metadata.h (MonoGenericInst): Moved declaration to class.h.
28722         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
28724         * reflection.c (method_encode_signature): Encode the number of
28725         generic parameters.
28726         (encode_generic_method_sig): New static function.
28727         (method_encode_methodspec): New static function; creates an entry
28728         in the MethodSpec table for a generic method.
28729         (mono_image_get_methodspec_token): New static function.
28730         (mono_image_create_token): Call mono_image_get_methodspec_token()
28731         for generic methods.
28732         (mono_reflection_bind_generic_method_parameters): New public
28733         function.  Instantiates a generic method.
28735 2003-10-16  Martin Baulig  <martin@ximian.com>
28737         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
28738         *gen_params' here from MonoMethodHeader.
28740         * metadata.c (mono_metadata_parse_method_signature): If we have
28741         generic parameters, initialize `method->gen_params' and then set
28742         the correct `type->data.generic_param' in all the parameters.
28744 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
28746         * threads.c (mono_threads_get_default_stacksize): New function to 
28747         return the default stacksize.
28749         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
28750         termination of the finalizer thread, since the previous method had
28751         race conditions. Fixes #49628.
28753         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
28754         as for the other managed threads.
28756 2003-10-16  Martin Baulig  <martin@ximian.com>
28758         * class.c (inflate_generic_signature): Copy `generic_param_count'
28759         and `gen_params'.
28761         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
28762         New interncall.
28764         * metadata.c (mono_metadata_parse_method_signature): Actually set
28765         the `method->generic_param_count' here.
28766         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
28768 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
28770         * object.h: Add a new field to TypedRef to simplify the implementation
28771         of the REFANY opcodes in the JIT.
28773         * icall.c: Make use of the new field.
28775         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
28776         dynamically.
28778 2003-10-15  Martin Baulig  <martin@ximian.com>
28780         * class.c (mono_class_from_gen_param): Renamed to
28781         mono_class_from_generic_parameter() and moved most of the
28782         functionality from mono_reflection_define_generic_parameter()
28783         here; ie. we create a "real" class here.
28784         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
28785         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
28786         previously been called.
28788         * class.h (MonoGenericParam): Moved the declaration of this struct
28789         here from metadata.h and added `MonoMethod *method'.
28791         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
28792         interncall.
28794         * loader.c (mono_get_method_from_token): If we have any generic
28795         parameters, call mono_metadata_load_generic_params() to read them
28796         from the MONO_TABLE_GENERICPAR.
28798         * metadata.c (mono_metadata_load_generic_params): Added
28799         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
28801         * metadata.h (MonoMethodSignature): Replaced
28802         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
28803         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
28805         * reflection.c (mono_reflection_define_generic_parameter): Moved
28806         most of the functionality into the new
28807         mono_class_from_generic_parameter(); set the `method' field if
28808         we're a method parameter.       
28810 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
28812         * marshal.c (emit_struct_conv): if native size is 0
28813         emit no code.
28815 2003-10-14  Martin Baulig  <martin@ximian.com>
28817         * icall.c: The generics API has changed in the spec since it was
28818         added to System.Type; these modifications make it match the spec
28819         again.
28820         (ves_icall_Type_GetGenericParameters): Renamed to
28821         `ves_icall_Type_GetGenericArguments'.
28822         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
28823         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
28824         `ves_icall_MonoType_get_HasGenericArguments'.
28825         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
28826         `ves_icall_MonoType_get_IsGenericParameter'.
28827         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
28828         this is no interncall anymore.
28829         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
28830         `ves_icall_TypeBuilder_get_IsGenericParameter'.
28832 2003-10-14  Martin Baulig  <martin@ximian.com>
28834         * reflection.c (mono_reflection_bind_generic_parameters): Also
28835         inflate generic methods if we're reading the class from IL.
28837 2003-10-13  Martin Baulig  <martin@ximian.com>
28839         * reflection.c (mono_reflection_define_generic_parameter): This
28840         method isn't called directly from the icall anymore; take a
28841         `MonoReflectionAssemblyBuilder *' so we can use this for type and
28842         method generic parameters.
28843         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
28844         (method_builder_encode_signature): Encode generic parameters.
28845         (mono_image_get_method_info): Write generic params to the
28846         MONO_TABLE_GENERICPARAM table.
28848         * reflection.h (MonoReflectionMethodBuilder): Added
28849         `MonoArray *generic_params'.
28851         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
28853         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
28854         wrapper for mono_reflection_define_generic_parameter().
28855         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
28857 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
28859         * marshal.h: Add missing function to fix build.
28861         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
28862         the SetLastError pinvoke attribute.
28864         * marshal.c (mono_marshal_set_last_error): New helper function called
28865         by the generated code.
28866         
28867         * marshal.c (mono_mb_emit_branch): New helper function.
28869         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
28871         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
28872         classes as parameters and return values of delegates. Fixes #29256. 
28874 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
28876         * locales.c: use gint32 in non HAVE_ICU case
28878 2003-10-11  Martin Baulig  <martin@ximian.com>
28880         * mono-debug.c (mono_debug_add_method): Added a workaround for
28881         bug #48591.
28883 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
28885         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
28886         delegates passed to native code must use the STDCALL calling 
28887         convention. Fixes #35987.
28889 2003-10-10  Martin Baulig  <martin@ximian.com>
28891         * class.c (inflate_generic_type): If we're inflating for a generic
28892         type instance (and not for a generic method), return
28893         MONO_TYPE_MVAR unchanged.
28895 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28897         * string-icalls.c: Join ignores null strings in the source array.
28898         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
28899         * threads.c: GetAvailableTheads is slightly more accurate.
28901 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
28903         * threads.h threads.c : add mono_threads_set_default_stacksize
28904         and pass default to CreateThread calls.
28906 2003-10-09  Dick Porter  <dick@ximian.com>
28908         * icall.c:
28909         * locales.h:
28910         * locales.c: Internal calls for constructing CultureInfo and
28911         related objects from libicu (if its available.)
28913 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
28915         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
28917 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28919         * threadpool.c: added an argument to async_invoke_thread that is the
28920         item to process, pass the MonoAsyncResult to the thread start function
28921         when creating a new thread. This way we don't need to acquire any lock
28922         when we're creating a new thread. Readded a semaphore for faster
28923         response times (instead of that Sleep i added).
28925 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
28927         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
28928         get daylight change dates better on Windows, fix handling
28929         of platforms without tm_gmtoff.
28931 2003-10-06  Martin Baulig  <martin@ximian.com>
28933         * class.c (inflate_generic_method): Renamed to
28934         mono_class_inflate_generic_method() and made public.
28935         (mono_class_init): Don't inflate the generic methods here.
28936         (mono_class_from_generic): Added `gboolean inflate_methods'
28937         argument.  Inflate the methods here.
28939         * loader.c (mono_method_get_param_names): Ignore instances of
28940         generic types for the moment.
28942         * reflection.c (fixup_method): Added support for inflated methods.
28943         (mono_image_create_token): Use mono_image_get_methodref_token()
28944         for inflated methods.
28945         (mono_custom_attrs_from_param): Ignore instances of generic types
28946         for the moment.
28947         (mono_reflection_bind_generic_parameters): New public function.
28948         Moved all the functionality from
28949         ves_icall_Type_BindGenericParameters() here and added support for
28950         dynamic types.
28951         (mono_reflection_define_generic_parameter): Initialize
28952         `klass->methods' here.
28954         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
28955         functionality into mono_reflection_define_generic_parameter().
28956         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
28957         TypeBuilder, return that TypeBuilder.
28959 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28961         * appdomain.c: removed mono_delegate_semaphore.
28963         * threadpool.c:
28964         (mono_thread_pool_add): moved hash table creation inside and the thread 
28965         creation outside of the critical region.
28966         (mono_thread_pool_finish): removed obsolete code.
28967         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
28968         continue or exit the thread depending on the queue.
28970 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
28972         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
28973         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
28974         handle more bool marshalling options
28976 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
28978         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
28979         arrays of structs. Also add a more descriptive error message when
28980         a structure member is marshalled as LPArray.
28982 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
28984         * marshal.c (mono_marshal_get_native_wrapper): Add support for
28985         marshalling arrays of complex types. Fixes #29098. Also remove an
28986         usused and incomplete function.
28988 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
28990         * gc.c: report heap_size - free_bytes as total memory allocated
28991         (bug#49362).
28993 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
28995         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
28996         fix timezone handling problems on Windows.
28997         
28998         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
28999         asserts when the year is outside the range handled by ms the functions.
29001         * class.c (setup_interface_offsets): If the class is an interface,
29002         fill out its interface_offsets slot.
29004 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29006         * threadpool.c: mark threadpool threads as background.
29008 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
29010         * decimal.c - define DECINLINE to nothing if not using GCC
29012 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
29014         * assembly.c: More refcount fixes.
29016 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29018         * string-icalls.c: if we're not trimming, return the same string.
29019         When not splitting, don't create a new string.
29021 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29023         * image.c:
29024         (mono_image_open): increment the ref_count inside the critical section.
29026 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
29028         * image.c (mono_image_open): Fix reference counting bug.
29030 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
29032         * marshal.c (mono_marshal_type_size) struct alignment changed for 
29033         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
29034         64bits. Avoid leak in mono_marshal_get_native_wrapper when
29035         mono_lookup_pinvoke_call throws.        
29037 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
29039         * reflection.c (mono_reflection_parse_type): Fix #49114.
29041         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
29042         temporary workaround for cygwin header problem.
29044         * object.c (mono_object_isinst): Synchronize this with the code
29045         generated by the JIT for casts.
29047 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
29049         * reflection.c (encode_type): Fix #38332.
29051 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
29053         * marshal.c (mono_marshal_method_from_wrapper): New function to return
29054         the original method from the wrapper method.
29056 2003-09-25  Martin Baulig  <martin@ximian.com>
29058         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
29059         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
29060         (ves_icall_Type_get_IsGenericInstance): New interncall.
29062 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
29064         * object.c: fix cast warning in big endian code.
29066 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
29068         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
29069         
29070 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29072         * assembly.c: don't call check_env from mono_assembly_load. It's
29073         already done once in mono_assemblies_init and may cause headaches when
29074         multiple threads are loading assemblies.
29076 2003-09-19  Martin Baulig  <martin@ximian.com>
29078         * reflection.c (mono_reflection_define_generic_parameter): Don't
29079         allocate `klass->methods', set `klass->flags' to
29080         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
29082 2003-09-18  Martin Baulig  <martin@ximian.com>
29084         * class.c (mono_class_init): Don't create `class->methods' if it's
29085         already initialized.
29087         * metadata.c (mono_metadata_load_generic_params): Make this
29088         actually work.
29090         * reflection.c (mono_reflection_define_generic_parameter): Set
29091         parent class and interfaces from the constraints.
29093         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
29094         to keep this struct in sync with the declaration in TypeBuilder.cs.
29096 2003-09-17  Martin Baulig  <martin@ximian.com>
29098         * metadata.h (MonoType): Replaced the data's `int type_param'
29099         field with `MonoGenericParam *generic_param'.
29100         (MonoGenericParam): Added `MonoClass *klass'.
29102         * class.c (mono_class_from_gen_param): Removed the
29103         `MonoImage *image' and `int type_num' arguments.
29105         * metadata.c (mono_metadata_parse_generic_param): New static
29106         method; creates a MonoGenericParam which just contains the index.
29107         (do_mono_metadata_parse_type): Call
29108         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
29109         MONO_TYPE_MVAR.
29111         * reflection.c (mono_image_typedef_or_ref): Generic type
29112         parameters may be in the same assembly, but never use a typedef
29113         for them.
29114         (mono_reflection_define_generic_parameter): We're now creating a
29115         "real" class for the type parameter; it's now safe to call
29116         mono_class_from_mono_type() on the class'es type, it'll do the
29117         right thing.
29119 2003-09-16  Martin Baulig  <martin@ximian.com>
29121         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
29122         `symfile->range_entry_size' and `symfile->class_entry_size' here;
29123         the `symfile' data structure must be fully initialized before it
29124         gets added to the table.
29126 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
29128         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
29130         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
29131         class init trampolines.
29133 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
29135         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
29136         to the built-in profiler to turn off time and allocation profiling
29137         respectively.
29139 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
29141         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
29142         g_direct_equal.
29144         * debug-helpers.c (mono_method_full_name): Print the wrapper type
29145         in human readable form.
29147 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
29149         * reflection.c icall.c: Fixed warnings.
29151         * image.c (load_class_names): Use a temporary hash table to hold the
29152         namespaces in order to avoid doing many string comparisons.
29154         * image.h: Fix typo.
29156         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
29157         Pass NULL instead of g_direct_equal to the GHashTable constructor 
29158         since the NULL case is short-circuited inside g_hash_table_lookup, 
29159         leading to better performance.  
29161         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
29162         obtain the first custom attribute for a given index. Depends on the
29163         CustomAttribute table being sorted by the parent field.
29165         * reflection.c (mono_custom_attrs_from_index): Use the new function 
29166         for better performance.
29168 2003-09-07  Martin Baulig  <martin@ximian.com>
29170         * class.c (mono_class_init): If we're a generic instance, inflate
29171         all our methods instead of loading them from the image.
29172         (mono_class_from_generic): Set `class->methods = gklass->methods'.
29174 2003-09-07  Martin Baulig  <martin@ximian.com>
29176         * mono-debug-debugger.c: Added support for constructors.
29178 2003-09-06  Martin Baulig  <martin@ximian.com>
29180         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
29181         New interncall.
29183         * reflection.c (mono_reflection_setup_generic_class): Call
29184         ensure_runtime_vtable() to create the vtable.
29186 2003-09-05  Martin Baulig  <martin@ximian.com>
29188         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
29189         MONO_TYPE_MVAR.
29191 2003-09-04  Martin Baulig  <martin@ximian.com>
29193         * reflection.c (mono_reflection_define_generic_parameter): Generic
29194         parameters start with zero.
29196 2003-09-04  Martin Baulig  <martin@ximian.com>
29198         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
29200         * reflection.h (MonoReflectionGenericParam): New typedef.
29201         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
29202         the generic parameters from the managed TypeBuilder.
29204         * reflection.c (mono_reflection_define_generic_parameter): New function.
29205         (mono_reflection_create_runtime_class): Encode generic parameters.
29206         (mono_reflection_setup_generic_class): New function; this is
29207         called after adding adding all generic params to the TypeBuilder.
29208         (encode_type): Added MONO_TYPE_VAR.
29210 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
29212         * class.h class.c (mono_class_needs_cctor_run): Moved this method
29213         here from the JIT.
29215         * assembly.h assembly.c: Moved the AOT loading code into an assembly
29216         load hook.
29218 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
29220         * reflection.h reflection.c class.h class.c: Delete duplicate 
29221         definition of mono_type_get_name () from reflection.c and export the
29222         one in class.c.
29224         * class.c: Class loading fixes from Bernie Solomon 
29225         (bernard@ugsolutions.com).
29227         * reflection.c: Endianness fixes from Bernie Solomon 
29228         (bernard@ugsolutions.com).
29229         
29230 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
29232         * assembly.h assembly.c: Define a file format version for AOT
29233         libraries.
29234         
29235         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
29237         * appdomain.h (MonoJitInfo): New field to determine whenever the
29238         code is domain neutral.
29239         
29240 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
29242         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
29244 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
29246         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
29247         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
29248         Avoid caching the result since strings must be domain specific. Fixes
29249         #48050.
29251 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
29253         * marshal.c (mono_marshal_init): Make this callable multiple times
29254         since it is hard to find a correct place to call it.
29256         * object.c (mono_runtime_class_init): Execute static constructors in
29257         the correct appdomain.
29259         * image.c (build_guid_table): Handle the case when multiple images have
29260         the same GUID.
29262 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29264         * icall.c: added a couple of icalls for System.Web.
29266 2003-08-28  Martin Baulig  <martin@ximian.com>
29268         * icall.c (ves_icall_Type_BindGenericParameters): Use
29269         `klass->generic_inst' instead of `&klass->byval_arg' in the
29270         mono_type_get_object() call.  The returned type must be
29271         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
29273 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
29275         * NOTES: New file.
29277         * object.c (mono_class_proxy_vtable): Make it thread safe.
29279         * pedump.c: Fix warning.
29281         * object.c appdomain.h: Get rid of metadata_section. 
29282         It is no longer needed and it was causing deadlocks with domain->lock.
29284         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
29286 2003-08-26  Martin Baulig  <martin@ximian.com>
29288         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
29290 2003-08-26  Martin Baulig  <martin@ximian.com>
29292         * pedump.c (main): Call mono_metadata_init(),
29293         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
29294         and mono_loader_init().
29296 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
29298         * loader.h: Add missing include to fix build.
29300         * image.h: mono_image_load_references is no more.
29302         * assembly.c: Reworked assembly loading to make it really thread safe.
29303         After these changes, the assembly returned by mono_assembly_open is
29304         fully initialized, i.e. all its references assemblies are loaded.
29306         * assembly.c (mono_image_load_references): Renamed to 
29307         mono_assembly_load_references, and made private, since clients no
29308         longer need to call it.
29310         * class.c: Removed calls to mono_assembly_load_references, since it was
29311         a source of deadlocks.
29313         * loader.h loader.c class.h class.c: Protect data structures using a 
29314         new lock, the loader lock.
29316         * class.c (mono_class_setup_vtable): Create temporary hash tables and
29317         GPtrArrays only when needed.
29319         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
29320         into empty structures by mcs. Fixes pinvoke7.cs.
29321         
29322         * domain.c (mono_init): Call a new initialization function.
29324         * appdomain.c (mono_runtime_init): Call the new initializer function
29325         of the marshal module.
29327         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
29328         inserted into empty structures by mcs. Fixes pinvoke7.cs.
29330         * marshal.h marshal.c: Added locks around the wrapper caches to make
29331         this module thread safe.
29333         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
29334         this argument. Fixes pinvoke1.exe.
29336 2003-08-25  Lluis Sanchez <lluis@ximian.com>
29338         * object.h: Added call_type field to MonoMethodMessage and the corresponding
29339         enumeration of values. Removed fields to store remote call output values in
29340         MonoAsyncResult. Not needed any more.
29341         * object.c: Initialize call_type and async_result fields in mono_message_init.
29342         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
29343         dispatching the message.
29344         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
29345         async call to finish. To do it use a message with EndInvoke call type.
29347 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
29349         * loader.h loader.c (mono_method_hash_marhal_info): New function which
29350         determines whenever a method has marshalling info.
29352 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29354         * assembly.c: fix the build on windows.
29356 2003-08-22 Lluis Sanchez <lluis@ximian.com>
29358         * object.cs: Fixed bug #47785.
29360 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
29362         * string-icalls.c (StringReplace): If their are no occurances of
29363         the old string found return a reference to the supplied
29364         string. This saves some memory and matches MS behavoir.
29365         
29366 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29368         * socket-io.c: fixed compilation for systems that define AF_INET6
29369         and don't define SOL_IP/SOL_IPV6.
29371 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
29373         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
29374         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
29376         * rawbuffer.c rawbuffer.h: Make this module thread safe.
29378         * domain.c: Make this module thread safe.
29380         * domain.c (mono_init): Call new initialization function.
29382         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
29383         reference types too. Fixes #38812.
29385         * image.c (mono_image_init): Fixed warnings.
29387         * class.c (mono_class_from_typeref): Handle assembly load failure
29388         correctly.
29390         * appdomain.c (add_assemblies_to_domain): Handle the case when
29391         the references of an assembly are not yet loaded.
29393         * metadata.c image.c assembly.c: Moved initialization of global
29394         variables to a separate function called at startup since lazy 
29395         initialization of these variables is not thread safe.
29396         
29397         * image.c assembly.c: Made this module thread safe by adding locks in 
29398         the appropriate places.
29400         * domain.c (mono_init): Call the new initialization functions of the
29401         three modules.
29403 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
29405         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
29406           make a direct call. It is proxy's work to make the call asynchronous.
29407           mono_delegate_end_invoke(): If the targe is a proxy, just collect
29408           the return values.
29409         * object.cs: mono_method_call_message_new(): read AsyncResult and
29410           state object from parameters list, if this info is requested.
29411         * object.h: Added fields to store remote call output values in
29412           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
29414 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29416         * object.h: add needed fields to MonoThread.
29417         * threads.c, threads.h: allow registering a function to cleanup data
29418         allocated per thread by the JIT.
29420 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29422         * loader.h: portability fix by Bernie Solomon
29423         * <bernard@ugsolutions.com>.
29425 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
29427         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
29428         return a MonoArray. This simplifies the code and also ensures that
29429         the cache allways contains an object reference as a value.
29431         * icall.c (ves_icall_get_parameter_info): Simplified using the new
29432         function.
29434 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29436         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
29437         fixes a problem with byte ordering when getting the address family for
29438         a socket.
29440 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
29442         * .cvsignore: Added monosn.
29444         * reflection.h reflection.c loader.c: Added support for parameter
29445         marshalling to dynamically created types. Fixes #47295.
29447 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
29449         * rand.c: remove useless warnings.
29451 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
29453         * class.c: implemented ldtoken for methods and fieldrefs.
29455 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29457         * threadpool.c: when mono_async_invoke was called, no one took care of
29458         monitoring the queue. So if the method invoked took some time and we
29459         got new async invoke requests after 500 ms (the thread created waited
29460         that long in WaitForSingleObject), the new async invoke was not called
29461         until the previous one finished.
29463         This is fixed now. Thanks to Totte for helping with it.
29465 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29467         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
29469 2003-08-11  Martin Baulig  <martin@ximian.com>
29471         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
29473 2003-08-06  Martin Baulig  <martin@ximian.com>
29475         * mono-debug-debugger.c: Added support for static fields,
29476         properties and methods.
29478 2003-08-06  Martin Baulig  <martin@ximian.com>
29480         * mono-debug-debugger.c: Don't store the MonoString's vtable to
29481         make this work for applications with multiple application domains.
29483 2003-08-04  Martin Baulig  <martin@ximian.com>
29485         * mono-debug-debugger.c: Completely reworked the type support; the
29486         most important thing is that we're now just using one single
29487         `MonoType' instance per type.
29489 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
29491         * mono-endian.h, mono-endian.c, icall.c: Added icall
29492         ves_icall_System_Double_AssertEndianity to assert double word endianity
29493         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
29495 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29497         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
29498         support, icalls and fixes.
29500 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
29502         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
29503         classes that are a punctuation character in .NET is not the same a
29504         g_unichar_ispunct.
29506 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
29508         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
29510 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
29512         * icall.c: Add new MemCopy internalcall.
29513         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
29514         Simplified code; It is not necessary to handle all the cases here,
29515         as the C# code takes care of it.  Only handle the case of the name
29516         resource embedded into the assembly.
29518         Changed signature to return the data pointer and the size of the
29519         data. 
29521 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
29523         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
29524         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
29526 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
29528         * socket-io.c: ignore EINTR error in select.
29530 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
29532         * class.h, class.c: removed unused subclasses field in MonoClass.
29534 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
29536         * icall.c: improve fix of get_base_definition(). If the parent class
29537           doesn't have the mehod, look at the parent of the parent.
29538         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
29539           to check if a parameter is an in or out parameter
29540           (PARAM_ATTRIBUTE_IN is not set by default).
29541           mono_method_return_message_restore(): Use mono_class_value_size to
29542           get the size of a value type. mono_type_stack_size (parameterType)
29543           does not return the correct value if parameterType is byRef.
29544           mono_load_remote_field(), mono_load_remote_field_new(),
29545           mono_store_remote_field(), mono_store_remote_field_new():
29546           raise exception if the remote call returns an exception.
29548 2003-07-28  Martin Baulig  <martin@ximian.com>
29550         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
29551         method.  This is a wrapper around mono_runtime_invoke() which
29552         boxes the instance object if neccessary.
29554 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29556         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
29557         metadata.h, row-indexes.h, verify.c: first cut of generics support.
29559 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29561         * icall.c: disable mcs bug workaround.
29563 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
29565         * object.c (mono_runtime_class_init): Take the metadata_section
29566         mutex before obtaining the domain mutex.
29568         * appdomain.h: Added definition of metadata_section mutex here. 
29570         * object.c: define metadata_mutex here.
29572 2003-07-24  Ravi Pratap  <ravi@ximian.com>
29574         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
29575         fixed.
29577 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
29579         * reflection.c: Fix bug #46669
29581 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29583         * exception.c:
29584         * exception.h:
29585         * icall.c:
29586         * object.h: fill in the type name for TypeLoadException.
29588 2003-07-23  Ravi Pratap  <ravi@ximian.com>
29590         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
29591         relationship between TypeBuilders while compiling corlib) and bug
29592         45993 (Array types returned from the runtime while compiling
29593         corlib were from the loaded corlib).
29595 2003-07-22  Martin Baulig  <martin@ximian.com>
29597         * mono-debug-debugger.c: Reworked the type support a bit more;
29598         distinguish between types and classes.
29600 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
29602         * icall.c: add IsArrayImpl icall.
29604 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
29606         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
29607         initializing real_size only once. Also fix bug #46602.
29609 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
29611         * object.c: Renamed mono_metadata_section to metadata_section.
29613 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
29615         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
29616           empty array if the type is an array. Fixed.
29617           ves_icall_MonoMethod_get_base_definition: if the base method
29618           is abstract, get the MethodInfo from the list of methods of
29619           the class.
29620         * reflection.c: ParameterInfo.PositionImpl should be zero-based
29621           and it was 1-based. Fixed in mono_param_get_objects.
29623 2003-07-20  Martin Baulig  <martin@ximian.com>
29625         * mono-debug.h: Set version number to 31.
29626         (mono_debug_init): Added `MonoDomain *' argument.
29628         * mono-debug-debugger.c: Reworked the type support; explicitly
29629         tell the debugger about builtin types; pass the `klass' address to
29630         the debugger.
29632 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
29634         * image.c: Allow new metadata tables to be loaded without a
29635         warning. Also update the warning message to give the new constant value.
29636                 
29637 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
29639         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
29640         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
29641         array type representation changes.
29643 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
29645         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
29646         on Environment.Exit () call.
29648 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
29650         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
29651         requires a matching corlib.
29653 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
29655         * Changelog: My editor decided to add a CR to each line. Sorry about that.
29656           Committed again without the CRs.
29657         
29658 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
29660         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
29661           getting it from the "this" socket instance. Did not work
29662           if the socket is a subclass of Socket.
29663           Also fixed bug #35371.
29665 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
29667         * metadata.c: fixed size for TypedByRef.
29668         * loader.c: when searching for a method, consider the vararg amrker.
29669         * unicode.c, decimal.c: constify some arrays.
29671 2003-07-15  Dick Porter  <dick@ximian.com>
29673         * socket-io.c: Fixed compilation for gcc < 3.2.
29675         Fixed compilation for machines that don't have AF_INET6 (thanks to
29676         Bernie Solomon <bernard@ugsolutions.com> for that part.)
29678         Fixed compile warnings.
29679         
29680         Fixed formatting and line endings.
29682 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
29684         * socket-io.h:
29685         * socket-io.c: Added IPv6 support.
29687 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
29689         * class.c (mono_class_is_assignable_from): New function to implement
29690         the is_assignable_from logic. Used by mono_object_isinst, 
29691         Type::IsAssignableFrom () and the interpreter.
29693         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
29694         Object, even interfaces.
29695         
29696         * object.c (mono_object_isinst): Implement in terms of 
29697         is_assignable_from.
29699         * icall.c (ves_icall_type_is_assignable_from): New icall.
29701 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
29703         * domain.c (foreach_domain): fix compiler warning.
29705 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
29707         * image.c (load_metadata_ptrs): use g_strndup because strndup is
29708         not available on all plattforms
29710 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
29712         * image.h image.c: Store the metadata version string in MonoImage.
29713         * icall.c: New icall to retrieve the image version.
29714         * reflection.c (create_dynamic_image): Fill in the image version field
29715         * reflection.c (build_compressed_metadata): Use the image version
29716         from the image structure.
29718 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29720         * appdomain.c: modified comment.
29721         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
29722         That will be its last iteration when mono_gc_cleanup is called from
29723         mono_runtime_cleanup and before the domain is unloaded.
29725         Fixes bug #45962.
29727 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
29729         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
29730         attributes.
29732 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29734         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
29735         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
29736         Bernie Solomon <bernard@ugsolutions.com>.
29738 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
29740         * object.c, object.h: provide mono_object_new_fast() for faster
29741         allocation in some special cases.
29743 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
29745         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
29746         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
29748 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
29750         * threadpool.c: fix leaks.
29752 2003-07-01  Dick Porter  <dick@ximian.com>
29754         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
29755         using MonoGHashTables.  Fixes threadpool bug posted to list.
29757 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
29759         * image.h, image.c: added support to load an assembly from a byte array.
29760         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
29761         assembly bundle support.
29763 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
29765         * threadpool.c (mono_thread_pool_add): keep a reference to the
29766         AsyncResult to prevent GC
29768 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
29770         * class.c: leak fix.
29772 2003-06-25  Dick Porter  <dick@ximian.com>
29774         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
29775         for the async object, the WaitHandle object will close the handle.
29776         Fixes bug 45321.
29778 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
29780         * class.c: in mono_array_class_get (), lookup from the hash with the
29781         same type we insert: this works around a bug in
29782         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
29783         lluis. The real fix will have to wait for after the release.
29785 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
29787         * icall.c: fix memory leak when getting type members.
29789 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
29791         * reflection.c: added more pubtoken special cases.
29793 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
29795         * class.c: handle field offset correctly when class size
29796         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
29798 2003-06-20  Martin Baulig  <martin@ximian.com>
29800         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
29801         *image' field.
29803 2003-06-20  Martin Baulig  <martin@ximian.com>
29805         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
29807 2003-06-20  Martin Baulig  <martin@ximian.com>
29809         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
29810         just distinguish between variables in registers and variables at
29811         an offset relative to a register.
29813 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29815         * icall.c: #ifdef out latest changes until mcs is fixed.
29817 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
29819         * icall.c: return members in metadata order.
29821 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
29823         * icall.c: avoid infinite loop in GetTimeZoneData.
29825 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
29827         * icall.c: added Marshal.Prelink/All icalls.
29829 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
29831         * object.c, object.h: fix warnings and do some overflow checking
29832         when creating arrays.
29834 2003-06-17  Dick Porter  <dick@ximian.com>
29836         * file-io.h:
29837         * file-io.c: File attributes need to be tweaked slightly when
29838         passed from the managed to the w32 world.
29840 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
29841         * profiler.h profiler-private.h profiler.c: Rework last patch
29842         based on suggestion by Paolo.
29843         
29844 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
29846         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
29847         instruction level coverage data collection.
29848         * profiler.h profiler.c (: Added new callback function which can be
29849         used by the profiler to limit which functions should have coverage
29850         instrumentation.
29851         * profiler.c (mono_profiler_load): Call g_module_build_path to
29852         generate the file name of the profiler library.
29854 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
29856         * profiler.c, profiler.h, profiler-private.h: added basic block 
29857         coverage profiling API.
29859 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
29861         * reflection.c (mono_reflection_create_runtime_class): Add support
29862         for events in dynamically generated code.
29864         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
29865         not allocated.
29867 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
29869         * icall.c: when getting timezone info, return reasonable values if we
29870         can't get the actual data.
29872 2003-06-14  Dick Porter  <dick@ximian.com>
29874         * threads.c (start_wrapper): Remove the reference to the thread
29875         object in the TLS data, so the thread object can be finalized.
29876         This won't be reached if the thread threw an uncaught exception,
29877         so those thread handles will stay referenced :-( (This is due to
29878         missing support for scanning thread-specific data in the Boehm GC
29879         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
29881 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
29883         * reflection.c: ensure streams and tables are first allocated with
29884         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
29886 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
29888         * icall.c: fixed GetElementType for byrefs (bug# 44792).
29890 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
29892         * reflection.c (mono_reflection_create_runtime_class): Add support for
29893         properties to dynamically created classes.
29894         * reflection.c: Fix a few places where non-MonoObjects were inserted
29895         into the tokens hashtable.
29897 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
29899         * object.c: some support to handle out of memory exceptions.
29901 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
29903         * marshal.c (mono_marshal_get_native_wrapper): support reference
29904         return types
29906 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
29908         * object.h, object.c: more portability stuff from Bernie Solomon.
29909         Unexport mono_object_allocate(). Added mono_object_unbox ().
29910         Set exitcode when an unhandled exception is thrown.
29912 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
29914         * marshal.c (mono_marshal_get_native_wrapper): use custom
29915         marshaler for return types.
29917 2003-06-10  Dick Porter  <dick@ximian.com>
29919         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
29920         ip_mreq is available
29922 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
29924         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
29925         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
29926         by Bernie Solomon <bernard@ugsolutions.com>.
29928 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
29930         * gc.c (mono_gc_init): Avoid error message on shutdown when
29931         GC_DONT_GC=1 is used.
29933         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
29934         New icall to return the GUID of a module.
29936 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
29938         * class.c: ensure instance size always includes the parent's size
29939         even whem class size is set explicitly (fixes bug#44294).
29941 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
29943         * profiler.h, profiler.c: made the simple profiler thread-safe,
29944         get more accurate timing info. Allow the loading of an
29945         externally-developed profiler module.
29947 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
29949         * marshal.c (mono_marshal_get_native_wrapper): improved
29950         class/byref arguments.
29951         (mono_marshal_get_native_wrapper): better string marshaling support.
29953 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
29955         * class.c: ensure .pack and .size are handled correctly and
29956         simplified layout of static fields.
29958 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
29960         * appdomain.c
29961         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
29963         * loader.c (mono_lookup_pinvoke_call): look for modules in the
29964         current directory (fix bug 44008)
29966 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
29968         * marshal.c (mono_marshal_get_native_wrapper): started support for
29969         custom marshalers.
29970         (mono_delegate_to_ftnptr): consider marshalling specifications
29972 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
29974         * reflection.c, reflection.h: emit custom marshal info.
29976 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29978         * object.c: free the GError.
29979         * icall.c: added CloseEvent_internal.
29980         * threads.[ch]:
29981         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
29982         call.
29984 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
29986         * loader.c (mono_method_get_signature): Add support for dynamic
29987         assemblies.
29989 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
29991         * reflection.c: fixed bug #43905.
29993 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
29995         * class.c, domain.c, icall.c, metadata.h, object.h: support for
29996         handling TypedReference and ArgIterator.
29997         * loader.c, loader.h: added function to get signature at call site.
29999 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
30001         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
30002         data readonly. Buglets and warning fixes. Some MethodSpec support.
30004 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
30006         * class.h, class.c, object.c: remove relative numbering support.
30008 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
30010         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
30011         free the string, until we get a chance to fix Gtk#
30013 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30015         * marshal.c: revert last patch.
30017 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
30019         * icall.c: updates for new mono_class_vtable() not calling
30020         the type constructor anymore.
30022 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
30024         * object.h, object.c: separate vtable creation from type
30025         initialization. Make running the .cctor thread safe.
30027 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
30029         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
30031 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
30033         * loader.c (mono_get_method): consider calling convention
30035 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
30037         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
30038         to return the invisible global type for a module.
30040         * reflection.c (mono_image_build_metadata): Emit global fields too.
30042 2003-05-20  Peter Williams  <peterw@ximian.com>
30044         * loader.c (mono_lookup_internal_call): Add a few newlines.
30046 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
30048         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
30049         literal strings.
30051         * appdomain.c (set_domain_search_path): Recalculate search path when
30052         AppDomainSetup.PrivateBinPath changes.
30054         * object.c (mono_class_compute_gc_descriptor): It turns out some
30055         parts of the class libs (like System.Thread) holds pointers to
30056         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
30057         to treat native int a pointer type here.
30058         
30059 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
30061         * appdomain.h, domain.c: add hashtable for jump target resolution.
30063 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
30065         * reflection.h reflection.c icall.c: Added new icalls 
30066         GetManifestResourceInfoInternal, GetModulesInternal and support
30067         infrastructure.
30069 2003-05-16  Dick Porter  <dick@ximian.com>
30071         * icall.c:
30072         * file-io.h:
30073         * file-io.c: Implement System.IO.MonoIO::GetTempPath
30075 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
30077         * object.c: mono_store_remote_field: little fix to previous patch.
30079 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30081         * class.c: add constructors to array classes.
30082         * icall.c: special case array construction for InternalInvoke (),
30084 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
30086         * class.h class.c reflection.c object.c: Added support for field
30087         defaults in dynamically generated classes.
30089 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
30091         * reflection.c: properly encode charset for ddlimport.
30093 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
30095         * threads.c: allow compiling without GC.
30097 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
30099         * appdomain.h, object.c, object.h, threads.c, threads.h: added
30100         handling of thread static data.
30102 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30104         * reflection.h, reflection.c: added mono_custom_attrs_free ().
30106 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
30108         * class.c (mono_array_class_get): always set the serializable flags
30109         (mono_array_class_get): always set the SEALED attribute for array types
30111 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
30113         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
30114         attributes (fix for bug 42021).
30116 2003-05-12  Dick Porter  <dick@ximian.com>
30118         * gc.c: Don't run finalizers when the finalizer thread is
30119         finishing up, because the default domain has already been
30120         destroyed.
30122 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
30124         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
30125         value is null, we should throw an exception.   This is slightly
30126         different than the other conventions used for the constructor.
30128 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30130         * socket-io.c: fixed windows build.
30132 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30134         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
30136 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
30138         * object.c (mono_string_new_wrapper): Compatibility fix for MS
30139         compilers.
30141 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
30143         * class.c (mono_class_layout_fields): Add experimental GC aware
30144         auto layout facility. Requires class library changes to work correctly.
30146         (mono_class_setup_vtable): Avoid overriding explicit interface
30147         method implementations. Fixes iface3.exe test.
30149         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
30150         object reference.
30151         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
30152         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
30154         * metadata.h: Add new type classification macro which determines
30155         whenever the type holds an object reference.
30157 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
30159         * marshal.c (mono_marshal_get_native_wrapper): cleanups
30161 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
30163         * gc.c (finalizer_thread): Work around a GC bug.
30165 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
30167         * marshal.c (emit_struct_conv): allow unions
30169         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
30171 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
30173         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
30175 2003-05-06  Martin Baulig  <martin@ximian.com>
30177         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
30179 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30181         * socket-io.c:
30182         (Select_internal): allow NULLs, don't create arrays if not needed.
30183         Coupled with Socket.cs changes.
30185         * threadpool.c:
30186         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
30187         register a finalizer for it that will close the semaphore handle. This
30188         fixes the leak and make Lupus' test run with > 4080 loops.
30190 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
30192         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
30193         Jerome Laban (bug #42287)
30195 2003-05-02  Martin Baulig  <martin@ximian.com>
30197         * debug-mono-symfile.h
30198         (MonoSymbolFile): Moved declaration into mono-debug.h.
30199         (MonoDebugMethodJitInfo): Likewise.
30200         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
30201         argument.
30202         (_mono_debug_address_from_il_offset): Take a
30203         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
30205         * mono-debug.h
30206         (MonoDebugDomainData): New struct.
30207         (mono_debug_get_domain_data): New function.
30208         (mono_debug_add_method): Take an additional `MonoDomain *'
30209         argument.
30210         (mono_debug_source_location_from_address): Likewise.
30211         (mono_debug_il_offset_from_address): Likewise.
30212         (mono_debug_address_from_il_offset): Likewise.
30214 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
30216         * reflection.c: one more check for null type in custom attrs.
30218 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30220         * reflection.c: avoid warning (comparison is always false due to limited
30221         range of data type).
30223 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30225         * icall.c: throw an exception in Type.GetField if the argument 'name'
30226         is NULL.
30228 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
30230         * reflection.c: fixed handling of enums in named arguments to custom
30231         attributes (bug #42123).
30233 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
30235         * reflection.c: use the right array element type and handle
30236         a null for a Type argument, too.
30238 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
30240         * reflection.c: handle arrays as arguments to custom attributes.
30242 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
30244         * reflection.c: handle a string value in a custom attr
30245         ctor that takes an object.
30247 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
30249         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
30250         (fix bug #42063)
30252 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
30254         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
30256 2003-04-27  Martin Baulig  <martin@ximian.com>
30258         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
30259         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
30260         MONO_DEBUGGER_EVENT_BREAKPOINT.
30261         (mono_breakpoint_trampoline_code): Removed.
30262         (mono_debugger_event_handler): The last argument is now a
30263         `guint32'.
30264         (mono_debugger_insert_breakpoint_full): Removed the
30265         `use_trampoline' argument.
30266         (mono_debugger_method_has_breakpoint): Likewise.
30267         (mono_debugger_trampoline_breakpoint_callback): Renamed to
30268         mono_debugger_breakpoint_callback(); take the method and
30269         breakpoint number as arguments.
30271 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
30273         * metadata.c: fix off by one when loading parameters attributes.
30275 2003-04-24  Martin Baulig  <martin@ximian.com>
30277         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
30279 2003-04-24  Martin Baulig  <martin@ximian.com>
30281         * mono-debug-debugger.c: Moved all code which interacts with the
30282         Mono Debugger here.
30284         * debug-mono-symfile.c: This code now just deals with the symbol
30285         file itself, the debugger code is now in mono-debug-debugger.c.
30287 2003-04-23  Martin Baulig  <martin@ximian.com>
30289         * mono-debug.c (mono_debug_source_location_from_il_offset):
30290         New method; like mono_debug_source_location_from_address(), but
30291         takes an IL offset instead of a machine address.
30293 2003-04-23  Martin Baulig  <martin@ximian.com>
30295         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
30296         `line' field; this is now computed by the debugger.
30298 2003-04-23  Martin Baulig  <martin@ximian.com>
30300         * mono-debug.[ch]: New files.  This is the new debugging interface.
30302         * mono-debug-debugger.[ch]: New files.  Moved all code which
30303         interacts with the Mono Debugger here.
30305 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
30307         * domain.c (mono_init): initialize mono_defaults.monitor_class
30309 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
30311         * reflection.c (method_encode_code): Add a spicy exception to help
30312         future compiler authors.
30314 2003-04-21  Martin Baulig  <martin@ximian.com>
30316         * icall.c
30317         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
30318         Make this work with relative pathnames; g_filename_to_uri() needs
30319         an absolute filename.
30321 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
30323         * icall.c: Track name changes in Object and ValueType.
30325 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
30327         * metadata.c (mono_type_stack_size): size should be a multiple of
30328         sizeof (gpointer)
30330 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30332         * gc.c:
30333         (internal_domain_finalize): moved into mono_domain_finalize. No need
30334         to create another thread because the finalizers will be run in the
30335         finalizer thread.
30336         
30337         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
30338         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
30339         to be run (MS does this too).
30341 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
30343         * object.c (mono_class_compute_gc_descriptor): Update comment.
30345         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
30347         * image.h: Add synchronized wrapper cache.
30349         * image.c (do_mono_image_open): Initialize cache.
30351         * reflection.c (create_dynamic_mono_image): Initialize cache.
30353 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30355         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
30356         ves_icall_System_Buffer_ByteLengthInternal.
30358 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
30360         * reflection.c: setup klass->nested_in earlier. Allow
30361         a dash in the assembly name.
30363 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
30365         * metadata.c (mono_type_to_unmanaged): dont access
30366         type->data.klass for MONO_TYPE_OBJECT
30367         (mono_type_to_unmanaged): consider System.Delegate class
30369 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
30371         * class.c: just setup supertypes in the proper place instead of
30372         initializing the full element class for arrays.
30374 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
30376         * class.c: ensure the element class of arrays is initialized.
30377         Setup the supertype info for array classes, too.
30379 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
30381         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
30383 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30385         * Makefile.am: re-added -m option when running cygpath. This way,
30386         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
30387         separator.
30388         * mono-config.c: same codepath for locating mono config file for WIN32
30389         and the rest.
30390         * assembly.c: if mono_assembly_setrootdir is called, don't override
30391         the value set.
30393 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30395         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
30396         MONO_ASSEMBLIES variable.
30398 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
30400         * icall.c: added Assembly::GetNamespaces() icall.
30402 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30404         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
30406 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
30408         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
30409         * object.c: fixed bug in the construction of vtable for proxies
30411 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
30413         * object.c (mono_array_new): Mark mono_array_new as an icall.
30415 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30417         * class.c: fixed test for public method when overriding interfaces.
30418         Closes bug #40970.
30420 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
30422         * appdomain.h, domain.c: added mono_domain_foreach() to
30423         be able to access the currently loaded appdomains.
30424         * object.c: make string interning work across sppdomains.
30425         Mark some functions for use as icalls.
30427 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
30429         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
30431         * reflection.h reflection.c: Allocate long living data using 
30432         GC_MALLOC_ATOMIC so the collector does not need to scan it.
30434         * reflection.c: Double the allocation size in streams instead of
30435         increasing it, to prevent unneccesary copying on large assemblies.
30436         
30437         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
30438         creation if the assembly does not have the Run flag set.
30440 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
30442         * class.h: avoid the C++ keywords in header files (Jerome Laban
30443         spotted and fixed this).
30445 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30447         * object.c:
30448         (mono_unhandled_exception): fill in the arguments for the
30449         UnhandledException event. Only trigger that event for the default
30450         domain (as MS does).
30452 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
30454         * object.c: Improve typed allocation stuff based on suggestions from
30455         Paolo. Also turn it on if the GC library supports it.
30457 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
30459         * object.c object.h class.h: Added experimental typed allocation
30460         facility using the interfaces in gc_gcj.h.
30462         * os/gc_wrapper.h: Added new include files.
30463         
30464 2003-04-03  Martin Baulig  <martin@ximian.com>
30466         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
30467         which is not yet enabled by default.
30469         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
30470         functions.
30471         (mono_gc_lock, mono_gc_unlock): New static functions.
30473         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
30474         functions; stop/start the world for the garbage collector.  This
30475         is using the windows API; we need to complete the SuspendThread()/
30476         ResumeThread() implementation in the io-layer to make this work on Unix.
30477         (mono_gc_push_all_stacks): New public function; tells the garbage
30478         collector about the stack pointers from all managed threads.
30480 2003-04-03  Martin Baulig  <martin@ximian.com>
30482         * object.h (MonoThread): Added `gpointer stack_ptr'.
30484         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
30486 2003-04-03  Martin Baulig  <martin@ximian.com>
30488         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
30490 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
30492         * reflection.c (typebuilder_setup_fields): Initialize field.first and
30493         field.last.
30495 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
30497         * loader.c (mono_lookup_internal_call): Report the corlib that is
30498         out of sync.
30500 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
30502         * icall.c (ves_icall_type_GetTypeCode): fixed check for
30503         System.DBNull (it's class not valuetype).
30505 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
30507         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
30508         if the array method was already assigned a token (fixes bug#40646).
30510 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
30512         * reflection.c (mono_reflection_get_type): Attempt type resolve even
30513         if no assembly is given.
30515 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
30517         * metadata.h: Added the new tables.
30519         * row-indexes.h: Added definitions for new tables.
30521         * metadata.c: Add schemas for new tables, and add support for
30522         computing the sizes of them.
30524         * class.c: Update for handling the new type cases.
30526 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
30528         * metadata.h (MONO_TYPE_IS_VOID): new macro
30530 2003-03-31  Martin Baulig  <martin@ximian.com>
30532         * threads.h (MonoThreadCallbacks): Added `thread_created'.
30534         * threads.c (mono_thread_new_init): Call `thread_created' in the
30535         mono_thread_callbacks.
30537 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
30539         * loader.h: added marshalbyrefobject_class to mono_defaults
30540         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
30541         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
30542           generation of output parameters.
30543           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
30544         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
30545           contextbound and the target object belongs to the context of the caller.
30546         * object.h: added context and unwrapped_server variables in MonoRealProxy.
30547         * object.c: Implemented support for interfaces and abstract classes
30548           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
30549           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
30551 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
30553         * class.h class.c (mono_class_is_subclass_of): New function.
30554         
30555         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
30556         routines for most common case (calls from ArrayList::ToArray).
30558         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
30559         routine so programs which call Environment::Exit() can be profiled.
30561         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
30562         Added MONO_ARCH_SAVE_REGS.
30564         * icall.c (ves_icall_type_is_subtype_of): Use new function.
30566 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
30568         * blob.h: Add a couple of new MonoType types definitions.
30570         * tabledefs.h: Add a couple of new call convs.
30572 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
30574         * reflection.h (MonoReflectionDynamicAssembly): track changes in
30575         the layout of the class.
30577         * reflection.c (alloc_table): double the size on overflow to avoid
30578         unnecessary copying.
30580         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
30581         avoid filling out metadata tables and blobs. Also set mb->ilgen to
30582         null so it can be garbage collected.
30583         
30584 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
30586         * reflection.c (mono_reflection_get_type): Return the resolved type
30587         only if it is in the assembly we searched.
30589         * reflection.c (ensure_runtime_vtable): Initialize method slots.
30591         * class.c (mono_class_setup_vtable): Set the slot of the overriding
30592         method.
30594 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30596         * appdomain.c:
30597         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
30598         the right one is 'file:///blah', but MS allows it.
30599         * assembly.c:
30600         (mono_assembly_open): allow 'file://blah'
30602         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
30604 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
30606         * socket-io.c: fixes bug #40310.
30608 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
30610         * reflection.c (mono_reflection_parse_type): handle deeply nested
30611         types correctly.
30613         * reflection.c (mono_image_create_token): Use unique token values
30614         since they will be put into a hash table.
30616         * class.c (mono_class_setup_vtable): If a method occurs in more than
30617         one place in the vtable, and it gets overriden, then change the
30618         other occurances too.
30620         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
30621         object as return type.
30623 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30625         * icall.c: Deleted "ToString" implementation for double and float
30626         because they are full implemented in managed code.
30628 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30630         * reflection.c, reflection.h: implemented and exported functions
30631         to retrieve info about custom attributes.
30633 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30635         * appdomain.c: moved Uri handling to assembly.c
30636         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
30637         work when using a file Uri in *nix and windows.
30639         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
30640         GetReferencedAssemblies.
30642 2003-03-18  Dick Porter  <dick@ximian.com>
30644         * icall.c: Rename a couple of internal calls
30646         * threads.c: Set the thread state to Stopped when a thread exits.
30647         Fixes bug 39377.
30649 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
30651         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
30652         New icall.
30654         * object.c (mono_class_vtable): fix warning.
30656 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
30658         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
30660         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
30661         memory.
30662         (method_encode_clauses): Create exception info structures in the right
30663         order.
30664         (mono_reflection_setup_internal_class): Initialize supertypes field.
30666         * class.c object.c: Handle interfaces which implement other interfaces 
30667         correctly.
30669         * class.h class.c: Move the supertypes array initialization code into 
30670         a separate function so it can be used for dynamic types too. Also call
30671         it earlier, in mono_class_init(), since it can be used before the
30672         type is initialized.
30674 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30676         * Makefile.am:
30677         * assembly.c:
30678         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
30680         * appdomain.c:
30681         * appdomain.h:
30682         * marshal.c:
30683         * object.c: remove warnings.
30685 2003-03-13  Martin Baulig  <martin@ximian.com>
30687         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
30688         (MonoDebugLexicalBlockEntry): New types.
30690         * debug-mono-symfile.c
30691         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
30693 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30695         * process.c: ret can be any non-zero value accroding to MS doc.
30697 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
30699         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
30700         fixing a warning for a miss-used prototype, would have cause
30701         random memory corruption.
30703 2003-03-07  Martin Baulig  <martin@ximian.com>
30705         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
30706         getting really annoying ....
30708 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
30710         * reflection.c (fixup_method): added support for array methods.
30712 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
30714         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
30715         (pointed out by Michael Adams).
30717 2003-03-04  Dick Porter  <dick@ximian.com>
30719         * icall.c: Temporarily reverted the Double and Single ToString()
30720         change, because it broke nunit.
30722 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
30724         * object.h, threads.h: make include files compatible with C++
30725         (patch by Jerome Laban <jlaban@wanadoo.fr>).
30727 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30729         * icall.c: Erased ToString helper functions for Double and Single.
30730         Now, that implementations ar all in managed code (Double and Single
30731         Formatters).
30733 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
30735         * appdomain.c: Added method for initializing the default context of
30736         a domain. Added internal call for getting the default context.
30737         * appdomain.h: Added context variable in MonoDomain struct.
30738         * domain.c: mono_domain_set also sets the default context of the domain
30739         * icall.c: Mapped internal method InternalGetDefaultContext.
30740         * object.c: mono_object_get_virtual_method returns always a remoting
30741         wrapper if the object is a transparent proxy.
30742         mono_runtime_invoke_array: when creating an object by calling the
30743         constructor, if the created object is a proxy, then the constructor should
30744         be called using the a remoting wrapper.
30746 2003-03-03  Dick Porter  <dick@ximian.com>
30748         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
30749         variable so it compiles on solaris.  Problem spotted by
30750         Christopher Taylor <ct@cs.clemson.edu>
30752 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30754         * appdomain.c:
30755         (get_info_from_assembly_name): don't leak value.
30757         * icall.c:
30758         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
30759         result.
30761 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
30763         * assembly.c: export mono_image_load_references ().
30764         * class.c: handle function pointers. mono_class_from_name() now
30765         supports nested type names directly.
30767 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
30769         * reflection.h reflection.c: Encode already created dynamic methods 
30770         and fields correctly as a DEF instead of a REF.
30772         * reflection.c: Get rid of the force_ref argument to 
30773         mono_image_typedef_or_ref since it was wrong in the first place.
30775         * string-icalls.c: add error checking to string constructors according
30776         to the MSDN docs.
30778         * reflection.c: Emit types in the order their TypeBuilders were 
30779         created. Previously, a new table index was assigned to each type before
30780         the tables were emitted. This was wrong because the signature blob
30781         might already refer to a type by its original table index.
30783 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
30785         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
30786         change.
30787         
30788 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30790         * Makefile.am: make assemblies dir have \ instead of / on windows.
30792 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
30794         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
30795         iterate over the NESTEDCLASS table using a linear search since the
30796         table is not guaranteed to be sorted by the secondary key.
30798         * class.c (mono_class_create_from_typedef): fixed up call to
30799         mono_metadata_nesting_typedef.
30800         
30801 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
30803         * marshal.c (mono_string_to_byvalstr): clear the memory as
30804         suggested by Jerome Laban <jlaban@wanadoo.fr>
30806 2003-02-26  Dick Porter  <dick@ximian.com>
30808         * process.c: Cope with padding in .rsrc blocks
30810 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
30812         * metadata.h: reverted the filter_len change, it breaks reflection
30813         
30814 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
30816         * metadata.h: added a new field to store the filter_len
30817         
30819 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
30821         * reflection.c: handle custom attributes for types and members
30822         created with Reflection.Emit (bug#38422).
30824 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
30826         * reflection.c: define RTSpecialName automatically for constructors for
30827         compatibility with MS.NET.
30829         * reflection.c (mono_reflection_create_runtime_class): initialize
30830         nested_in field of dynamically created classes.
30832 2003-02-22  Martin Baulig  <martin@ximian.com>
30834         * debug-mono-symfile.h: Incremented version number.
30836 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
30838         * object.h icall.c process.c: fix warnings.
30840 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
30842         * appdomain.h appdomain.c:
30843         (mono_domain_try_type_resolve): split the 
30844         name_or_tb argument into a name and a tb argument.
30845         (mono_domain_has_type_resolve): new function to check whenever the
30846         application has registered a TypeResolve event handler.
30847         
30848         * icall.c reflection.h reflection.c: move the type resolve logic into
30849         mono_reflection_get_type () so it will be invoked when 
30850         Assembly::GetType () is called.
30852         * reflection.c:
30853         (mono_reflection_get_type): renamed to get_type_internal.
30854         (mono_reflection_get_type): fixed type name generation so it works 
30855         for nested types too.
30856         (mono_reflection_get_type): call has_type_resolve () to avoid the 
30857         costly type name generation if there is no resolve event handler.
30859 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
30861         * class.c, image.c: load exported types from file references.
30863 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
30865         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
30866           used to cache the managed methods used to create proxies and make 
30867           remote invocation of methods.
30868         * class.h: Added in MonoVTable a flag to indicate that a class needs 
30869           to be remotely created.
30870         * object.c: Modified the method mono_class_vtable(). It now initializes 
30871           the remote flag of the vtable. Modified mono_object_new_specific(), 
30872           so now it checks the remote flag.
30873         * icall.c: Added a couple of internal methods, one for enabling instance 
30874           creation interception for a type, and one for creating objects bypassing
30875           the remote check.
30877 2003-02-18  Martin Baulig  <martin@ximian.com>
30879         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
30880         New interncall to get a method's metadata token.
30882         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
30883         New interncall for the debugger.
30885 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
30887         * class.c (mono_class_setup_vtable): allocate supertype array
30889 2003-02-18  Martin Baulig  <martin@ximian.com>
30891         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
30893 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30895         * reflection.c:
30896         (assembly_name_to_aname): jump over unknown properties (i've found
30897         something like: 'type, assembly, version=xxx, custom=null, public...',
30898         so now will ignore custom=null and still get the rest of the values).
30900 2003-02-17  Dick Porter  <dick@ximian.com>
30902         * threads.c: Have Thread.Start() wait for a semaphore to signal
30903         that the thread has set up all its local data.  This fixes bug
30904         34323, where Abort() raced the new thread's TLS data.
30906         Also removes the handle_store() call from start_wrapper, because
30907         threads are now always created suspended and there is no longer a
30908         race between the parent and child threads to store the info.
30910 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
30912         * image.c: explain the #- heap issue in a message, hopefully
30913         avoiding FAQs on mono-list.
30915 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30917         * icall.c:
30918         (GetEntryAssembly): if the domain has not invoked
30919         AppDomain.ExecuteAssembly yet, return the assembly of the default
30920         AppDomain.
30922 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
30924         * class.c (mono_ldtoken): make it work in dynamic assemblies.
30926 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
30928         * metadata.c, reflection.c: simple speedup to type hash
30929         and equals code.
30931 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
30933         * image.c, image.h, class.c, assembly.c: move module loading
30934         to MonoImage. When loading metadata, consider alignemnet from
30935         the start of metadata, not from the metadata address in memory.
30937 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
30939         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
30940         AssemblyBuilder objects. Factored out custom attribute creation into
30941         a separate function.
30942         (create_custom_attr): new function to create custom attributes.
30944 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
30946         * Makefile.am: Got tired of typing the full pathname to pedump.
30947         Until there is another option, am installing this.
30949 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
30951         * class.c (class_compute_field_layout): always set field->parent 
30952         (mono_ldtoken): use mono_defaults.fieldhandle_class;
30954 2003-02-11  Dick Porter  <dick@ximian.com>
30956         * threads-types.h:
30957         * monitor.c: Rewrote Monitor, making lock much faster and
30958         Pulse/Wait work as specified.  Also uses much fewer handles, and only
30959         creates them as needed.
30961         * exception.c: Added SynchronizationLockException
30963         * threads.c: Deleted old Monitor implementation.  The new one is
30964         in a new file.
30966 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
30968         * class.c: handled TypedReference type code. Set the correct size for
30969         class data. Setup interface_offsets for interface classes, too.
30971 2003-02-09  Martin Baulig  <martin@ximian.com>
30973         * debug-mono-symfile.h: Reflect latest symbol writer changes.
30975 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
30977         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
30978         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
30979         * object.c: fixed mono_object_get_virtual_method () for interfaces.
30980         * verify.c: check for code that runs after the end of the method.
30982 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
30984         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
30985         "System.Math::Round2".
30986         * sysmath.h: Added Floor, Round and Round2 definitions.
30987         * sysmath.c: Modified certain functions that were not 100% compliant
30988         with MS.NET (math precision) and added the implementation of Floor,
30989         Round and Round2.
30991 2003-02-07  Martin Baulig  <martin@ximian.com>
30993         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
30995 2003-02-07  Martin Baulig  <martin@ximian.com>
30997         * debug-mono-symfile.c: Reflected latest symwriter changes.
30998         (mono_debug_create_mono_symbol_file): Removed.
30999         (mono_debug_open_mono_symbol_file): Take an argument which
31000         specifies whether to create a dynamic symbol file.
31002 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
31004         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
31006 2003-02-05  Martin Baulig  <martin@ximian.com>
31008         * reflection.c (mono_image_build_metadata): Make this public,
31009         protect it against being called multiple times, don't create
31010         resources and don't build the compressed metadata here.
31011         (mono_image_create_pefile): Do this here.
31013         * icall.c
31014         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
31016 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31018         * socket-io.c: fixed bug #36322.
31020 2003-02-06  Piers Haken <piersh@friskit.com>
31022         * appdomain.[ch]:
31023         * class.h:
31024         * debug-mono-symfile.c:
31025         * icall.c:
31026         * loader.c:
31027         * mono-config.c:
31028         * monosn.c:
31029         * reflection.c:
31030         * socket-io.c: warning cleanups
31032 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
31034         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
31035         function. works like remoting invoke, but does a check for the Proxy first.
31037 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
31039         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
31041 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
31043         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
31044         array of pointers.
31045         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
31046         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
31048         * object.c (mono_store_remote_field_new): used by the new jit
31049         instead of mono_store_remote_field
31050         (mono_load_remote_field_new): used by the new jit
31051         instead of mono_load_remote_field
31053 2003-02-05  Patrik Torstensson
31055         * appdomain.c: changed unload to take the domain id instead
31056         of domain
31057         
31058         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
31061 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31063         * appdomain.c: don't look for assemblies in ApplicationBase if
31064         PrivateBinPathProbe is set.
31066 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31068         * object.c: make the first argument in main_args contain the absolute
31069         path to the assembly. Fixes bug #37511.
31071 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31073         * icall.c: get correct UTC offset for countries not using daylight
31074         time saving. Fixes bug #30030.
31076 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31078         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
31079         and 1 are the family).
31081 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
31083         * icall.c (ves_icall_InternalExecute): removed wrong assertion
31085         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
31087 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
31089         * reflection.c: added support for SignatureHelper tokens, which is
31090         needed by the Calli opcode.
31092         * reflection.h: track changes to SignatureHelper class.
31094         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
31096 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31098         * appdomain.c: fixed loading assemblies from PrivateBinPath.
31100 2003-02-03  Patrik Torstensson
31101         * appdomain.[c|h], domain.c : 
31102          - Added support for getting a domain via domain id
31103          - Support for setting and getting domain from System.AppDomain 
31104            (used in cross appdomain channel)
31105          - Added support for get/set for a MonoAppContext on a thread 
31106            (Context class in System.Runtime.Remoting.Contexts),
31107          - Removed hack in Get/SetData and ExecuteAssembly.
31108         
31109         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
31110         the managed world to get control when a proxy is created.
31112         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
31113         
31114 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
31116         * icall.c
31117         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
31118         Populate the codebase field as well.
31120 2003-02-02  Martin Baulig  <martin@ximian.com>
31122         * debug-mono-symfile.c
31123         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
31124         (mono_debug_symfile_add_method): Allow interncalls.
31126 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31128         * icall.c: throw parse exception if strtod fails or the string is empty.
31130 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
31132         * marshal.c: handle object type separately from defined
31133         class types.
31135 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
31137         * marshal.c: handle NATIVE_LPSTR for strings when it's
31138         explicitly specified.
31140 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
31142         * reflection.c, reflection.h, icall.c: setup the reflection
31143         handle cache for ModuleBuilders and AssemblyBuilders.
31145 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
31147         * reflection.c (reflection_methodbuilder_to_mono_method): set
31148         pinvoke flag
31150 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31152         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
31154 2003-01-29  Dick Porter  <dick@ximian.com>
31156         * threads.c: No need for the fake_thread kludge now that Thread
31157         doesn't run a class constructor
31158         
31159 2003-01-29  Dick Porter  <dick@ximian.com>
31161         * threads.c: Use g_direct_hash instead of the rather bogus
31162         g_int_hash
31164 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
31166         * marshal.c (mono_marshal_get_native_wrapper): add check for null
31167         (fix pinvoke12.exe)
31168         (mono_marshal_get_struct_to_ptr): generate valid IL code
31169         (mono_marshal_get_ptr_to_struct): generate valid IL code
31170         (*): correctly set sig->pinvoke, we need to memdup the signature
31171         to do that
31173 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
31175         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
31176         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
31178 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
31180         * profiler.c: provide more callers information.
31182 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
31184         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
31186         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
31188         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
31190 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
31192         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
31193         exception instead of going into an infinite loop on dates which it 
31194         can't yet handle.
31196         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
31197         out-of-range exception if needed.
31199         * class.c (mono_class_setup_vtable): allow a virtual method to provide
31200         an implementation for an interface method and to override an inherited
31201         method at the same time. 
31202         Imagine a scenario when a virtual method is used to override a
31203         virtual abstract method in a parent class, and this same method 
31204         provides an implementation for an method inherited from an interface. 
31205         In this case, the interface resolution code will set im->slot, which 
31206         means that the virtual method override pass will skip this method 
31207         which means a pointer to the abstract method inherited from the parent
31208         will remain in the vtable of this non-abstract class.
31210         * class.c: (mono_class_setup_vtable): continue search for a real 
31211         method if only an abstract method is found.     
31213 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
31215         * reflection.c: add size to encoding for ByValStr and ByValArray
31216         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
31218 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
31220         * class.c (mono_class_setup_vtable): pass the override info as an
31221         argument.
31223         * class.c (mono_class_setup_vtable): set the slot of overriding methods
31224         correctly.
31225         
31226         * reflection.c (ensure_runtime_vtable); add support for method 
31227         overrides.
31228         
31229 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
31231         * reflection.c (resolution_scope_from_image): Hack to work to work with
31232         dynamic assemblies.
31234         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
31235         added a 'force_ref' argument to force this function to allways return 
31236         a TypeRef. This is needed by mono_image_get_memberref_token ().
31237         
31238 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
31240         * reflection.c (mono_image_get_type_info): interfaces really don't have
31241         a parent.
31243         * reflection.c (mono_image_basic_init): fill out missing fields of
31244         image structure.
31246         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
31247         dynamic assemblies. This is required so dynamic assemblies show up in
31248         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
31249         Type::GetType() etc. This is consistent with MS behaviour.
31251         * image.c image.h reflection.c: add newly created classes to the name 
31252         cache so mono_class_get () will find them.      
31254 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
31256         First part of changes to get IKVM.NET running under mono.
31257         
31258         * appdomain.h, appdomain.c: added new function 
31259         mono_domain_try_type_resolve() which will emit TypeResolve events. 
31260         This function will call AppDomain::DoTypeResolve to do the actual work.
31262         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
31263         moved existing code dealing with dynamic tokens to a new function 
31264         called mono_reflection_lookup_dynamic_token (). This function will 
31265         raise TypeResolve events when appropriate. Since reflection.c is not 
31266         part of libmetadata, a new hook function called 
31267         mono_lookup_dynamic_token() is added to class.c which will call this.
31269         * assembly.h assembly.c: make the invoke_load_hook function public,
31270         so it can be called for dynamic assemblies.
31272         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
31274         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
31275         type isn't found.
31277         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
31278         MonoGHashTable, since it contains pointers to objects which the GC 
31279         needs to track.
31281         * assembly.c (search_loaded): remove unused variable.
31282         
31283 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
31285         * object.c: fixed issue exposed by gcc-generated IL programs
31286         that use RVA data for pointers.
31288 2003-01-25  Martin Baulig  <martin@ximian.com>
31290         * threads.c (start_wrapper): Moved the initialization of
31291         `start_func' above the mono_new_thread_init() call to which we
31292         pass it as argument.
31294 2003-01-24  Martin Baulig  <martin@ximian.com>
31296         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
31297         the MonoThread pointer.
31299 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
31301         * icall.c: Rename `PowImpl' to Pow.
31303 2003-01-23  Dick Porter  <dick@ximian.com>
31305         * threads.c (start_wrapper): Create a Thread object if needed, so
31306         the Main() thread can do the class initialisation in a subthread
31307         that has been set up to allow managed code execution.
31309         Pass the thread ID instead of the MonoThread pointer to the thread
31310         start and attach callbacks.  This change is required, because the
31311         jit thread start callback must be called _before_ the Thread
31312         object can be created.
31313         
31314         (mono_thread_init): Removed much object creation code that is no
31315         longer needed.  No managed code is called from here now.
31317         * object.c (mono_runtime_exec_managed_code): Create a subthread
31318         for Main, and call back to the runtime to use it.
31319         Set the exit code when Main exits.
31321         * gc.c: Make sure domain finalisation happens in a subthread.
31322         Re-enable threaded GC, fixing bug 31333 (again).
31324         * environment.c: System.Environment internall calls (so far just
31325         ExitCode is here, the others are still in icall.c)
31327         * appdomain.c (mono_runtime_cleanup): All threads running managed
31328         code should have finished before mono_runtime_cleanup() is
31329         reached, so no need to clean up threads.
31331 2003-01-22  Martin Baulig  <martin@ximian.com>
31333         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
31334         `gpointer func' arguments.      
31335         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
31336         but added `MonoThread *thread' argument.
31337         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
31339         * threads.c (mono_new_thread_init): Added `gpointer func' argument
31340         and pass it to the mono_thread_start_cb callback.
31341         (mono_install_thread_callbacks): New public function to install a
31342         set of callbacks which are set by the debugger.
31343         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
31345 2003-01-22  Martin Baulig  <martin@ximian.com>
31347         * Makefile.am: Install debug-mono-symfile.h.
31349 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
31351         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
31353 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
31355         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
31356         * class.c (mono_ptr_class_get): correctly set access levels of pointers
31357         (mono_array_class_get): correctly set access levels of arrays
31359 2003-01-20      Patrik Torstensson
31360         * image.h (MonoAssemblyName): changed major, minor, build, revision
31361         from signed to unsigned.
31363 2003-01-20  sean kasun <skasun@azstarnet.com>
31365         * reflection.c (load_cattr_value): Now this handles
31366         MONO_TYPE_SZARRAY.  Fixes bug #35629
31368 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
31370         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
31371         integer value
31373 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31375         * decimal.c: fixed bug #26056.
31377 2003-01-17  Martin Baulig  <martin@ximian.com>
31379         * gc.c: Raise an ExecutionEngineException instead of using g_error().
31381 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31383         * exception.[ch]:
31384         (mono_get_exception_type_initialization): new function.
31386         * object.c: throw a TypeInitializationException when an exception is
31387         thrown invoking the class constructor.
31389 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31391         * reflection.c: fixed attribute reading.
31393 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31395         * icall.c:
31396         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
31397         provided, look for the type in the calling assembly and then in
31398         mscorlib; if the assembly name is provided, only try that one.
31400 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
31402         * object.c: register the vtable before there is a chance it's
31403         queried again recursively.
31405 2003-01-13  Duncan Mak  <duncan@ximian.com>
31407         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
31408         gc-internal.h. 
31409         
31410 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
31412         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
31414 2003-01-11  Martin Baulig  <martin@ximian.com>
31416         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
31417         this to 20 for the release.
31419 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
31421         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
31423         * loader.c (mono_method_get_marshal_info): bug fix
31425         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
31426         structures with explicit layout
31428 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
31430         * profiler.c: made the output more readable (and sorted). 
31431         Added caller information for the allocation profiler.
31433 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
31435         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
31437 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31439         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
31440         to get value types.
31441         
31442 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
31444         * object.c, profiler.h, profiler.c, profiler-private.h:
31445         Added object allocation profiler.
31447 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
31449         * reflection.h, reflection.c: handle global methods.
31450         Compress blob entries.
31452 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
31454         * marshal.c: fix compilation.
31456 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
31458         * loader.c (mono_method_get_marshal_info): impl.
31460         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
31462 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31464         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
31465         for reference types.
31467 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
31469         * loader.c: fixed off by one error in loaded parameter names.
31471 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
31473         * marshal.c (mono_marshal_get_icall_wrapper): like
31474         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
31475         instead of a MonoMethod.
31477 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31479         * decimal.c: fixed bug #36537.
31481 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
31483         * marshal.c: throw a missing method exception if a
31484         P/Invoke method is not found.
31486 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
31488         * icall.c: allow a null this for constructors.
31490 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
31492         * icall.c: raise the proper exceptions if the arguments to the
31493         internal Invoke are incorrect.
31495 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
31497         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
31499 2003-01-03  Martin Baulig  <martin@ximian.com>
31501         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
31503 2002-12-31  Martin Baulig  <martin@ximian.com>
31505         * debug-mono-symfile.c: Completely rewrote the type section.
31506         Instead of using individual malloc()ed fields, we use one big
31507         continuous memory area and offsets into this area.
31508         See the comments in the source code for details.
31510 2002-12-30  Martin Baulig  <martin@ximian.com>
31512         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
31514 2002-12-30  Martin Baulig  <martin@ximian.com>
31516         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
31517         line number table in this data blob instead of using an external
31518         pointer.
31520 2002-12-28  Martin Baulig  <martin@ximian.com>
31522         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
31524 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
31526         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
31527         as a boxed return type.
31529 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
31531         * appdomain.c
31532         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
31533         g_build_filename to properly get separators on the filename created.
31535         * object.h: Small change, introduce MonoMarshalByRefObject to
31536         track the layout of that structure in the C# universe as we make
31537         changes there.
31539 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
31541         * object.c: removed assert to allow static fields on interfaces.
31542         * loader.c: a TypeSpec may be used for any type, not just arrays.
31544 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
31546         * class.c, class.h: added mono_class_array_element_size ().
31547         Ignore static methods in interfaces.
31549 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31551         * threads.c: fixed the build under cygwin.
31553 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
31555         * reflection.c: handle nullref constants. Allocate keys for
31556         reflection handles with the GC.
31558 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
31560         * threads.c, threads.h: added mono_thread_get_abort_signal()
31561         to get a suitable signal for thread abort.
31563 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
31565         * metadata.c: fix handling of ExportedType table.
31567 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31569         * icall.c: added WriteWindowsDebugString internal call.
31571 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31573         * reflection.h: added fields to match C# implementation.
31575 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31577         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
31579 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
31581         * gc.h, gc-internal.h: Rename header for GC internal calls to
31582         gc-internal.h from gc.h as to not clash with Boehm GC having its
31583         header installed as <gc.h> in outside include paths.
31584         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
31585         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
31587 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31589         * icall.c: assign minor, build and revision in FillName.
31591 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
31593         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
31594         Added support for running code generated by Reflection.Emit.
31596 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31598         * appdomain.c: check for NULL argument in LoadFrom.
31600 2002-12-10  Dick Porter  <dick@ximian.com>
31602         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
31604 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31606         * appdomain.c: fix buglet when building exe file name.  Handle full
31607         assembly name (needed after latest changes to AssemblyName).
31608         * image.c:
31609         (mono_image_close): free some hashtables.
31611 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
31613         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
31614         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
31615         on some systems (redhat 7.3) 
31617 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
31619         * threads.c: delete the critical section of a sync block,
31620         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
31622 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
31624         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
31626 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31628         * appdomain.[ch]: handle the assembly preload event to try loading the
31629         assemblies using the paths we have in the current domain.
31631         * assembly.[ch]: created an assembly preload hook that is called to try
31632         loading the assembly by other means that the ones provided here.
31634         * domain.c: initialize the domain search path.
31636         From now on, assemblies (TODO: except corlib and System) are loaded
31637         according to these rules when using mono_assembly_load ():
31639                 1. It tries to load the assembly from the ApplicationBase
31640                 of the current domain appending .dll and .exe (TODO: have to
31641                 try loading from name/name.dll and name/name.exe).
31643                 2. It tries the search path specified in PrivateBinPath for the
31644                 current domain (if any).
31646                 3. Previous behavior.
31648 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
31650         * icall.c: implemented GetInterfaceMap() related icall.
31651         * domain.c, loader.h: load MethodInfo in mono_defaults.
31653 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
31655         * gc.c: disable the finalizer thread for now, untill all the issues
31656         with it are resolved.
31658 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
31660         * string-icalls.c: handle embedded nulls in string ctor when the
31661         length is specified.
31663 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
31665         * class.c: look for explicit interface implementation in parent
31666         classes, too.
31668 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
31670         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
31672 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
31674         * gc.c: protect handles with a critical section.
31676 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31678         * icall.c:
31679         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
31680         parameters. If no assembly specified, try getting the type from all
31681         the assemblies in the current domain, else, load the assembly and get
31682         the type from it.
31684 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31686         * marshal.c: applied patch from Aleksey Demakov that fixes
31687         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
31689 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31691         * icall.c: fixed get_location.
31693 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
31695         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
31696         declarations to make it work with older gcc. 
31698         * loader.c (mono_get_method): set signature->pinvoke for native calls
31700 2002-11-20  Dick Porter  <dick@ximian.com>
31702         * threads.c (mono_thread_init): Set the main thread's handle
31704 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
31706         * gc.c: allow compilation without GC support. Changed to match the
31707         mono coding style.
31709 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
31711         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
31713 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
31715         * reflection.c: set a public key token on the core assemblies.
31717 2002-11-18  Dick Porter  <dick@ximian.com>
31719         * threads.c: Split out some thread initialisation so that other
31720         files can set the start callback function.
31722         * gc.c: Run finalisers in a separate thread, to avoid stack
31723         overflow.  Fixes bug 31333.
31725         * appdomain.c: Set up GC finalisation thread.
31727         * reflection.c: 
31728         * object.c: 
31729         * domain.c: Use gc.h macros for GC_malloc
31730         
31731 2002-11-15  Dick Porter  <dick@ximian.com>
31733         * threadpool.c: 
31734         * threads.c:
31735         * appdomain.c: Removed mono_runtime_init_with_attach(),
31736         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
31737         merging the extra parameter with the existing function.  Removed
31738         unneeded code in mono_thread_attach().
31740 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
31742         * image.c (mono_image_loaded_by_guid): a method to get loaded
31743         images by guid. 
31744         (load_metadata_ptrs): we store the guid as string.
31746 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
31748         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
31750         * metadata.c (mono_guid_to_string): imported method form Zoltan
31751         Varga (slightly modified)
31753         * assembly.c (mono_assembly_open): load precompiled code
31755         * loader.h (MonoMethod): we store the method token for use in the
31756         aot compiler. 
31758 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31760         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
31761         the hook function called when an assembly is loaded.
31762         
31763         * domain.c: Modified file.
31764         (mono_domain_assembly_load): removed hash table insertion of assemblies.
31766         Fixes bug #33196.
31768 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
31770         * reflection.c: Map PEFileKind to the value expected by the WinNT
31771         image loader. 
31773 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31775         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
31776         Read until the buffer is filled completely.
31778 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31780         * icall.c: implemented MonoType.InternalGetEvent ().
31782 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31784         * appdomain.c: implemented InitAppDomainSetup. Delayed
31785         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
31786         the entry_assembly.
31788         * assembly.c: base_dir is now an absolute path ending with
31789         G_DIR_SEPARATOR.
31791         * icall.c: modified get_location according to the above changes.
31793         * object.c: init AppDomain.SetupInformation for the default domain after
31794         we have the entry assembly.
31796         * domain.c: when unloading a domain, setup = NULL.
31798 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
31800         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
31802 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
31804         * object.h, object.c: introduced mono_object_get_virtual_method ()
31805         to lookup the method invoked on an object when a callvirt is done on
31806         a method.
31807         * icall.c: make MethodInfo::Invoke() always do a virtual call.
31809 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31811         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
31812         current domain when loaded an assembly and failed to load it.
31814         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
31816 2002-10-31  Dick Porter  <dick@ximian.com>
31818         * icall.c: 
31819         * file-io.h: 
31820         * file-io.c: Return the error status in a parameter, as the
31821         GetLastError() value has long since been blown away if we try and
31822         look it up in a subsequent internal call invocation.  Delete the
31823         GetLastError() internal call, because it's useless.
31825 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
31827         * class.[ch]: added cast_class to fix bug 29517
31829 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
31831         * marshal.c: create valid IL code in the filter clause:
31832         the new JIT is less forgiving:-)
31834 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31836         * icall.c: removed get_property internal call.
31838 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
31840         * appdomain.h domain.c: Added an ID to appdomains.
31841         
31842         * threads.c threads.h icall.c: Implement icall
31843         Thread:GetDomainID(), and remove unused icall 
31844         CurrentThreadDomain_internal.
31846 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31848         * icall.c: Don't recurse through the base types in GetConstructor.
31849         Fixes bug #32063. 
31851 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
31853         * mempool.h, mempool.c: added mono_mempool_empty() and
31854         mono_mempool_stats().
31856 2002-10-23  Dick Porter  <dick@ximian.com>
31858         * file-io.c: 
31859         * file-io.h: 
31860         * icall.c: Added MonoIO.GetFileType internal call
31862 2002-10-17  Dick Porter  <dick@ximian.com>
31864         * appdomain.c (mono_runtime_cleanup): Don't signal the async
31865         delegate semaphore before waiting for all threads to finish,
31866         because new threads can also call async delegates.  Fixes bug
31867         32004.
31869         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
31870         of 3 seconds, in case another async job is queued.  (This part is
31871         needed because the bug fix reintroduced the 3s exit lag.)  This
31872         makes the mono_runtime_shutdown flag superfluous.
31874 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
31876         * reflection.c: include ehader size in method section headers.
31877         Really check for suplicated modules entries.
31879 2002-10-17  Martin Baulig  <martin@gnome.org>
31881         * debug-mono-symfile.c: Added back support for locals.
31883 2002-10-14  Martin Baulig  <martin@gnome.org>
31885         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
31886         MONO_TYPE_VOID.
31888 2002-10-14  Martin Baulig  <martin@gnome.org>
31890         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
31891         mono_class_get() instead of looking in the class cache. 
31893 2002-10-13  Martin Baulig  <martin@gnome.org>
31895         * debug-mono-symfile.c: Set version number to 28, include the
31896         signature in method names.
31898 2002-10-13  Martin Baulig  <martin@gnome.org>
31900         * debug-mono-symfile.h: Set version number to 27.
31902 2002-10-11  Martin Baulig  <martin@gnome.org>
31904         * gc.c: Don't register/unregister NULL pointers as disappearing links.
31906 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31908         * metadata.c, metadata.h: added helper function to allocate signatures.
31910 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31912         * icall.c: added internal call to get the location of machine.config.
31914 2002-10-08  Martin Baulig  <martin@gnome.org>
31916         * debug-mono-symfile.c: Ignore classes with a pending init for the
31917         moment.
31919 2002-10-03  Dick Porter  <dick@ximian.com>
31921         * threads.c: Freebsd pthread_t is a pointer
31923 2002-10-03  Dick Porter  <dick@ximian.com>
31925         * socket-io.c: Implemented GetHostName_internal
31927 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31929         * mono-config.c:
31930         (mono_config_parse_file): don't leak the text.
31932 2002-10-02  Martin Baulig  <martin@gnome.org>
31934         * debug-mono-symfile.c: Added support for methods.
31936 2002-10-01  Martin Baulig  <martin@gnome.org>
31938         * debug-mono-symfile.c: Don't emit methods and line numbers for
31939         the dynamic symbol file, just write the type table.  We can easily
31940         have an external helper program which creates a symbol file for an
31941         IL file.        
31943 2002-10-01  Dick Porter  <dick@ximian.com>
31945         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
31946         Only add the handle to the cleanup array when we're about to
31947         launch the thread.  Bug 31425 deadlocked when the test was run on
31948         mono under w32.
31950 2002-10-01  Martin Baulig  <martin@gnome.org>
31952         * debug-mono-symfile.c: Added support for properties.
31954 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
31956         * reflection.c: unaligned store fix from Mark Crichton
31957         <crichton@gimp.org>.
31959 2002-09-27  Martin Baulig  <martin@gnome.org>
31961         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
31962         New interncall.
31964 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
31966         * assembly.h, assembly.c: use a sane API to hook into the assembly
31967         loading process instead of a useless special-purpouse hack
31968         (ngen needs a hook, too, for example).
31970 2002-09-27  Dick Porter  <dick@ximian.com>
31972         * threads.c (mono_thread_init): Call GetCurrentProcess() so
31973         io-layer can set up some process handle info.  Not needed on w32,
31974         but doesn't hurt either.
31976         * process.c: Pass the program name in the second parameter to
31977         CreateProcess, so the path is searched.  Include the working
31978         directory. Implemented process name, process enumeration, and some
31979         process detail internal calls.
31980         
31981         * icall.c: Added internal calls for process lookup, and some
31982         process details
31984 2002-09-26  Martin Baulig  <martin@gnome.org>
31986         * assembly.c (mono_install_open_assembly_hook): New global
31987         function to install a function to be invoked each time a new
31988         assembly is loaded.
31989         (mono_assembly_open): Run this callback function if set.
31991         * debug-mono-symfile.c: Put back line numbers for the dynamic
31992         symbol file and also record the .il file as source file.  This
31993         allows us to install the temporary symbol file as `file.dbg' just
31994         like a compiler-generated one.
31996 2002-09-26  Nick Zigarovich <nick@chemlab.org>
31998         * Corrected typo in gc.c (BOHEM vs BOEHM).
32000 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32002         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
32003         GetProperties. Also avoid calling g_slist_length in GetProperties and
32004         GetMethods.
32006 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
32008         * reflection.c: avoid unaligned stores (bug spotted by
32009         Mark Crichton  <crichton@gimp.org>).
32011 2002-09-25  Martin Baulig  <martin@gnome.org>
32013         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
32014         instead of guint64 for addresses and added prologue/epilogue info.
32016 2002-09-25  Martin Baulig  <martin@gnome.org>
32018         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
32019         store line number info.  For the dynamic symbol file, we only need
32020         to provide the JIT generated dynamic line number info for the dynamic
32021         symbol file.
32023 2002-09-25  Martin Baulig  <martin@gnome.org>
32025         * debug-mono-symfile.h: Incremented version number.
32027 2002-09-24  Martin Baulig  <martin@gnome.org>
32029         * class.c (mono_debugger_class_init_func): New global function
32030         pointer variable.
32031         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
32032         call it.
32034         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
32035         function.  This is called via the mono_debugger_class_init_func
32036         hook to add all types to the dynamic type table.
32037         (ves_icall_MonoDebugger_GetType): New interncall to get a class
32038         from its metadata token.
32040         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
32041         New interncall for the debugger.
32043 2002-09-24  Nick Drochak <ndrochak@gol.com>
32045         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
32046         before using it in case it is null.
32047         
32048 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32050         * metadata.c: allow custom modifiers in local var signatures
32051         (bug spotted by Zoltan Varga).
32053 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
32055         * class.c: deal with the <Module> class that may have a NULL vtable.
32056         Eliminate warnings.
32058 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
32060         * image.c, image.h: more strong name helpers.
32061         * monosn.c: more work: convert pem keys to cryptoapi format.
32063 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32065         * string-icalls.c: speedup IndexOf.
32067 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
32069         * icall.c: updates from Zoltan.2.Varga@nokia.com.
32071 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32073         * icall.c: cleanup: use mono_object_domain ().
32075 2002-09-23  Martin Baulig  <martin@gnome.org>
32077         * debug-mono-symfile.c: Improved type support.
32079 2002-09-22  Martin Baulig  <martin@gnome.org>
32081         * debug-mono-symfile.c: Added support for reference types and strings.
32083 2002-09-22  Martin Baulig  <martin@gnome.org>
32085         * debug-mono-symfile.c: Started to work on the type table.
32087 2002-09-21  Martin Baulig  <martin@gnome.org>
32089         * debug-mono-symfile.c: Largely reworked the symbol table format.
32090         The symbol table is now incrementally updated each time a new
32091         method is added.  We're now also using our own magic and version
32092         so that you don't need to recompile all your classes if the
32093         dynamic table changes.
32094         (mono_debug_update_mono_symbol_file): Removed.
32095         (mono_debug_symfile_add_method): New function to add a method.
32097 2002-09-21  Martin Baulig  <martin@gnome.org>
32099         * icall.c
32100         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
32101         New interncall.
32103         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
32104         New interncall to get a method from its metadata token.
32106 2002-09-21  Martin Baulig  <martin@gnome.org>
32108         * debug-mono-symfile.c: Create type table.
32110 2002-09-20  Martin Baulig  <martin@gnome.org>
32112         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
32114 2002-09-20  Martin Baulig  <martin@gnome.org>
32116         * debug-mono-symfile.c: Provide information about params and locals.
32118 2002-09-20  Martin Baulig  <martin@gnome.org>
32120         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
32121         New interncall.
32123         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
32124         interncall to get a method from its metadata token.
32126 2002-09-20  Martin Baulig  <martin@gnome.org>
32128         * debug-mono-symfile.c: Added a few checks for method->header
32129         being non-NULL.  This should never happen, but for the moment
32130         let's use a g_warning() rather than a g_assert().
32132 2002-09-19  Mark Crichton  <crichton@gimp.org>
32134         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
32135         even if support for it isn't present.  Added an #ifdef to fix this.
32137         * socket-io.c: Added checks back for Solaris support.
32139 2002-09-19  Martin Baulig  <martin@gnome.org>
32141         * debug-mono-symfile.c (read_string, write_string): Reflect latest
32142         changes in the symbol file format.
32144 2002-09-18  Martin Baulig  <martin@gnome.org>
32146         * debug-mono-symfile.c: Set version number to 21.
32148 2002-09-18  Dick Porter  <dick@ximian.com>
32150         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
32151         on netbsd.  Fixes bug 30051.
32153 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32155         * reflection.c:
32156         (set_version_from_string): little fix.
32158 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
32160         * monosn.c, Makefile.am: added strong name utility.
32161         * reflection.h, reflection.c: implemented delayed signing,
32162         locale, version and hash id assembly attributes.
32164 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
32166         * loader.c, metadata.c: load param attributes in signatures.
32168 2002-09-16  Martin Baulig  <martin@gnome.org>
32170         * debug-mono-symfile.c: Added string table with all method names.
32172 2002-09-14  Martin Baulig  <martin@gnome.org>
32174         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
32175         fast method lookup.
32177 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
32179         * reflection.c: record the public key token of referenced assemblies.
32181 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32183         * image.c, image.h: added functions to get the strong name and the
32184         public key of an assembly.
32185         * pedump.c: use them.
32187 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
32189         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
32191 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
32193         * marshal.c (mono_marshal_get_managed_wrapper): Added
32194         MONO_TYPE_BOOLEAN 
32196 2002-09-11  Martin Baulig  <martin@gnome.org>
32198         * gc.c: Call GC_unregister_disappearing_link() on all links when
32199         finalizing them, this is necessary to aviod a crash in boehm's
32200         finalize handler.
32202 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32204         * gc.c: handle GetTarget for finalized objects spotted and fixed by
32205         nick@chemlab.org.
32207 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
32209         * icall.c: implemented MonoType::Module.
32210         * reflection.c, reflection.h: mono_module_get_object () from
32211         Tomi Pakarinen <tomi.pakarinen@welho.com>.
32213 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
32215         * icall.c: ignore overridden methods in GetMethods ().
32216         Fix for FieldInfo::SetValue().
32217         * object.c: handle float/double in runtime invoke.
32219 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32221         * object.c: allow a constructor to be called again on an object.
32223 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
32225         * class.h, class.c: move field layout code to it's own function and
32226         export it. Get an interface id earlier. Move fields in MonoClass
32227         so they are more cache friendly and align the bitfields.
32228         * loader.c: temporary handle get_param_names() for a runtime method.
32229         * reflection.c, reflection.h: more code to handle runtime creation of
32230         types.
32232 2002-09-09  Martin Baulig  <martin@gnome.org>
32234         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
32235         signature with the pinvoke field being set for the actual call.
32237 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32239         * icall.c: removed some unused icalls. Start of map of glib charsets
32240         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
32242 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
32244         * debug-helpers.c: break infinite loop (found and fixed by
32245         Holger Arnold <harnold@gmx.de>).
32247 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
32249         * icall.c: target may be null in create_delegate.
32251 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
32253         * marshal.c: handle a boolean return type.
32255 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
32257         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
32259 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
32261         * gc.c: fix weakreferences.
32263 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
32265         * icall.c: added icall to get default codepage.
32267 2002-09-03  Dick Porter  <dick@ximian.com>
32269         * threads.h: 
32270         * threads.c: Use MonoThread instead of MonoObject where
32271         apropriate.
32273         Store running thread objects in a hash table, so that we have all
32274         the info to hand when waiting for them to finish
32275         (means we don't need OpenThread() any more, so mingw builds should
32276         be fully functional again.)
32278         * verify.c:
32279         * object.h: Added thread ID to MonoThread
32281 2002-09-03  Martin Baulig  <martin@gnome.org>
32283         * icall.c (System.Reflection.Assembly::get_location): New interncall.
32285 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32287         * icall.c: fixed leak in get_temp_path. Thanks lupus.
32289 2002-09-03  Martin Baulig  <martin@gnome.org>
32291         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
32292         argument to store the end address of the disassembled instruction.
32294         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
32295         here from debug-symfile.h.
32296         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
32297         JIT into this struct.
32298         (MonoSymbolFile): Added `char *image_file' field.
32299         (MonoDebugGetMethodFunc): Removed.
32300         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
32301         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
32302         (mono_debug_find_method): New method.
32304         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
32305         create a full symbol file.
32306         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
32307         and static symbol files.
32308         (mono_debug_find_method): The symbol file keeps an internal method hash,
32309         call this to get a MonoDebugMethodInfo from a MonoMethod.
32311         * debug-symfile.[ch]: Removed.
32313 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
32315         * image.c (do_mono_image_open): Remove linker version check.
32317 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
32319         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
32320         wrappers for instance methods.
32321         
32322 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32324         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
32326 2002-08-28  Dick Porter  <dick@ximian.com>
32328         * Makefile.am: Export HOST_CC for w32 builds
32330 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
32332         * file-io.c process.c: MonoString are null terminated, no
32333         need for mono_string_to_utf16() anymore.
32335 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32337         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
32339 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
32341         * icall.c, reflection.h: speedup System.MonoType.
32343 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
32345         * reflection.c: allow null as the value of a string argument in
32346         custom attributes constructors.
32348 2002-08-27  Martin Baulig  <martin@gnome.org>
32350         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
32351         `trampoline_address' field.
32353 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
32355         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
32356         check (fixes bug #29486) 
32358 2002-08-27  Martin Baulig  <martin@gnome.org>
32360         * debug-mono-symfile.c: Changed the file format in a way that allows us
32361         open it read-only and to use a specially malloced area for all the
32362         dynamic data.  We can now also generate a symbol file on-the-fly if we're
32363         debugging IL code and there is no MCS generated symbol file for it.
32365 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32367         * object.c: added a define for a good string and array
32368         creation speedup (not enabled by default because we need to deal with
32369         the synch stuff).
32371 2002-08-26  Martin Baulig  <martin@gnome.org>
32373         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
32374         function to create a dynamic symbol file.  This is used by the
32375         debugger to create a symbol file for IL code on-the-fly.
32377 2002-08-26  Martin Baulig  <martin@gnome.org>
32379         * loader.c (mono_lookup_pinvoke_call): Include the error message
32380         from g_module_error() in the error message.
32382 2002-08-24  Martin Baulig  <martin@gnome.org>
32384         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
32385         function to update the symbol file.  The symbol file is mmap()ed
32386         writable, but private.  This allows us to install the symbol file
32387         together with the assembly.
32389 2002-08-24  Martin Baulig  <martin@gnome.org>
32391         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
32392         but they can read the new symbol file format which mcs is now creating.
32394         * debug-symfile.c (mono_debug_find_source_location): Moved to
32395         debug-mono-symfile.c; this is now operating on the new symbol file.
32397 2002-08-23  Martin Baulig  <martin@gnome.org>
32399         * debug-helpers.c (mono_method_desc_from_method): New function to get
32400         a MonoMethodDesc from a MonoMethod.
32402 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
32404         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
32405         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
32407 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
32409         * string-icalls.[ch]: make helper methods static.
32411 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32413         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
32414         types to it and to SetValueInternal.
32416         * object.c: Moved handle_enum label to its proper place. This was the
32417         f... bug! ;-)
32419         This time i compiled mcs and gtk-sharp and they both work.
32421 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32423         * icall.c: reverted partially my previous patch until 
32424         object.c:set_value handles enums correcly.
32426 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32428         * icall.c:
32429         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
32430         (ves_icall_System_Environment_get_MachineName): removed warning when
32431         compiling under cygwin.
32433 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32435         * object.c: fixed field_get_value() for reference types.
32437 2002-08-22  Dick Porter  <dick@ximian.com>
32439         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
32440         Don't free a buffer while it's still needed.  Patch from Jonathan
32441         Liger <Jonathan.liger@wanadoo.fr>
32443 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
32445         * icall.c (ves_icall_System_Environment_get_Platform): Add new
32446         internal call.
32448 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
32450         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
32451         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
32453         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
32454         we call unmanaged code which throws exceptions.
32456 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32458         * appdomain.h: added per-domain entry_assembly.
32459         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
32460         arguments.
32461         * icall.c: Assembly::GetEntryAssembly icall.
32462         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
32463         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
32465 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32467         * appdomain.h, gc.c: added mono_domain_finalize ().
32469 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32471         * object.c:
32472         (mono_print_unhandled_exception): changed g_warning by g_printerr
32473         because g_log has a 1024 characters limit (yeah, i got a big stack
32474         trace). Don't print exception name, that should be in ToString 
32475         returned string.
32477 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32479         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
32480         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
32482 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32484         * object.c:
32485         (mono_print_unhandled_exception): after previous commit, i realized
32486         that MS calls ToString on the exception. I changed this function to
32487         do that. This way we get stack_trace for free.
32489 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32491         * object.c:
32492         (mono_print_unhandled_exception): invoke Message property instead of
32493         getting 'message' field from Exception. Don't allocate memory for
32494         'trace' and 'message' if not needed.
32496 2002-08-18  Dick Porter  <dick@ximian.com>
32498         * unicode.c: Fix asserts to match Encoder.cs checks
32500 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32502         * marshal.c: fix unaligned store issue and a few wrong
32503         opcode argument types.
32505 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32507         * icall.c: added GetUninitializedObjectInternal internal call.
32509 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
32511         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
32512         to the right domain.
32514 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
32516         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
32518         * class.c (class_compute_field_layout): set blittable to false for Strings
32520         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
32522 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32524         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
32525         first chunk of code to create types at runtime. Code to
32526         handle ReflectedType/DeclaringType. Make reflection handles
32527         domain specific.
32529 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
32531         * class.c: set correct name in arrays.
32533 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
32535         * appdomain.c (mono_domain_transfer_object): make it work with
32536         valuetypes. bug fixes.
32538 2002-08-12  Dick Porter  <dick@ximian.com>
32540         * object.h: Rename some parameters to avoid c++ keywords (Patch
32541         from Joseph Wenninger <kde@jowenn.at>)
32543 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
32545         * icall.c: added icall to implement Assembly.GetFile*.
32547 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32549         * reflection.h, reflection.c: code to embed managed resources.
32551 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
32553         * class.c: move all the type size stuff into
32554         class_compute_field_layout().
32556 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32558         * class.c: ensure enums have always the correct instance size.
32559         * unicode.c: remove wrong assert.
32561 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
32563         * assembly.c: fix mem corruption issue.
32564         * image.h, image.c: added mono_image_get_resource () to access
32565         managed resources.
32566         * icall.c: implemented Assembly.EntryPoint property and some
32567         Managed Resources related internalcalls.
32570 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
32572         * image.c, image.h: impemented mono_image_get_entry_point ().
32573         * appdomain.c: use mono_image_get_entry_point.
32575 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32577         * reflection.c: support the object type argument when loading
32578         custom attributes.
32580 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
32582         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
32583         String as return type.
32585 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
32587         * reflection.c: fix encoding of named args for custom attrs to match
32588         the ms implementation. Read them back when instantiating custom
32589         attributes.
32591 2002-08-02  Radek Doulik  <rodo@ximian.com>
32593         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
32594         by Dietmar as quick fix
32595         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
32596         16 as stack size, used on more places as quick fix before Dietmar
32597         will fix it properly
32599 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32601         * object.h, object.c: added accessors for fields and properties.
32603 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
32605         * class.c, class.h: made mono_class_get_field_from_name ()
32606         loop on parent types.
32607         Added mono_class_get_property_from_name ().
32609 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32611         * class.c, class.h: move the code to setup the type vtable in its own
32612         function so that it can be reused also for types created at runtime.
32613         Eliminate the "class" identifier from the header file.
32614         * reflection.c: setup the vtable for enums so that we can create
32615         objects for use in SetConstant ().
32617 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
32619         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
32620         instead of the delegate itself as this pointer (bug #28383)
32622 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
32624         * marshal.c (mono_marshal_get_managed_wrapper): added return type
32625         conversions.
32627 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32629         * loader.c: don't set the pinvoke bit on icalls.
32631 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
32633         * debug-helpers.c (mono_method_full_name): only print a number to
32634         indicate wrapper type (so that the output is more readable in traces).
32636 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
32638         * class.c (mono_class_init): include method override patch from Paolo
32640 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
32642         * icall.c: fixed GetTypeCode().
32644 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
32646         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
32647         use real delegate invoke function to make it work with multicast
32648         delegates (fix bug# 28291).
32650 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32652         * object.c: load constant strings.
32654 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32656         * reflection.c: no magic numbers.
32657         * tabledefs.h: security action enum.
32659 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32661         * assembly.c: fix possible memory corruption.
32663 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32665         * reflection.h, reflection.c: added support for linking resources.
32666         * verify.c: check we have an updated corlib.
32668 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
32670         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
32671         string arrays.
32672         (mono_marshal_string_array): null terminate unmanaged string arrays.
32673         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
32675 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32677         * icall.c: Type.GetType () can now return also types from the
32678         calling assembly.
32680 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
32682         * loader.h, loader.c: stack walking support.
32683         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
32684         GetCallingAssembly.
32686 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
32688         * marshal.c: added optimisations for blittable types 
32690         * class.c (mono_array_class_get): do not set blittable attribute on arrays
32691         (mono_class_setup_mono_type): set blittable attribute for single
32692         and double.
32694         * marshal.c (mono_string_utf8_to_builder): impl.
32695         (mono_string_builder_to_utf8): impl.
32696         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
32698 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
32700         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
32701         (mono_marshal_get_managed_wrapper): impl. byref types
32703 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32705         * icall.c:
32706         (search_method): don't display debug message. 
32708 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
32710         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
32712 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
32714         * appdomain.c: set the missing filename when throwing exception.
32716 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
32718         * metadata.c (mono_type_size): code cleanup
32719         (mono_type_stack_size): removed some test code
32721 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
32723         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
32724         mono_get_exception_file_not_found now.
32726         * exception.c (mono_exception_from_name_two_strings): New version
32727         that will call a constructor with two string arguments. 
32728         (mono_get_exception_file_not_found): New helper routine, used to
32729         report file-not-found errors.
32731 2002-07-20  Dick Porter  <dick@ximian.com>
32733         * process.h:
32734         * process.c: Pass file handles to CreateProcess
32735         
32736         * icall.c:
32737         * file-io.h:
32738         * file-io.c: Implemented CreatePipe
32740 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
32742         * metadata.c (mono_get_param_info): set alignment for value types
32744 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32746         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
32747         Constify mono_domain_assembly_open().
32748         * loader.c: handle null namespace in icalls.
32750 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
32752         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
32753         (emit_str_to_ptr_conv): marshal object as structs
32755         * metadata.c (mono_type_to_unmanaged): marshal object as structs
32757         * marshal.c (mono_marshal_get_runtime_invoke): support value types
32759 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
32761         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
32762         (mono_marshal_get_native_wrapper): we an now return value types
32764 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32766         * verify.c: more checks implemented.
32768 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
32770         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
32771         (fix bug #27695)
32772         (mono_marshal_get_native_wrapper): allow byref arguments
32773         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
32774         impl. PtrToStringXXX methods
32775         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
32776         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
32777         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
32778         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
32779         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
32781 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32783         * reflection.c: fix buglet in parsing an assembly name.
32785 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
32787         * marshal.c (emit_ptr_to_str_conv): first impl.
32789 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
32791         * object.c, class.h: cache the vtable in the class as suggested by
32792         vargaz@freemail.hu (Zoltan Varga).
32794 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32796         * class.h, loader.c: added mono_field_from_token().
32797         * verify.c: first cut of type checking code.
32799 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
32801         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
32803 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
32805         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
32806         (fix bug #27782)
32807         (mono_marshal_get_remoting_invoke): impl.
32808         (mono_delegate_begin_invoke): impl.
32809         (mono_mb_emit_save_args): impl.
32810         (mono_delegate_end_invoke): impl.
32811         (mono_marshal_get_delegate_begin_invoke):
32812         (mono_marshal_get_delegate_end_invoke):
32813         (mono_marshal_get_delegate_invoke): generate a special name for
32814         those methods (including the signature) and associate them whith
32815         the delegate class. 
32817 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
32819         * reflection.[ch]: 
32820         (mono_reflection_type_from_name): now it has a MonoImage parameter
32821         which is used as the default image to search the type in. If the image
32822         is NULL or getting the type from it fails, it defaults to corlib.
32824         * icall.c: changed 1 call to mono_reflection_type_from_name to match
32825         new parameter.
32827 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
32829         * reflection.c: update the parameter table index.
32831 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32833         * domain.c: don't include the mark byte in the string hash.
32835 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
32837         * icall.cs: icall for Type.GetTypeCode ().
32838         * verify: a couple of fixes and disabled local initialization checks.
32840 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
32842         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
32844         * debug-helpers.c (mono_method_full_name): print the type of the
32845         runtime wrapper
32847         * metadata.c (mono_signature_hash): a hash function for signatures
32848         (mono_signature_hash): better hash algorithm
32850         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
32852         * debug-helpers.c (mono_method_full_name): this can now generate
32853         method names with signatures
32855         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
32856         method dont have this pointers.
32858 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
32860         * reflection.c: fixup typebuilder tokens.
32861         * image.c: fix buglet.
32862         * marshal.h: remove whitespace.
32863         * metadata.h, metadata.c: reinstate code that was removed.
32864         * verify.c: handle catch directives and fix another couple of bugs.
32866 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
32868         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
32869         (mono_marshal_get_native_wrapper): make it comp. with the old code
32870         (mono_marshal_get_native_wrapper): support boolean
32871         (mono_marshal_get_managed_wrapper): support more types
32873 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
32875         * class.c (class_compute_field_layout): compute class->blittable attribute.
32877 2002-07-09  Dick Porter  <dick@ximian.com>
32879         * threads.c: Make the thread cleaning up cope with threads that
32880         call ExitThread()
32882 2002-07-08  Radek Doulik  <rodo@ximian.com>
32884         * reflection.c (method_encode_code): use non-translated values to
32885         compute finally_start, this fixes exception handling on ppc, yay!
32887         * decimal.h (struct signscale): fix endianess
32889 2002-07-07  Radek Doulik  <rodo@ximian.com>
32891         * reflection.c: swap box_val and not val
32893 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
32895         * reflection.c, reflection.h: handle full assembly info in type name.
32896         Handle Type arguments when loading custom attributes.
32897         * icall.c: updated to use new mono_reflection_type_from_name () method.
32899 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32901         * loader.c:
32902         (method_from_memberref): also print assembly name when method not found.
32904 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32906         * icall.c:
32907         (ves_icall_TypeGetProperties): fixed bug #27473. 
32909 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32911         * reflection.c: display image name and token when cannot find the
32912         .ctor for an attribute.
32914 2002-07-05  Martin Baulig  <martin@gnome.org>
32916         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
32918 2002-07-04  Dick Porter  <dick@ximian.com>
32920         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
32921         compile on mingw.  This will cause mingw builds to not wait for
32922         subthreads to terminate after the main thread does.  I've lodged a
32923         bug with the mingw developers for them to wrap OpenThread().
32925 2002-07-03  Dick Porter  <dick@ximian.com>
32927         * threads.c: Store thread IDs instead of handles, because
32928         GetCurrentThread() returns a pseudohandle and therefore stores
32929         useless values.  mono_thread_cleanup() continues checking the
32930         array of threads until it is empty, to cope with subthreads
32931         spawning new threads after the main thread has finished.
32933         * profiler.h:
32934         * profiler.c:
32935         * profiler-private.h: Pass the thread ID to thread profiler
32936         functions, instead of a handle
32938 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32940         * verify.c: fixes to make it more usable.
32941         * pedump.c: added --verify code to verify IL code in an assembly.
32943 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32945         * reflection.c: turn errors into warnings to allow compiling corlib.
32947 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
32949         * reflection.c: add special cases to compile corlib.
32951 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
32953         * reflection.c: handle properties with only a set method.
32955 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32957         * opcodes.h: add enum with opcodes in opval order.
32959 2002-07-01  Dick Porter  <dick@ximian.com>
32960         
32961         * object.h:
32962         * object.c (mono_runtime_run_main): Removed unneeded argument
32964 2002-06-28  Martin Baulig  <martin@gnome.org>
32966         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
32968 2002-06-27  Dick Porter  <dick@ximian.com>
32970         * threads.c: Store the handle in both the parent thread and in the
32971         subthread, to minimise the time between starting a new thread and
32972         storing its ID.
32974 2002-06-26  Dick Porter  <dick@ximian.com>
32976         * appdomain.c (mono_runtime_cleanup): Close the socket library
32977         after all the threads have finished, not before
32979 2002-06-26  Martin Baulig  <martin@gnome.org>
32981         * debug-symfile.c (mono_debug_find_source_location): Added
32982         `guint32 *line_number' argument.  If it's not NULL, store the line number
32983         there and return the file name without the line number.
32985 2002-06-25  Dick Porter  <dick@ximian.com>
32987         * icall.c:
32988         * process.h:
32989         * process.c: Process forking and other support functions
32991 2002-06-25  Dick Porter  <dick@ximian.com>
32993         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
32994         things dont happen when the image is closed.
32995         (mono_image_lookup_resource): Walk the resource section looking
32996         for a particular entry
32998         * cil-coff.h: PE resource section decoding
33000 2002-06-25  Dick Porter  <dick@ximian.com>
33001         
33002         * assembly.h:
33003         * assembly.c: 
33004         (mono_assembly_foreach): Accessor functions to walk the list of
33005         loaded assemblies
33006         (mono_assembly_set_main):
33007         (mono_assembly_get_main): Process methods need to know which
33008         assembly is the "main" one
33010         * object.c (mono_runtime_run_main): Record the main assembly
33012         * debug-helpers.c: Fix typo
33014 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
33016         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
33017         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
33019 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
33021         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
33023 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
33025         * image.c (do_mono_image_open): Initialize reference count,
33026         otherwise we leak the MonoImage.
33028 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
33030         * reflection.c: small tweak to handle self-hosting.
33032 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33034         * reflection.c: fix type name parse code.
33036 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33038         * reflection.c: break out of the loop.
33039         * image.c: special case corlib.
33041 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33043         * reflection.c: add all the custom attrs at the end to ensure the
33044         ctors have been properly initialized when the attributes are defined
33045         in the current assembly.
33047 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33049         * reflection.c: handle correctly multiple-nested types.
33051 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
33053         * row-indexes.h: fix typos.
33054         * reflection.c: adjust for typos and fix method_def_or_ref
33055         encoding in MethodImpl table.
33057 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33059         * reflection.c: fix entry point patching (thanks Serge!).
33061 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
33063         * verify.c: add check for System.Exception
33065 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33067         * image.c, class.c: minifix for code just c&p'ed.
33068         * reflection.c: warning fix.
33069         * object.h, loader.h, domain.c: load also StringBuilder.
33071 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33073         * marshal.h, marshal.c: some support code to handle complex marshaling.
33075 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33077         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
33078         Better signatures with vtable error dump.
33080 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
33082         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
33084 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
33086         * icall.c (ves_icall_Type_GetField): impl.
33088 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33090         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
33091         to retrieve a marshal description blob for a field or param.
33093 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
33095         * reflection.h, reflection.c: change order of nested type emission
33096         to avoid table corruption. The NestedTypes table is sorted.
33097         * icall.c: change order of GetConstructor results to workaround mcs bug.
33099 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33101         * reflection.h, reflection.c: handle field and param marshal
33102         information.
33104 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33106         * icall.c, marshal.c marshal.h: more Marshal class implementation.
33108 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33110         * reflection.c: fix call convention.
33112 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33114         * reflection.h, reflection.c: mono_image_get_memberref_token()
33115         takes a type instead of a class, now. Added
33116         mono_image_get_array_token() to create tokens for the special
33117         multi-dim array methods.
33119 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33121         * assembly.c: handle modules (no assembly table). Split
33122         loading references in its own function.
33123         * class.c: handle moduleref resolution scope.
33124         * image.c, image.h: cache module name in image.
33126 2002-06-07  Martin Baulig  <martin@gnome.org>
33128         * reflection.c (mono_image_get_type_info): Only add a class layout entry
33129         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
33131 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
33133         * icall.c: more signature fixes that used uint instead of int.
33135 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33137         * reflection.c: fixed signature of field refs.
33139 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33141         * class.c, reflection.c: handle typerefs of nested types
33142         (both on read and when writing files).
33144 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
33146         * icall.c: fix method signatures that tried to workaround the previous
33147         typo, d'oh!
33149 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
33151         * debug-helpers.c: fix typo.
33153 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
33155         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
33156         rewrote the PE/COFF writing code (our programs are understood by the
33157         ms runtime, now).
33159 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
33161         * gc.c, gc.h, icall.c: weakreference support.
33163 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33165         * Makefile.am, mono-config.c: use $(sysconfdir).
33167 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33169         * icall.c: changed default precision of Double.ToString() to 15.
33170         Fixed memory leak. Unified with Single.ToString.
33172 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
33174         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
33176 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
33178         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
33179         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
33180         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
33181         and myself.
33183 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33185         * debug-symfile.c, sysmath.c: yet more compilation fixes.
33187 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33189         * reflection.c, socket-io.c: more compilation fixes.
33191 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33193         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
33194         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
33195         unicode.c: warning and compiler compatibility fixes.
33197 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33199         * class.h, metadata.c: fixed warnings/compilation errors.
33201 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
33203         * Makefile.am, mono-config.c, mono-config.h: configuration file
33204         support routines.
33205         * loader.c, loader.h: make Dll mapping configurable at runtime in the
33206         config file. Export methods to insert and lookup mappings.
33208 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
33210         * reflection.c: handle types and boxed objects in custom attr
33211         constructors.
33213 2002-05-30  Martin Baulig  <martin@gnome.org>
33215         * debug-symfile.c
33216         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
33218 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
33220         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
33221         to lookup the implmap row for a P/Invoke method.
33222         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
33223         P/Invoke method from the runtime on an as needed basis.
33225 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
33227         * metadata.c (mono_metadata_parse_signature): impl.
33229 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33231         * class.c: handle .pack directive.
33233 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33235         * object.c: initialize static fields with RVA data.
33237 2002-05-25  Martin Baulig  <martin@gnome.org>
33239         * debug-symfile.c
33240         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
33242 2002-05-24  Martin Baulig  <martin@gnome.org>
33244         * debug-symfile.c
33245         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
33246         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
33247         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
33249 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
33251         * object.c: special case string ctros in invoke.
33252         * gc.c: silly whitespace changes.
33254 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
33256         * threadpool.[ch]: impl. a threadpool that can
33257         be used by mint and mono.
33259 2002-05-22  Martin Baulig  <martin@gnome.org>
33261         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
33262         The first argument is now a `MonoReflectionModuleBuilder *', the return
33263         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
33264         `methods' field to get the method builder.  The `token' argument is the
33265         unfixed token.
33267         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
33268         invalid characters instead of g_assert_not_reached()ing.  This seems
33269         to be the behaviour of mscorlib.
33271 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
33273         * object.c (mono_runtime_invoke_array): applied patch from Rachel
33274         Hestilow to fix bug #25104
33276 2002-05-21  Martin Baulig  <martin@gnome.org>
33278         * debug-symfile.c (mono_debug_find_source_location): New function.
33279         Looks up an IL offset in the line number table and returns the source
33280         location as a string.
33282 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33284         * icall.c:
33285         (mono_double_ToStringImpl): changed %f by %g until we have something
33286         better.
33288 2002-05-21  Nick Drochak  <ndrochak@gol.com>
33290         * icall.c : Use different name for Math.Pow's icall.  Needed to check
33291         parameters first in C#.
33293 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33295         * icall.c, reflection.h: added icall to get info about an event.
33297 2002-05-20  Radek Doulik  <rodo@ximian.com>
33299         * object.c (mono_value_box): don't use memcpy for boxing on BIG
33300         endian
33301         (mono_value_box): don't use memcpy for small sizes on
33302         architectures with unaligned access
33304 2002-05-20  Martin Baulig  <martin@gnome.org>
33306         * reflection.c (mono_reflection_setup_internal_class): Don't crash
33307         if `tb->parent == NULL'.
33308         (mono_reflection_create_internal_class): New function.  This is
33309         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
33310         for enum types.
33312         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
33313         New interncall.
33315 2002-05-19  Martin Baulig  <martin@gnome.org>
33317         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
33318         argument to get the length, don't default to the array length.
33320 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
33322         * assembly.c (mono_assembly_setrootdir): New function used to
33323         override the MONO_ASSEMBLIES directory.
33325 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33327         * icall.c: ValueType_GetHashCode() initialize local var.
33329 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33331         * reflection.c: sort custom attributes table.
33333 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33335         * reflection.c: support named args in custom attributes (write support).
33337 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
33339         * reflection.c: fix finally position calculation.
33341 2002-05-15  Radek Doulik  <rodo@ximian.com>
33343         * reflection.c: fixed endianess at many places
33345         * icall.c (ves_icall_InitializeArray): comment out debug msg
33347 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
33349         * object.c (mono_unhandled_exception): new function to handle
33350         unhandled exceptions.
33351         (mono_unhandled_exception): call the UnhandledException event.
33352         (mono_runtime_delegate_invoke): impl.
33354 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
33356         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
33357         returns the RVA, not the direct pointer to the data. Handle the case
33358         when the class size is fixed.
33360 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33362         * reflection.c: fix some endianess issues.
33364 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
33366         * object.c (mono_runtime_invoke): is now able to catch exceptions.
33368         * threads.c (mono_thread_init): added a callback which is invoked
33369         at thread start.
33371 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
33372         
33373         * icall.c: make GetHashCode return non-negative values.
33375 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
33377         * object.c, icall.c, gc.c: revert to address-based hashcode.
33379 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
33381         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
33383 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33385         * icall.c, class.c: special case <Module>.
33387 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
33389         * icall.c: fix bug in GetNow().
33391 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
33393         * object.c (mono_runtime_class_init): make sure that we call all
33394         static class constructors.
33396 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33398         * reflection.c: sort methodsemantics table.
33400 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33402         * reflection.h, reflection.c: honour init locals setting.
33404 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
33406         * icall.c: copied Double ToStringImpl for Single ToStringImpl
33408 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33410         * reflection.c: support ContructorBuilders in attribute blob creation.
33412 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33414         * reflection.c: some changes to build a binary that can be run
33415         directly in windows.
33417 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
33419         * loader.c: print a big message when an icall can't be found.
33421 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33423         * string-icalls.c: fix bug 24248.
33425 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
33427         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
33428         icall.c, reflection.h: separate assembly loading by pathname and by
33429         assembly name. Use the MONO_PATH env var to search for assemblies.
33431 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33433         * assembly.c, image.h: add some support for assemblies
33434         with multiple modules.
33435         * class.c, class.h: export mono_class_from_typeref().
33436         * loader.c: remove duplicated code and use mono_class_from_typeref(),
33437         instead.
33439 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33441         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
33442         documentation says (the ECMA one is correct).
33444 2002-05-02  Dick Porter  <dick@ximian.com>
33446         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
33447         Don't name the synchronisation mutex.
33449 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
33451         * rand.c
33452         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
33453         Make the prototypes match.
33454         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
33455         Same.
33457         * icall.c
33458         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
33459         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
33460         all systems have tm.tm_zone, so use strftime() with %Z to print
33461         the timezone abreviation into a temp string.
33463         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
33464         rather than mono_array_addr() on a MonoString on Big Endian
33465         machines.
33467 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
33469         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
33470         fix bug 24041
33472 2002-04-30  Dick Porter  <dick@ximian.com>
33474         * socket-io.c: Cope with SOCKET being an integer rather than a
33475         pointer now.
33477         * threads.c: Added Thread_free_internal, to deal with thread
33478         handle cleanup.  Moved calls to handle_store() and handle_remove()
33479         to start_wrapper(), so each can only be called once.  Allocate
33480         synchronisation blocks with GC_malloc(), and use GC finalisation
33481         to close the handles.
33483         * icall.c: added System.Threading.Thread::Thread_free_internal
33485 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33487         * icall.c: support Environment.Exit, CommandLineArgs().
33489 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33491         * object.c, object.h: added mono_runtime_run_main () and
33492         mono_runtime_get_main_args () for use in System.Environment.
33494 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33496         * gc.c: fix thinko, enable actual finalization since the jit is now
33497         fixed.
33499 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33501         * gc.c, object.c: take into account that an object may be offset wrt the address
33502         returned by GC_malloc().
33504 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
33506         * image.c: handle files without entries in the assembly table (modules).
33508 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
33510         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
33511         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
33512         allowed to be null when it's System.Object class setup.
33514 2002-04-27  Martin Baulig  <martin@gnome.org>
33516         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
33517         if `tb->parent == NULL' rather than crashing.
33519 2002-04-28  Nick Drochak  <ndrochak@gol.com>
33521         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
33522         calling acos() where asin() should have been called.
33524 2002-04-26  Martin Baulig  <martin@gnome.org>
33526         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
33527         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
33528         there's a subdirectory called `System', but we don't want to read that
33529         subdirectory as an assembly.
33531 2002-04-25  Martin Baulig  <martin@gnome.org>
33533         * debug-symfile.c: Reflect latest MonoString changes.
33535 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33537         * rand.c, rand.h: instance method icalls need to have an explicit
33538         this pointer as first argument in the C implementation.
33540 2002-04-25  Nick Drochak <ndrochak@gol.com>
33542         * icall.c: Fix typo in map for GetNonZeroBytes
33544 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33546         * string-icalls.c : String does now passes unit tests without any 
33547         errors, the following changes has been made:
33548         
33549         Implemented replace methods.
33550         Renaming of methods to (try) follow the standard.
33551         Fixed compare ordinal
33552         Made all memory allocated directly to function instead of via icall function.
33553         Small performance fix in is_in_array function
33554                         
33555  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
33557         c (mono_string_Internal_ctor_charp_int_int):
33558         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
33559         sindex < 0, throw ArgumentOutOfRangeException instead of
33560         ArgumentNullException.
33562         Added new check for length == 0, however
33563         I need to make it return String.Empty from the C code.
33564         
33565         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
33566         that calculate the length for us here.
33567         
33568         (mono_string_Internal_ctor_sbytep_int_int): Replaced
33569         mono_string_new_utf16 with mono_string_new, since value is utf8.
33571 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33573         * object.c: register the object for finalization if needed.
33574         Allocate one more char in the string for the terminating 0 char.
33576 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33578         * class.c, class.h, image.c: check if a type implemenst a destructor.
33579         Use the proper key for array class lookups.
33580         * icall.c: register the icalls in the System.GC class.
33581         * gc.c, gc.h: GC-related functions and icalls.
33583 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33585         * icall.c:
33586         * socket-io.c:
33587         * unicode.c: free some strings gotten from mono_string_to_utf8 and
33588         changed a couple of free () by g_free ().
33590         * decimal.c: one-liner in the comments for decimal2string ().
33592 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33594         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
33596 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
33598         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
33599         * object.c (mono_runtime_invoke_array) : handle null in params
33601 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33603         * string-icalls.c: fixed bug in split (one off bug)
33605 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33607         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
33608         * icalls.c: added String::Equals as internal method
33610 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
33612         * threads.c: fixed bug in the double interlocked functions
33614 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
33616         * threads.c: implemented all of the new interlocked icalls.
33617         * string-icalls.c: fix a bug in insert.
33618         * icalls.c: added the icalls for interlocked, removed old string functions.
33619         
33620 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33622         * loader.c: fix off-by-one error when reading argument names.
33624 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33626         * profiler.c: win32 counter implementation (untested).
33627         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
33628         (the latter needs testing and more complete impl. from win32 folks).
33630 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
33632         * object.c: mono_array_new_full workaround mono_array_class_get
33633         problem.
33635 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33637         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
33638         * object.h (mono_string_chars): Changed casting type.
33640 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33642         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
33643                            method signatures to use gunichar2 instead of gint16.
33645 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
33647         * object.h, object.c: domain-specific versions of mono_object_new and
33648         mono_array_new.
33650 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
33652         * object.c: changed String layout
33654         * string-icalls.c (mono_string_Internal_ctor_chara): added
33655         internal string constructors.
33657 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
33659         * threads.c: pass 'this' to the thread start routine.
33661 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33663         * string-icalls.c: fix IndexOf and LastIndexOf. Now
33664         InternalCompareStr don't call twice mono_string_cmp_char for the last
33665         character. Improved performance in mono_string_cmp_char.
33667 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33669         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
33670         code into its own library: libmonoruntime.
33672 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
33674         * object.h, object.c: changed array format so that szarrays do not
33675         require a bounds structure.
33676         * icall.c, appdomain.c: support for new szarray format.
33678 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
33680         * metadata.c: compare also the retuns type when comparing signatures:
33681         we didn't do this as an optimization since really overloaded methods
33682         must differ also in the arguments, but this doesn't work with
33683         low-level IL code (or when using explicit conversion operators: see
33684         bug#23498 for an example).
33686 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33688         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
33690 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33692         * icall.c: make MonoType::GetElementType its own icall.
33694 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33696         * icall.c: remove MonoMethod_get_Name().
33697         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
33698         object.
33700 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33702         * string-icalls.c: optimized a few methods.
33704 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
33706         * icall.c: added all new string internal calls
33707         * string-icalls.c: added, new string internal call implementation.
33708         * object.c: added mono_string_new_size for allocating a string a size
33710 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
33712         * object.c (mono_object_isinst): use the same code as in the
33713         optimized x86 version.
33715 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33717         * profiler.c: TSC-based timer code (faster and more accurate).
33718         Not hooked up in configure, yet (set USE_X86TSC to 1).
33720 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
33722         * profiler.c, profiler.h: track time spent compiling methods.
33723         * threads.c: track thread creation/destruction.
33725 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
33727         * profiler.c, profiler.h, profiler-private.h: profiling interface
33728         and sample implementation. Moved here so that it can be used also by
33729         the jit.
33731 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
33733         * reflection.c, reflection.h: keep types and other handles separate in
33734         the hash tables for referred tokens. Add guid for modules.
33736 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
33738         * assembly.c: fix bugs found with valgrind.
33739         * metadata.h, metadata.c: added mono_metadata_guid_heap().
33741 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
33743         * threads: added icall support for getting current domain for
33744                    the thread.
33746 2002-04-13  Martin Baulig  <martin@gnome.org>
33748         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
33749         (MonoDebugVarInfo): Added `index' field for register based addresses.
33750         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
33751         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
33752         `MonoDebugVarInfo *params' and `guint32 this_offset' with
33753         `MonoDebugVarInfo *this_var'.
33755         * debug-symfile.c (relocate_variable): New static function to write
33756         a location description for a local variable or method parameter.
33758 2002-04-12  Martin Baulig  <martin@gnome.org>
33760         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
33761         stack offset and begin/end scope address of a local variable.
33762         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
33763         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
33764         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
33766         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
33767         Added new relocation types for start/end scope of a local variable.
33769 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33771         * object.h: add mono_object_domain() macro.
33772         * reflection.c: handle typespecs.
33773         * icall.c: MonoMethod::get_Name() implementation.
33775 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33777         * icall.c: String::GetHashCode() icall implementation.
33779 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33781         * icall.c: String::IndexOfAny icall.
33782         * object.c, object.h: make array->max_length more useful.
33783         Intrduced mono_object_class() and mono_string_length() macros.
33785 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33787         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
33788         instead of g_unichar_isdigit.
33790 2002-04-11  Nick Drochak  <ndrochak@gol.com>
33792         * icall.c: Implement a simple Double.ToString().
33794 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33796         * appdomain.h: only io-layer.h is supposed to be included.
33797         * icall.c: explicitly import environ. Fix warning.
33799 2002-04-10  Nick Drochak  <ndrochak@gol.com>
33801         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
33802                 return true even if it's not Daylight Savings time.
33803                 Only return false for the case where the function isn't
33804                 implemented for a plaform (read Windows).
33806 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33808         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
33809         data with a mutex.
33811 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
33813         * mempool.c (mono_mempool_alloc): only use g_malloc when
33814         absolutely necessary.
33816 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
33818         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
33820         * class.c (mono_class_vtable): use domain mempool to allocate vtable
33821         (mono_class_proxy_vtable): use domain mempool
33823 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
33825         * appdomain.h, appdomain.c: split initialization that requires the
33826         execution engine support into mono_runtime_init().
33828 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
33830         * class.c (mono_class_init): don't include vtable inside MonoClass
33831         to save some memory, gather some statistics.
33832         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
33834 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33836         * icall.c: internalcall implementation for ValueType.Equals().
33838 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
33840         * object.c (mono_message_init): moved 
33841         (mono_runtime_exec_main): new arch. independent impl.
33842         (mono_runtime_invoke_array): new method - like
33843         mono_runtime_invoke, but you can pass an array of objects.
33844         (mono_remoting_invoke): new arch. independent impl.
33845         (mono_message_invoke): new arch. independent impl.
33846         (mono_runtime_class_init): new arch. independent impl.
33847         (mono_runtime_object_init): new arch. independent impl.
33849 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33851         * metadata.c, object.c, reflection.c: documented the exported
33852         functions.
33854 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
33856         * icall.c: simpler code to pass the assembly builder data to corlib.
33857         Implement GetNestedTypes() internalcall.
33859 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33861         * class.c: warn if a type can't be loaded.
33863 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
33865         * image.h: typedef MonoImageOpenStatus
33866         * types.h: removed unused file
33867         
33868 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
33870         * icall.c: Enum_ToObject accepts enum value arguments.
33872 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
33874         * class.c: move initialization of properties, events and nested
33875         classes, so that they happen for interfaces, too.
33877 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33879         * icall.c: cleanup some ugly casts in Array_SetValue*.
33881 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33883         * icall.c: the values array fro enums is of the correct type, now.
33884         Implement (correctly) getFullName instead of assQualifiedName for
33885         MonoType.
33886         * reflection.h, reflection.c: added mono_type_get_name ().
33888 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33890         * assembly.c, image.h: for each MonoImage, record from wich assembly
33891         it was loaded.
33892         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
33893         Make Type.Assembly work.
33895 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
33897         * debug-symfile.h: use char* instead of gpointer to avoid
33898         unnecessary casts.
33900         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
33902         * icall.c (ves_icall_InternalExecute): impl. FielSetter
33903         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
33905 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
33907         * icall.c (mono_message_init): impl. (code cleanup)
33908         (ves_icall_InternalExecute): impl. FieldGetter
33910         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
33911         defined we call all (non-static)methods through the vtable. 
33913 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
33915         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
33916         finalizer even though the memory is still referenced (and the chunk of
33917         memory is not freed).
33919 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
33921         * assembly.c: fix brokeness.
33923 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
33925         * class.c: kill some warnings. Check explicit interface method
33926         implementation also without considering the namespace.
33927         Load also literal strings in static class data.
33929 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
33931         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
33932         (default_assembly_name_resolver): Make the resolver take the
33933         "base" directory where the assembly was originally defined, so we
33934         can load DLLs that are in the same directory as the assembly that
33935         is being referenced.
33937 2002-03-28  Dick Porter  <dick@ximian.com>
33939         * file-io.h: 
33940         * file-io.c:
33941         * socket-io.c: 
33942         * unicode.h: 
33943         * unicode.c: Warning cleanups
33945 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
33947         * object.h, reflection.h: use the correct type instead of MonoObject.
33949 2002-03-28  Martin Baulig  <martin@gnome.org>
33951         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
33952         (mono_debug_update_symbol_file): Initialize classes if necessary.
33954 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
33956         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
33957         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
33959 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
33961         * assembly.h: fix function prototype.
33962         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
33963         * mono-endian.h: use const cast.
33965 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
33967         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
33969 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
33971         * loader.c: don't assert when a typeref can't be loaded, give
33972         a chance to the runtime to trow an exception instead.
33973         * loader.h: fix warning.
33975 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
33977         * class.c (mono_class_proxy_vtable): added proxy support
33979 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
33981         * icall.c: removed last of PAL calls, added System.Environment
33982         * file-io.h, file-io.c: MonoIO implementation
33983         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
33985 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
33987         * appdomain.c: do not use the byte marker in ldstr table lookup.
33988         * debug-helpers.c: allow two ':' to separate class and method name.
33989         * object.c: allocate arrays bounds with the GC, too.
33990         * verify: add a few more checks.
33992 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
33994         * reflection.c: output also literal strings. Allocate parameter data
33995         with GC_malloc() (thanks, Martin, for catching this!).
33997 2002-03-26  Martin Baulig  <martin@gnome.org>
33999         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
34000         include the `this' offset in the `param_offsets'.
34002 2002-03-25  Martin Baulig  <martin@gnome.org>
34004         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
34005         mono_debug_get_class() function to get the classes. Added new
34006         relocation types for arrays and strings.
34007         (mono_debug_get_class): New static function to search in all
34008         referenced assemblies for a metadata token.
34010         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
34012 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
34014         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
34015         hold gc-allocated objects. Make the string heap a stream like the
34016         others. Removed duplicated code when writing stream info.
34017         Added asserts to catch possible buffer overflows. Set the sorted map
34018         for tables that need sorting. Added some documentation.
34020 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
34022         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
34023         for interned strings and vtables.
34025 2002-03-24  Martin Baulig  <martin@gnome.org>
34027         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
34028         it in the array since it was created with g_slist_prepend().
34030 2002-03-24  Martin Baulig  <martin@gnome.org>
34032         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
34033         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
34034         (mono_debug_method_from_token): Renamed to
34035         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
34036         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
34038         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
34039         relocation types.
34041         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
34043 2002-03-24  Martin Baulig  <martin@gnome.org>
34045         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
34046         (mono_debug_method_from_token): New func.
34048         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
34049         New interncall, calls mono_debug_local_type_from_signature().
34050         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
34051         calls mono_debug_method_from_token().
34053 2002-03-23  Martin Baulig  <martin@gnome.org>
34055         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
34056         specifies the number of bytes to be converted, not the array size.
34057         Return the number of chars, not the number of bytes.
34058         (ves_icall_iconv_get_chars): The `byteCount' argument
34059         specifies the number of bytes to be converted, not the array size.
34061 2002-03-23  Martin Baulig  <martin@gnome.org>
34063         * reflection.h (MonoReflectionSigHelper): New type.
34065         * reflection.c (mono_reflection_sighelper_get_signature_local),
34066         (mono_reflection_sighelper_get_signature_local): New functions.
34068         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
34069         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
34070         interncalls.
34072 2002-03-23  Martin Baulig  <martin@gnome.org>
34074         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
34075         is_writeable is set.
34076         (mono_raw_buffer_update): New function to write the modified map
34077         back to disk.
34079         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
34081         * debug-symfile.c (mono_debug_update_symbol_file): Call
34082         mono_raw_buffer_update() when done writing.
34084 2002-03-23  Martin Baulig  <martin@gnome.org>
34086         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
34088         * debug-symfile.c: Added support for arguments and local variables.
34090 2002-03-23  Dick Porter  <dick@ximian.com>
34092         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
34093         protected by ifdefs, hence breaking the w32 build.
34095 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34097         * object.c: implement is_interned() the right way.
34099 2002-03-21  Martin Baulig  <martin@gnome.org>
34101         * debug-symfile.[ch]: New files to handle debugging information
34102         files. There's also support to dynamically update these symbol
34103         files to include machine dependent information.
34105 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
34107         * threads.c (mono_thread_create): new function to create thread
34108         from C
34110 2002-03-20  Martin Baulig  <martin@gnome.org>
34112         * icall.c (ves_icall_InternalInvoke): Create a new object if the
34113         method is a constructor.
34114         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
34115         points to ves_icall_InternalInvoke().
34117 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
34119         * file-io.c: Flush shouldn't throw exceptions.
34121 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
34123         * file-io.c: FileStream flush support; FileSetLength now
34124         restores file pointer.
34126 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
34128         * class.c: set image for pointer classes.
34130 2002/03/19  Nick Drochak <ndrochak@gol.com>
34132         * sysmath.c: Forgot one.
34134 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
34136         * sysmath.c: Avoid redefining existing names.
34138 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
34140         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
34141         handled by runtime as icall rather than dllimport from libm.so
34142         * file-io.c, file-io.h: fixed handle argument type.
34144 2002-03-18  Dick Porter  <dick@ximian.com>
34146         * reflection.c (mono_image_get_type_info): rename interface to
34147         iface, because of "#define interface struct" on windows.
34149 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
34151         * class.c, class.h: rename and export mono_ptr_class_get().
34152         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
34153         * reflection.c, reflection.h, icall.c: better/saner type name
34154         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
34155         method signatures.
34157 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
34159         * class.c (mono_class_init): removed hardcoded GHC_SLOT
34161         * icall.c (ves_icall_InternalInvoke): impl.
34163 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
34165         * reflection.c: output the interface map table, too.
34167 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
34169         * class.c (class_compute_field_layout): separate computation of 
34170         static field layout
34172 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
34174         * icall.c: added System.Buffer support.
34175         * file-io.c: moved file icalls from PAL to FileStream.
34177 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
34179         * icall.c (ves_icall_System_Object_GetHashCode): impl.
34181 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
34183         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
34185 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
34187         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
34189 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
34191         * debug-helpers.{c,h}: moved here from monograph some useful functions
34192         to locate a method by name/signature in a class or image. Included
34193         also a small and flexible IL disassembler.
34195 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
34197         * reflection.c: fixup tokens in methods with small header size, too.
34199 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
34201         * object.c (mono_string_to_utf8): remove assert(!error), instead
34202         print a warning. 
34204 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
34206         * icall.c: update to the new mono_Array_class_get interface.
34208 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
34210         * appdomain.c, object.c: Boehm-GC enable.
34211         * icall.c: make get_data_chunk() support split data requests.
34212         Ensure a class is initialized in more cases. Return only the first
34213         property found in GetProperties() or the compiler gets confused. 
34214         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
34215         * reflection.h, reflection.c: add fixup mechanism for field and method
34216         tokens. Initialize assembly->typeref in a single place. Output
34217         properties after events. Support custom attributes for events, too.
34218         Typo fix for paramter custom attrs.
34220 2002-03-07  Martin Baulig  <martin@gnome.org>
34222         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
34224 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
34226         * class.c (mono_array_class_get): fix. for multi. dim. arrays
34228 2002-03-06  Martin Baulig  <martin@gnome.org>
34230         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
34231         non-zero lower bounds. See testcases #F10-#F13.
34233 2002-03-05  Martin Baulig  <martin@gnome.org>
34235         * exception.c (mono_get_exception_argument_out_of_range): New exception.
34237         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
34238         ves_icall_System_Array_GetValue(), only calculate the absolute array position
34239         here.
34240         (ves_icall_System_Array_SetValue): Likewise.
34241         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
34242         as argument and does the actual work. This function is used when copying a
34243         multi-dimensional array.
34244         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
34245         now do all the widening conversions of value types.
34246         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
34248 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34250         * class.c: remove some magic numbers and use the smbolic names,
34251         instead. Added init_events() to load event info at class init time.
34252         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
34253         and mono_metadata_methods_from_event().
34254         * reflection.h, reflection.c: added support for writing out the evnets
34255         related information.
34257 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
34259         * reflection.h, icall.c: use a different method (GetInterfaces)
34260         to gather interface info and add isbyref, isprimitive and
34261         ispointer to the ves_icall_get_type_info() return value.
34263 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
34265         * class.h: stared adding support for events.
34266         * icall.c: split find_members implementation. Added debug icall to get
34267         the address of an object.
34268         * reflection.c: handle TypeBuilders in mono_type_get_object().
34270 2002-03-01  Martin Baulig  <martin@gnome.org>
34272         * icall.c (ves_icall_System_Array_GetLength): This must throw an
34273         ArgumentOutOfRangeException(), not an ArgumentException().
34274         (ves_icall_System_Array_GetLowerBound): Likewise.
34275         (ves_icall_System_Array_GetValue): Improved argument checking.
34276         (ves_icall_System_Array_SetValue): Improved argument checking.
34278 2002-03-01  Martin Baulig  <martin@gnome.org>
34280         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
34281         called with invalid arguments rather than just dying with g_assert().
34282         (ves_icall_System_Array_SetValue): Likewise.
34283         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
34284         raise a NotImplementedException instead.
34285         (ves_icall_System_Array_GetLength): Added argument checking.
34286         (ves_icall_System_Array_GetLowerBound): Added argument checking.
34288 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
34290         * object.h (mono_assert): new macros mono_assert and
34291         mono_assert_not_reached
34293 2002-02-28  Martin Baulig  <martin@gnome.org>
34295         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
34296         and "System::String::IsInterned" to "System::String::_IsInterned".
34298 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
34300         * icall.c: remove hacks for typebuilder. Added icall to create a
34301         modified type from a tybebuilder.
34302         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
34303         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
34304         to create a backing MonoClass for a TypeBuilder.
34306 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
34308         * class.c, class.h: more refactoring of class init.
34309         Export mono_class_setup_mono_type() and mono_class_setup_parent().
34311 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
34313         * marshal.c, marshal.h: start of marshaling interface.
34315 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
34317         * icall.c: fix order in assembly qualified name icall.
34319 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
34321         * class.c: do not free str, since we store it in the hash table.
34322         * reflection.h: add label field to MonoILExceptionInfo.
34323         * reflection.c: handle references to more than one assembly. Handle
34324         case when there isn't a module created in the assembly.
34326 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
34328         * class.c: Fix typo. Start refactoring of class init code.
34330 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
34332         * appdomain.c: exit with 1 on error.
34333         * class.c: we already have the name in MonoClassField.
34334         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
34335         MonoStreamHeader instead of an offset of image->raw_metadata.
34337 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
34339         * appdomain.c (mono_init): Be even more descriptive about the error.
34341 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
34343         * appdomain.c: give the user an informative message when corlib can't
34344         be loaded.
34346 2002-02-26  Martin Baulig  <martin@gnome.org>
34348         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
34349         New icall to get the time zone data.
34351 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
34353         * reflection.c: set virtual and raw size of section correctly.
34354         * threads.c: transfer domain information to newly created threads.
34356 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
34358         * class.c: when instancing a class in a domain, load the default
34359         vaules for static fields from the constant table. Fix System.Enum to
34360         not be an enum.
34361         * icall.c: implement Object::GetType() internalcall. Implemented
34362         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
34363         Fixed checking of binding flags in find_members().
34364         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
34365         * reflection.c: handle enumerations when writing to the constant
34366         table. Use a different object cache for types.
34369 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
34371         * object.c (mono_object_isinst): fix for arrays
34373         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
34375 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
34377         * object.c: don't use mprotect ()  and fix intern pool hash table
34378         lookup for big endian systems.
34380 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
34382         * icall.c: change type_is_subtype_of () signature.
34384 2002-02-21  Mark Crichton  <crichton@gimp.org>
34386         * rand.c, rand.h: Added random number generator for
34387         System.Security.Cryptography classes.
34389         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
34391         * icall.c: Added System.Security.Cryptography calls.
34393 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
34395         * class.c, icall.c, metadata.c: better support for pointer types.
34396         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
34397         * reflection.c: Add support for getting custom attrs for properties
34398         and simplify some code.
34400 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
34402         * icall.c: change getToken () and add custom attribute GetBlob()helper
34403         method.
34404         * reflection.h: add custom attrs array to the reflection builder structures.
34405         * reflection.c: encode and emit custom attributes for all the relevant
34406         reflection objects. Cache fieldref and methodref tokens. Change
34407         mono_image_create_token() interface to take a MonoDynamicAssembly.
34408         More complete custom attributes decoder. Load custom attributes for
34409         Assembly, Field, Method and Constructor objects, too. Make the
34410         returned array an Attribute[] one, not object[]. Added
34411         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
34412         custom attribute constructor.
34414 2002-02-20  Dick Porter  <dick@ximian.com>
34416         * icall.c:
34417         * rawbuffer.c:
34418         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
34419         problem code out for now).
34421 2002-02-19  Radek Doulik  <rodo@ximian.com>
34423         * object.c (mono_ldstr): use hash table to avoid multiple swapping
34425 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
34427         * icall.c: register the GetCustomAttributes method.
34428         * object.c, object.h: add mono_string_new_len ().
34429         * reflection.h, reflection.c: added mono_runtime_invoke(),
34430         mono_install_runtime_invoke(). Added
34431         mono_reflection_get_custom_attrs () to load custom attributes and
34432         create the attribute objects.
34434 2002-02-19  Dick Porter  <dick@ximian.com>
34435         * threads-dummy-types.c:
34436         * threads-dummy-types.h:
34437         * threads-dummy.c:
34438         * threads-dummy.h:
34439         * threads-pthread-types.c:
34440         * threads-pthread-types.h:
34441         * threads-pthread.c:
34442         * threads-pthread.h:  Deleted obsolete files
34444 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
34446         * class.c (mono_class_vtable): runtime init the class when we
34447         allocate static class data.
34449         * icall.c (ves_icall_System_Array_SetValue): check for null values.
34451         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
34452         and String - but we will need generic marshalling support in the
34453         future. 
34454         (mono_init): set the domain name in a ms compatible way
34456         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
34457         String[].
34459 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
34461         * object.c (mono_array_clone): use alloca() instead of g_malloc  
34462         for sizes
34464         * appdomain.c (mono_domain_unload): impl.
34466 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
34468         * appdomain.c, object.c: fix intern pool implementation.
34469         * class.c: fix alignment code.
34471 2002-02-16  Radek Doulik  <rodo@ximian.com>
34473         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
34474         and s2 > s1, just copy lower bytes to be compatible with little
34475         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
34476         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
34478         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
34479         force big_endian to be 1 for big endian machines 
34480         (ves_icall_iconv_new_decoder): ditto
34482 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
34484         * socket-io.c (convert_sockopt_level_and_name): If the system
34485         doesn't define SOL_IP or SOL_TCP, get them by hand using
34486         getprotobyname() and caching the values (because this could be a
34487         slow operation).
34488         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
34489         Use the appropriate struct when the system does support it. Ie,
34490         not all systems have struct ip_mreqn so use struct ip_mreq when
34491         appropriate.
34493 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
34495         * reflection.c: handle finally clauses.
34497 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
34499         * socket-io.c: use g_snprintf() instead of snprintf.
34501 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
34503         * reflection.c (mono_param_get_objects): Cast second argument to
34504         mono_method_get_param_names to a const char** to silence the
34505         compiler warning.
34507         * appdomain.c (mono_domain_assembly_open): Put parens around the
34508         truth statement in the for-loop.
34510         * unicode.c (iconv_convert): Got rid of a compiler warning about
34511         int i being unused when the system has a new iconv.
34512         (iconv_get_length): Same.
34514         * image.c (load_class_names): Cast the second argument to
34515         g_hash_table_insert() to char* to hush compiler warnings about the
34516         arg being a const.
34517         (mono_image_open): Same here.
34519         * socket-io.c: Don't conditionally include sys/filio.h or
34520         sys/sockio.h here anymore since we now get them from
34521         io-layer/io-layer.h
34522         (inet_pton): If the system doesn't support inet_aton, implement
34523         using inet_addr and also #define INADDR_NONE if it isn't defined
34524         by the system.
34526 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
34528         * metadata.c, metadata.h: added function to get packing and size info
34529         of a typedef.
34530         * reflection.h, reflection.c: handle field RVA data. Save info about
34531         the table layout if needed. Assign typedef indexes to all the types
34532         before dumping the info about them to avoid forward reference problems.
34534 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
34536         * socket-io.c (convert_sockopt_level_and_name): ifdef
34537         SO_ACCEPTCONN because it is not defined on my system (old debian)
34539 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
34541         * opcode.c: use stddef.h to get NULL.
34543 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
34545         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
34546         for FIONBIO, FIONREAD and SIOCATMARK.
34547         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
34548         define INADDR_NONE and besides, inet_addr() is deprecated and
34549         should not be used. Use inet_pton() instead - it also has the
34550         added bonus that it can easily handle IPv6 addresses as well.
34551         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
34553 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
34555         * decimal.c: remove _MSC_VER conditional.
34557 2002-02-13  Dick Porter  <dick@ximian.com>
34559         * socket-io.c: 
34560         * icall.c: Internal calls for Blocking, Select, Shutdown,
34561         GetSocketOption and SetSocketOption
34563 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34565         * assembly.cs: better resolver: use it instead of some kludgy
34566         code.
34568 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
34570         * reflection.c: the best way to speed-up the compiler is to avoid
34571         infinite loops.
34573 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
34575         * class.c (mono_class_vtable): changed the object layout
34576         (obj->vtable->class). 
34577         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
34579 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34581         * assembly.c: look for assemblies in the assembly dir, too.
34583 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
34585         * class.c: fix thinko in mono_class_from_type().
34587 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
34589         * exception.h, exception.c: added TypeLoadException.
34590         * object.h, object.c: added mono_array_clone ().
34591         * icall.c: handle throwOnError in AssemblyGetType().
34592         Added Array.Clone().
34593         * opcode.h, opcode.c: use a single value for the opcode val.
34594         Compile fix for non-gcc compilers.
34596 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
34598         * opcodes.c, opcodes.h: export interesting info about opcodes.
34600 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
34602         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
34603         icalls. 
34605         * class.c (class_compute_field_layout): set element_class for enums
34606         (mono_class_create_from_typedef): set element_class for normal classes
34608         * icall.c (ves_icall_System_Enum_get_value): impl.
34610         * class.c (mono_class_create_from_typedef): do not set valuetype
34611         flag for System.ValueType and System.Enum
34613 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
34615         * unicode.c (iconv_convert): fix big endian problem.
34617 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
34619         * class.c: add asserts if we are ever going to scribble over memory.
34620         * socket-io.c: not all systems have AF_IRDA defined.
34622 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
34624         * class.c (class_compute_field_layout): do not consider static
34625         fields to compute alignment
34627 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
34629         * appdomain.c (mono_appdomain_get): impl.
34630         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
34632 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
34634         * icall.c: ignore "file://" prefix when loading an assembly.
34636 2002-01-23  Dick Porter  <dick@ximian.com>
34638         * socket-io.c:
34639         * icall.c:
34640         * Makefile.am: Added socket support
34642 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
34644         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
34645         code back.  This should return the assemblies that are loaded by
34646         the runtime on behalf of an application domain. 
34648         The current implementation is still broken, it just returns every
34649         assembly loaded, but until we get real applications domain this
34650         will do.
34652 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
34654         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
34655         AppDomain object.
34657 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
34659         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
34660         the mono_class_from_name lookup.
34661         (ves_icall_get_parameter_info): ditto.
34662         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
34663         method.
34664         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
34666 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
34668         * class.c: load also nested classes on class init.
34669         System.ValueType instance methods gets passed boxed
34670         values, unless methods in derived classed that get a pointer to the
34671         data.
34672         * icall.c: use better name parsing code in GetType().
34673         * image.c, image.h: add mono_image_loaded ().
34674         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
34675         * reflection.c, reflection.h: added mono_reflection_parse_type().
34677 2002-01-22  Veronica De Santis <veron78@interfree.it>
34679         * icall.c : Added mapping of internal calls for Manual and Auto reset events
34680         * threads.c : Added the implementation of internal calls for events
34681         * threads.h : Added prototypes of internal calls for events
34682         
34683 2002-01-21  Radek Doulik  <rodo@ximian.com>
34685         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
34687 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
34689         * class.c (mono_class_init): set min_align to 1 (instead of 0)
34690         (mono_class_value_size): use min_align
34692 2002-01-20  Dick Porter  <dick@ximian.com>
34694         * threads.h:
34695         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
34696         so it compiles on w32.
34698 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
34700         * metadata.c (mono_type_stack_size): impl.
34702         * class.c (mono_class_get_field): impl. memberref token
34704 2002-01-16 Veronica De Santis <veron78@@interfree.it>
34706         * icall.h : Added the internal calls mapping for CreateMutex_internal
34707                     and ReleaseMutex_internal.
34708         * threads.h : Added the prototype of mutexes internal calls.
34709         * threads.c : Added the implementations of mutexes internal calls.
34711 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
34713         * metaparse.h: removed unused file.
34714         * reflection.c, reflection.h: added stream_data_align () function 
34715         to align data in streams and keep stream aligned. Add support for
34716         exception support in method headers.
34718 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
34720         * unicode.c: make iconv_convert () return the number of bytess written
34721         in the output buffer.
34723 2002-01-15  Dick Porter  <dick@ximian.com>
34724         * threads.c: Make the runtime's idea of infinite timeouts coincide
34725         with the class library's
34727         Fix a particularly egregious bug in mono_thread_cleanup(). That
34728         code was so utterly bogus it must have been written on a Monday.
34730 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
34732         * reflection.h: add subtypes field to TypeBuilder.
34733         * reflection.c: encode constants for literal fields.
34734         Handle subtypes. Fix user string token (and add a zero byte)
34735         at the end.
34736         
34737 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
34739         * class.c (mono_class_init): bug fix: assign slot numbers for
34740         abstract methods.
34742 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
34744         * reflection.c: don't try to output a code RVA for abstract methods.
34745         Small fixes for method header format. Output parameter info to the
34746         ParamDef table. Save method overriding info to MethodImpl table.
34747         Fix property support. Allow typedef.extends to be a type in the
34748         building assembly.
34749         * verify.c: fix off-by-one error.
34751 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
34753         * class.c: fix mono_class_from_mono_type () for szarray types.
34754         Remove unused cache check in mono_class_from_type_spec().
34755         * icall.c: *type_from_name () functions handle simple arrays and byref.
34756         * reflection.c: handle byref and szarray types. Handle methods without
34757         body (gets P/Invoke compilation working). Handle types and fields in
34758         get_token ().
34759         * reflection.h: add rank to MonoTypeInfo.
34761 2002-01-10  Dick Porter  <dick@ximian.com>
34763         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
34764         internal calls
34766 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
34768         * icall.c: initialize class in type_from_handle ().
34769         Loop also in parent classes for get_method ().
34770         * reflection.c: properly encode class and valuetype types.
34771         Start on encoding TypeBuilder types. Handle fieldrefs.
34772         Use correct length when registering a user string.
34773         Handle ConstructorBuilder and MonoMethod in get_token ().
34774         Make mono_type_get_object () aware of cached types.
34775         * object.c: back out change to mono_string_new ().
34777 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
34778         * object.c: mono_string_new should return a NULL when the string 
34779         passed in is NULL -- not try to deference it.
34780         
34781 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
34783         * icall.c: hack to make IsSubType work for TypeBuilders.
34784         * reflection.c: emit constructors before methods.
34785         Retrieve param names in mono_param_get_objects().
34787 2002/01/05  Nick Drochak  <ndrochak@gol.com>
34789         * Makefile.am: fix list of headers and sources so automake 1.5
34790         doesn't complain. Removed \# at end of list.
34792 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
34794         * reflection.c: get token for a method ref. Set return type of
34795         constructor to void.
34796         * loader.c: debug message.
34797         * class.c: typo fix.
34799 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
34801         * icall.c: fix array init with rank > 1. FindMembers
34802         loops in parent class as well.
34803         * image.c: do not insert nested types in name cache.
34804         * reflection.c: warning fix.
34805         * reflection.h: add override method (for interface impl).
34807 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
34809         * metadata.c: fix customattr decoding.
34811 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
34813         * rawbuffer.cs: Added native Win32 implementation, avoids using
34814         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
34816 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
34818         * class.c: make the low-level routines handle the cache.
34820 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
34822         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
34824 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
34826         * class.c: fix mono_array_element_size() for objects.
34827         * class.h, class.c: add properties to MonoClass and load them
34828         at init time.
34829         * icall.c: check with isinst() when assigning a value to an array
34830         instead of requiring the classes to match exactly.
34831         Implemented icall for System.Type::GetType().
34832         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
34833         enums. Handle bindingflags when looking for methods and fields.
34834         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
34835         and mono_metadata_methods_from_property().
34836         * reflection.h, reflection.c: added structures for propreties,
34837         parameters and enums. Implemented mono_property_get_object() and
34838         mono_param_get_objects().
34840 2001-12-18  Dick Porter  <dick@ximian.com>
34842         * file-io.c: Use mono_string_to_utf16() instead of
34843         mono_string_chars()
34845         * object.c: Added mono_string_to_utf16(), which copies the non
34846         NULL-terminated MonoString into a new double-null-terminated
34847         buffer.
34849 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
34851         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
34853 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
34855         * file-io.c: raise exceptions if handle is invalid.
34857 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
34859         * assembly.c: yet another check for mscorlib.
34860         * class.c, class.h: load nesting info for classes.
34861         * icall.c: many new functions to support the Reflection classes.
34862         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
34863         * reflection.h, reflection.c: mono_image_create_token(),
34864         mono_assembly_get_object(), mono_type_get_object(),
34865         mono_method_get_object(), mono_field_get_object(): methods to return
34866         objects that parallel the C representation of assemblies, types,
34867         methods, fields.
34869 2001-12-11  Dick Porter  <dick@ximian.com>
34871         * icall.c:
34872         * file-io.c: Internal calls for file IO.
34874 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
34876         * tabledefs.h: missing FileAttributes.
34877         * verify.h, verify.c: use is_valid_string () to simplify and check for
34878         valid strings more correctly. Fix warnings and speeling.
34879         Check more tables: Filed, File, ModuleRef, StandAloneSig.
34880         Check code: branches, maxstack, method calls.
34882 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
34884         * object.c (mono_object_allocate): removed static, so that the jit
34885         can allocate value types.
34887         * icall.c (ves_icall_System_DateTime_GetNow): impl.
34889 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34891         * class.c: init enum types right away and register the
34892         token->MonoClass map in mono_class_create_from_typedef ().
34893         * verify.h, verify.c: first cut of the verifier.
34894         * pedump.c: add --verify switch to verify metadata tables.
34895         * tabledefs.h: add some missing enums.
34897 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
34899         * class.c (mono_install_runtime_class_init): impl.
34900         (mono_class_init): renamed mono_class_metadata_init to
34901         mono_class_init, also removed the metadata_inited flag
34903         * object.c (mono_object_isinst): use faster algorithm
34905 2001-11-30  Radek Doulik  <rodo@ximian.com>
34907         * mono-endian.h: reverted last change
34908         added function prototypes
34910         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
34911         add mono-endian.c back
34913         * mono-endian.c: returned back, as Paolo pointed out, it's needed
34914         for unaligned access, I've mistaked it with endianess. I am
34915         sorry.
34916         (mono_read16): fix reverted endianess
34917         (mono_read64): ditto
34918         (mono_read32): ditto
34920 2001-11-30  Dick Porter  <dick@ximian.com>
34922         * exception.c: Implement mono_exception_from_name()
34924 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
34926         * metadata.h, metadata.c: remove params_size and locals_size and their
34927         calculation from the metadata code: they are only usefult to the
34928         interp.
34930 2001-11-29  Radek Doulik  <rodo@ximian.com>
34932         * object.c (mono_ldstr): swap bytes here, it's probably not the
34933         best place, but works for me now, I'll redo it once I know mono
34934         better, also note that I add PROT_WRITE and don't reset back, also
34935         note that it's only affects big endians, so x86 should be OK
34937         * mono-endian.h (read16): use just glib macros for both endians
34939         * mono-endian.c: removed as glib macros are used in in
34940         mono-endian.h so we don't need to care about endianess for read
34941         macros as glib does that for us already
34943 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
34945         * class.h, class.h: take minimum alignment into consideration so
34946         that the fields of a class remain aligned also when in an array.
34948 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
34950         * loader.h, loader.c: add mono_method_get_param_names().
34951         * class.c: 0-init class fields.
34953 2001-11-26  Dick Porter  <dick@ximian.com>
34955         * icall.c:
34956         * threads-types.h:
34957         * threads.c: New file that handles System.Threading on all platforms
34959         * object.c: 
34960         * object.h: Remove the synchronisation struct from MonoObject,
34961         replace it with a pointer that gets initialised on demand
34963         * Makefile.am: Replace all the system-specific threading code with
34964         a single file that uses the new wrapper library
34966 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
34968         * class.c, class.h: add mono_install_trampoline() so that the runtime
34969         can register a function to create a trampoline: removes the ugly
34970         requirement that a runtime needed to export arch_create_jit_trampoline.
34971         * object.h, object.c: added mono_install_handler() so that the runtime
34972         can install an handler for exceptions generated in C code (with
34973         mono_raise_exception()). Added C struct for System.Delegate.
34974         * pedump.c: removed arch_create_jit_trampoline.
34975         * reflection.c: some cleanups to allow registering user strings and
34976         later getting a token for methodrefs and fieldrefs before the assembly
34977         is built.
34978         * row-indexes.h: updates and fixes from the new ECMA specs.
34980 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
34982         * class.h, class.c: add enum_basetype field to MonoClass.
34983         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
34984         to get index in the constant table reated to a field, param or
34985         property.
34986         * reflection.h, reflection.c: handle constructors. Set public-key and
34987         version number of the built assembly to 0.
34988         * row-indexes.h: update from new ECMA spec.
34990 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
34992         * class.h, class.c: add a max_interface_id to MonoClass.
34993         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
34994         since it's used to do that. Added mono_type_type_from_obj().
34995         Make GetType() return NULL instead of segfaulting if the type was not
34996         found. Handle simple arrays in assQualifiedName.
34997         * object.h: add a struct to represent an Exception.
34998         * reflection.c: output call convention in method signature.
34999         Add code to support P/Invoke methods and fixed offsets for fields.
35001 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
35003         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
35004         the value.
35005         * icall.c: use mono_array_addr instead of array->vector: fixes the
35006         reflection image writing.
35007         * reflection.c: init call convention byte to 0 in method signature.
35008         Encode the property signature. Don't output property-related methods
35009         twice. Really process the properties for a type (don't cast a field to
35010         a property, my mom always told me that).
35011         Fix 64 bit issues in pointer alignment in a different and more
35012         readable way.
35014 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
35016         * loader.h: Removed type class from MonoDefaults, added monotype
35018         * loader.c: Loaded MonoType, removed loading of Type
35020         * icall.c (my_mono_new_object): Now returns a System.MonoType,
35021         and fills in System.Type._impl with a RuntimeTypeHandle rather
35022         than the actual MonoClass *
35024         (ves_icall_type_from_handle): change from type_class to
35025         monotype_class
35027         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
35028         implemented
35030         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
35031         implemented
35033         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
35035         (ves_icall_System_Reflection_Assembly_GetType): implemented
35037         (ves_icall_System_MonoType_assQualifiedName): implemented
35039         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
35041 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
35043         * assembly.c (mono_assembly_open): Implement a cache for the
35044         assemblies. 
35046         (mono_assembly_close): only destroy the assembly when the last
35047         reference is gone.
35048         
35049 2001-11-09  Dick Porter  <dick@ximian.com>
35051         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
35053 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
35055         * class.c (mono_class_metadata_init): bug fix: compute the right slot
35057 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
35059         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
35060         from Martin Weindel.
35061         * object.h: add mono_string_chars ().
35063 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
35065         * reflection.c (build_compressed_metadata): Eliminates warnings
35066         and uses 64-bit clean code.
35068         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
35069         (mono_type_equal): Change signature to eliminate warnings.
35071 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
35073         * icall.c, loader.c: remove the internalcall array constructors.
35074         Changes to match the new MonoArray structure.
35075         * object.h, object.c: an array object doesn't allocate an extra
35076         vector. Add mono_array_new_full () to create jagged arrays easily.
35078 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
35080         * metadata.h, metadata.c: add mono_metadata_field_info () to
35081         retreive all the info about a field from vairous tables.
35082         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
35083         * class.h, class.c: augment MonoClassField with more info.
35084         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
35085         policy and load a field's RVA if needed.
35087 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
35089         * class.c (mono_class_metadata_init): create a trampoline for all
35090         virtual functions instead of actually compiling them.
35092 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
35094         * class.h, class.c: include name in MonoClassField.
35095         * class.c: fix fundamental type of System.Object and System.String.
35096         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
35097         tokens in ldtoken.
35098         * icall.c: remove internalcalls for the Reflection stuff that is now
35099         done in C# code.
35100         * loader.c: mono_field_from_memberref () implementation.
35101         * mono-endian.c: thinko (s/struct/union/g).
35102         * object.c, object.h: make the mono_string_* prototypes actually use
35103         MonoString instead of MonoObject.
35104         * reflection.c, reflection.h: updates for changes in the reflection
35105         code in corlib: we use C structures that map to the actual C# classes.
35106         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
35107         fat method header if needed and use the info from the ILGenerator for
35108         methods. Handle fields in types. Misc fixes.
35110 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
35112         * class.c (mono_class_metadata_init): bug fix: always allocate
35113         space for static class data
35115 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
35117         * class.c (mono_compute_relative_numbering): use relative
35118         numbering to support fast runtime type checks.
35120 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
35122         * class.c (mono_class_create_from_typeref): added debugging output
35123         to print class name when MonoDummy is returned instead of real class
35125 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
35127         * class.c (mono_class_metadata_init): interface offset table now
35128         contains pointers into the vtable - this is more efficient for the jit
35130 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
35132         * class.c (mono_class_metadata_init): use a temporary vtable (the
35133         old algorithm only worked for the interpreter, but not for the jit)
35135 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
35137         * loader.c (method_from_memberref): use mono_class_get to get the
35138         class of an array instead of using System.Array directly.
35139         (mono_get_method): also add MEMBERREF methods to the method cache
35140         which usefull for arrays.
35142 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
35144         * pedump.c (arch_compile_method): added to compute vtable entry
35146         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
35147         number of interfaces.
35148         
35149         * class.h: merged MonoArrayClass into MonoClass
35151         * class.c (mono_class_create_from_typedef): compute the vtable size and
35152         allocate space to include the vtable inside MonoClass
35153         (mono_class_metadata_init): initialize the vtable
35155 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
35157         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
35158         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
35159         * image.c: endian fixes by Laurent Rioux.
35160         * object.h, object.c: rename MonoStringObject to MonoString and
35161         MonoArrayObject to MonoArray. Change some function names to conform to
35162         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
35163         guint16* as first argument, so don't use char*.
35164         Provide macros to do the interesting things on arrays in a portable way.
35165         * threads-pthread.c: updates for the API changes and #include <sched.h>
35166         (required for sched_yield()).
35167         * icall.c: updates for the API changes above.
35168         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
35169         platforms that need them.
35171 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
35173         * class.c: set the correct type for all the fundamental
35174         type when loading the class.
35176 2001-10-05  Dick Porter  <dick@ximian.com>
35178         * threads-pthread.c (pthread_mutex_timedlock): Simple
35179         compatibility version for C libraries that lack this call.
35181 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
35183         * class.c: MonoTypes stored in MonoClass are stored as
35184         fundamental MonoTypes when the class represents a
35185         fundamental type (System.Int32, ...).
35186         The TypeHandle return by ldtoken is a MonoType*.
35187         * icall.c: ves_icall_get_data_chunk () write out all the
35188         PE/COFF stuff. Implement ves_icall_define_method (),
35189         ves_icall_set_method_body (), ves_icall_type_from_handle ().
35190         * image.c: properly skip unknown streams.
35191         * loader.h, loader.c: add type_class to mono_defaults.
35192         * metadata.c, metadata.h: export compute_size () as
35193         mono_metadata_compute_size () with a better interface.
35194         Typo and C&P fixes.
35195         * pedump.c: don't try to print the entry point RVA if there is no entry point.
35196         * reflection.c, reflection.h: many cleanups, fixes, output method
35197         signatures and headers, typedef and typeref info, compress the metadata
35198         tables, output all the heap streams, cli header etc.
35199         * row-indexes.h: typo fixes.
35201 2001-10-04  Dick Porter  <dick@ximian.com>
35203         * object.h: Add a synchronisation mutex struct to MonoObject
35205         * object.c (mono_new_object): Initialise the object
35206         synchronisation mutexes
35208         * icall.c: System.Threading.Monitor internal calls
35209         
35210         * threads-pthread.h:
35211         * threads-pthread.c: System.Threading.Monitor internal calls
35213         * threads-types.h: New file, includes the system-specific thread
35214         structures
35215         
35216         * threads-pthread-types.h:
35217         * threads-pthread-types.c: New files, handle pthread-specific
35218         synchronisation types
35220         * threads-dummy-types.h: 
35221         * threads-dummy-types.c: New files of dummy support for
35222         thread-specific types
35224         * metadata.c:
35225         * image.c:
35226         * pedump.c: include mono-endian.h not endian.h
35227         
35228         * Makefile.am: More threads files.
35229         Name mono-endian.h not endian.h
35231 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
35233         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
35234         stuff and implement a few more bits.
35235         * icall.c: a field needs to be dereferenced twice. Do not use the same
35236         name for two variables in the same scope.
35237         * image.c, image.h: cleanups.
35239 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
35241         * class.c (mono_class_metadata_init): bug fix: compute the right size
35243 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
35245         * icall.c: implemented some of the Reflection internalcalls.
35246         * image.c, image.h: start writing out the PE/COFF image.
35247         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
35248         that does the reverse than decode_blob_size ().
35249         * object.c: use mono_metadata_encode_value (). Move here
35250         temporary implementation of mono_string_to_utf8 ().
35251         * rawbuffer.c: make malloc_map static.
35253 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
35255         * metadata.c: fix type comparison for arrays.
35256         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
35257         Added a couple of new classes to monodefaults.
35258         * icall.c: added a couple of Reflection-related internalcalls.
35259         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
35260         Added a byval_arg MonoType to MonoClass.
35262 2001-09-28  Dick Porter  <dick@ximian.com>
35264         * icall.c:
35265         * threads-pthread.h: 
35266         * threads-pthread.c: Implemented internal calls for
35267         LocalDataStoreSlot operations.  Applied mutexes around all shared
35268         data.  Reworked the thread creation and Start() operations to
35269         avoid a race condition.
35270         
35271         * threads-dummy.h:
35272         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
35274 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
35276         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
35278 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
35280         * class.c, loader.c: warn and return NULL instead of erroring out.
35281         * icall.c: added System.AppDomain::getCurDomain().
35282         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
35284 2001-09-25  Dick Porter  <dick@ximian.com>
35286         * threads-pthread.h:
35287         * threads-pthread.c: Implemented timed thread joining and added
35288         System.Threading.Thread::Join_internal internal call
35290         * icall.c: Added System.Threading.Thread::Join_internal internal call
35292         * threads-dummy.h:
35293         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
35295 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
35297         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
35298         mono_string_intern () to implement the semantics of the ldstr opcode
35299         and the interning of System.Strings.
35300         * icall.c: provide hooks to make String::IsIntern and String::Intern
35301         internalcalls.
35303 2001-09-23  Dick Porter  <dick@ximian.com>
35305         * threads-dummy.c: 
35306         * threads-dummy.h: New files of dummy threading routines
35308         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
35309         support code based on system specifics
35311         Rename PTHREAD_LIBS to THREAD_LIBS
35312         
35313 2001-09-23  Dick Porter  <dick@ximian.com>
35315         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
35316         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
35317         internal calls.
35318         (mono_thread_init): Set up a Thread object instance to return when
35319         the main thread calls Thread.CurrentThread
35320         (mono_thread_cleanup): Wait for all subthreads to exit
35322         * icall.c: New internal calls for System.Threading.Thread::Sleep
35323         (including Schedule) and CurrentThread
35325         * threads.h: New file, to insulate thread-specific stuff from the
35326         rest of the code
35328 2001-09-21  Dick Porter  <dick@ximian.com>
35330         * threads-pthread.h: 
35331         * threads-pthread.c: New file, for handling pthreads-style
35332         threading support.  Start() now starts a new thread and executes
35333         the ThreadStart delegate instance.
35335         * icall.c: Added the internalcall for
35336         System.Threading.Thread::Start_internal
35338         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
35340 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
35342         * loader.c: work around the different signatures for delegates
35343         constructors csc generates in compiled code vs the ones compiled in mscorlib.
35345 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
35347         * class.h, class.c: add mono_class_get_field_from_name ().
35348         * *: Fix C comments and other ANSI C issues.
35350 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
35352         * endian.h, assembly.c: fix some endianness issues.
35354 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
35356         * loader.h, load.c: add delegate_class to mono_defaults.
35357         Handle runtime provided methods in mono_get_method ().
35359 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
35361         * loader.c (mono_get_method): use pinvoke for internal call
35363         * icall.c: use pinvoke for internal call
35365         * loader.c (method_from_memberref): set the method name
35367 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
35369         * metadata.c: help the compiler generate better code for
35370         mono_class_from_mono_type ().
35372 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
35374         * class.c (mono_class_metadata_init): delayed computing of the
35375         class size to mono_class_metadata_init ()
35377 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
35379         * class.c, class.h: add an interfaces member to MonoClass.
35380         * image.c, image.h: add assembly_name field to MonoImage
35381         from the assembly table.
35382         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
35384 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
35386         * class.c: Handle Array in mono_class_from_mono_type ().
35387         * metadata.c, pedump.c: some endian fixes.
35389 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
35391         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
35392         * metadata.c: fix small problem introduced with the latest commit.
35394 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
35396         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
35397         We don't need a MonoMetadata pointer anymore to compare signatures in
35398         mono_metadata_signature_equal (), update callers.
35399         Reduced memory usage an number of allocations for MonoMethodHeader and
35400         MonoMethodSignature.
35402 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
35404         * metadata.c: added compare for szarray.
35406 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
35408         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
35409         and add a couple more types to it and mono_defaults. Give an hint on
35410         classes that need implementing in our corlib and are referenced
35411         in mscorlib.
35413 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
35415         * class.h, class.c: keep track if a class is also an Enum.
35416         * loader.c: Implement a couple more types for use in libffi
35417         marshalling. Gives better diagnostics when failing to dlopen
35418         a library. Set method->klass for P/Invoke methods, too.
35420 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
35422         * class.c, class.h: add a MonoType this_arg to MonoClass that
35423         represents a pointer to an object of the class' type that
35424         can be used by the interpreter and later the type cache.
35425         Add best guess alignment info for valuetype objects.
35427 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
35429         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
35430         into MonoType: one less level of indirection and allocation and
35431         simplifies quite a bit of code. Added cache for MonoTypes that are
35432         used frequently, so that we don't need to allocate them all the time.
35434 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
35436         * class.c (mono_class_create_from_typedef): System.Enum is also a
35437         value type, although it does not derive from System.ValueType
35438         (maybe a bug in the ms compiler?)
35440         * metadata.c (mono_type_size): return the right size for value types
35442         * loader.c (mono_get_method): only initialize method header if not abstract
35444         * class.c (mono_class_from_mono_type): use mono_default values. 
35446 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
35448         * *: use MonoClass pointers instead of <type_tokens>
35449         
35450         * class.h: new flag: metadata_inited.
35452         * class.c (mono_class_metadata_init): impl.
35453         (mono_class_instance_size): impl.
35454         (mono_class_data_size): impl.
35456 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
35458         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
35459         MonoClass now has the name and name_space fields. 
35460         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
35461         mono_get_method () takes and optional MonoClass as argument.
35462         Removed mono_typedef_from_name() and added mono_class_token_from_name()
35463         instead that takes advantage of a map from class names to typedef
35464         tokens in MonoImage.
35466 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
35468         * metadata.c: zero is not a valid alignment boundary.
35469         Merge MONO_TYPE_VOID in default decoding code.
35471 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
35473         * image.h: merged MonoMetadata into MonoImage
35475         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
35476         identify the type of elements.
35478 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
35480         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
35481         * cil-coff.h: split MonoMSDOSHeader and add size info.
35482         * image.c: add some consistency checks.
35483         * metadata.c: fix row size computation: one programmer
35484         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
35485         add explanation for the locator routine.
35486         Fix decoding of size in method header.
35487         
35488 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
35490         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
35491         (g_concat_dir_and_file): Bring g_concat_dir_and_file
35492         function from gnome-libs.  This uses the right path separator
35493         based on the OS, and also works around a bug in some systems where
35494         a double slash is not allowed. 
35495         (default_assembly_name_resolver): Use g_concat_dir_and_file
35496         (mono_assembly_open): ditto.
35498 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
35500         * metadata.c (mono_metadata_signature_equal): impl.
35502         * *: void is now a realy MonoType (instead of using NULL)
35503         
35504         * metadata.c (do_mono_metadata_parse_type): use
35505         mono_metadata_parse_type to parse void value.
35507 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
35509         * metadata.c, metadata.h: in the signature and method header store
35510         only the space required for holding the loca vars and incoming arguments.
35512 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
35514         * metadata.c (do_mono_metadata_parse_type): treat void like any
35515         other type (instead of assigning NULL);
35517 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
35519         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
35521 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
35523         * image.c (do_mono_image_open): added a cache for arrays.
35525 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
35527         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
35528         decode a single column from a row in a metadata table and changes
35529         to take advantage of it in the typedef locator (gives a nice speed up).
35530         Store offset info for function params.
35532 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
35534         * image.h (MONO_IMAGE_IS_CORLIB): removed 
35536 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
35538         * assembly.c: how could mono_assembly_close () had ever worked?
35539         * metadata.c, metadata.h: provide offset info for local vars.
35540         Implement mono_type_size () to take care of alignment as well
35541         as size (it was mono_field_type_size in cli/class.c before).
35543 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
35545         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
35547         * assembly.h (CORLIB_NAME): set to corlib.dll
35549         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
35551 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
35553         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
35554         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
35555         tokentype.h: massive namespace cleanup.
35557 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
35559         * metadata.h, metadata.c: decode exception clauses when parsing method header.
35561 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
35563         * metadata.c (mono_metadata_free_type): added check for type !=
35564         NULL (void) before calling mono_metadata_free_type()
35566 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
35568         * metadata.h, row_indexes.h: added header with enumerations to use
35569         to index in the columns from tables in metadata and to decode coded
35570         tokens: we should start using this instead of embedding magic numbers
35571         all over the code.
35573 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
35575         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
35576         Move metadata_t info from cli_image_info_t to MonoImage, where
35577         it's easily accessible. Changed all the uses accordingly.
35578         Added the method and class caches to MonoImage.
35579         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
35580         and mono_metadata_decode_value () signature to be more consistent
35581         with the other parse functions (and simplify code). Taken advantage
35582         of zero-length array allocation with GCC. Removed reduntant (and
35583         wrong) MonoFieldType struct and use MonoParam instead. Changed
35584         mono_metadata_parse_field_type () to use common code for parsing.
35585         Added mono_metadata_typedef_from_field () and
35586         mono_metadata_typedef_from_method () to lookup a typedef index from a
35587         field or method token.
35588         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
35590 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
35592         * metadata.c (mono_metadata_parse_field_type): Implement. 
35593         (do_mono_metadata_parse_type): Split engine from
35594         mono_metadata_parse_type, so that we can create smaller structures
35595         for things that just have one pointer to the MonoType (look at
35596         the MonoFieldType)
35598 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
35600         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
35601         as Jan Gray found out, it is incorrect. 
35603 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
35605         * assembly.c: Implement asssembly loading.  This loads an image
35606         and loads all the referenced assemblies.  Come to think of it, we
35607         could always do lazy loading of the assemblies. 
35609         * image.c (mono_image_open): Keep loaded images in a hashtable.
35611         * image.h (MonoImage): Add reference count.
35613 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
35615         * assembly.c (mono_assembly_open): Keep track of the file name in
35616         case the assembly has no ASSEMBLY table.
35618         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
35619         from get.c here.
35621 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
35623         * metadata.c, metadata.h: decode local vars in method header
35624         parse function. Change callers accordingly.
35626 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
35628         * metadata.h, cil-coff.h: protect against multiple inclusion.
35629         Added some new structures to hold information decoded from metadata:
35630         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
35631         and relevant decoding/free functions.
35632         * metadata.c: implement decoding functions. Add warning for out of bounds
35633         index in mono_metadata_locate(). Implement mono_get_method () to retreive
35634         all the info about a method signature and invocation. Remove check on
35635         uninitialized local var in parse_mh() and fix memory leak.
35637 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
35639         * metadata.h: More macros.
35641         * tokentype.h: New file.
35643 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
35645         * assembly.c: added a consistency check and initialize
35646         some structures with g_new0().
35647         * metadata.c: fixed a couple more bugs in table size computation
35648         and add other checks for out-of bound access to metadata.
35650 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
35652         * metatada.c: fix bugs computing table sizes. Spew a
35653         warning when index in string heap is out of bounds.
35655 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
35657         * metadata.h: Add a couple of macros to manipulate tokens. 
35659 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
35661         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
35662         cli_section_tables).
35664 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
35666         * metadata.c (mono_metadata_user_string): New function, provides
35667         access to the UserString heap. 
35669 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
35671         * metadata.c: Add inline documentation.
35673 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
35675         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
35676         files. 
35678 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
35680         * typeattr.h: New file, TypeAttribute flags. 
35682 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
35684         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
35685         mono_assembly_ensure_section): Section loading code.
35686         (load_section_tables): Load the sections.
35688         * mono/metadata/metadata.c (mono_metadata_locate_token,
35689         mono_metadata_locate): Functions to locate the information
35690         definition given a token or a table and an index.
35691         (mono_metadata_compute_table_bases): New.
35692         (compute_size): New function to compute the sizes of the various
35693         tables.
35695         * mono/metadata/metadata.h: Finish listing the different index
35696         types. 
35698         * mono/metadata/pedump.c: Improve to dump new information.
35700 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
35702         * mono/metadata/metadata.c: Entered all the tables matching
35703         Beta2. 
35705         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2