2003-10-09 Dick Porter <dick@ximian.com>
[mono.git] / mono / metadata / ChangeLog
index acbb2837649fbf238b7527e40277cda261e154db..95f56523d31ec5813a99cf2d99a43d823f343bf2 100644 (file)
@@ -1,3 +1,597 @@
+2003-10-09  Dick Porter  <dick@ximian.com>
+
+       * icall.c:
+       * locales.h:
+       * locales.c: Internal calls for constructing CultureInfo and
+       related objects from libicu (if its available.)
+
+2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
+
+       * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
+
+2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * threadpool.c: added an argument to async_invoke_thread that is the
+       item to process, pass the MonoAsyncResult to the thread start function
+       when creating a new thread. This way we don't need to acquire any lock
+       when we're creating a new thread. Readded a semaphore for faster
+       response times (instead of that Sleep i added).
+
+2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
+
+       * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
+       get daylight change dates better on Windows, fix handling
+       of platforms without tm_gmtoff.
+
+2003-10-06  Martin Baulig  <martin@ximian.com>
+
+       * class.c (inflate_generic_method): Renamed to
+       mono_class_inflate_generic_method() and made public.
+       (mono_class_init): Don't inflate the generic methods here.
+       (mono_class_from_generic): Added `gboolean inflate_methods'
+       argument.  Inflate the methods here.
+
+       * loader.c (mono_method_get_param_names): Ignore instances of
+       generic types for the moment.
+
+       * reflection.c (fixup_method): Added support for inflated methods.
+       (mono_image_create_token): Use mono_image_get_methodref_token()
+       for inflated methods.
+       (mono_custom_attrs_from_param): Ignore instances of generic types
+       for the moment.
+       (mono_reflection_bind_generic_parameters): New public function.
+       Moved all the functionality from
+       ves_icall_Type_BindGenericParameters() here and added support for
+       dynamic types.
+       (mono_reflection_define_generic_parameter): Initialize
+       `klass->methods' here.
+
+       * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
+       functionality into mono_reflection_define_generic_parameter().
+       (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
+       TypeBuilder, return that TypeBuilder.
+
+2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * appdomain.c: removed mono_delegate_semaphore.
+
+       * threadpool.c:
+       (mono_thread_pool_add): moved hash table creation inside and the thread 
+       creation outside of the critical region.
+       (mono_thread_pool_finish): removed obsolete code.
+       (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
+       continue or exit the thread depending on the queue.
+
+2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
+
+       * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
+       marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
+        handle more bool marshalling options
+
+2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
+
+       * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
+       arrays of structs. Also add a more descriptive error message when
+       a structure member is marshalled as LPArray.
+
+2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
+
+       * marshal.c (mono_marshal_get_native_wrapper): Add support for
+       marshalling arrays of complex types. Fixes #29098. Also remove an
+       usused and incomplete function.
+
+Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+       * gc.c: report heap_size - free_bytes as total memory allocated
+       (bug#49362).
+
+2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
+
+       * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
+       fix timezone handling problems on Windows.
+       
+       * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
+       asserts when the year is outside the range handled by ms the functions.
+
+       * class.c (setup_interface_offsets): If the class is an interface,
+       fill out its interface_offsets slot.
+
+2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * threadpool.c: mark threadpool threads as background.
+
+2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
+
+       * decimal.c - define DECINLINE to nothing if not using GCC
+
+2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
+
+       * assembly.c: More refcount fixes.
+
+2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * string-icalls.c: if we're not trimming, return the same string.
+       When not splitting, don't create a new string.
+
+2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * image.c:
+       (mono_image_open): increment the ref_count inside the critical section.
+
+2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
+
+       * image.c (mono_image_open): Fix reference counting bug.
+
+2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
+
+       * marshal.c (mono_marshal_type_size) struct alignment changed for 
+       64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
+       64bits. Avoid leak in mono_marshal_get_native_wrapper when
+       mono_lookup_pinvoke_call throws.        
+
+2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
+
+       * reflection.c (mono_reflection_parse_type): Fix #49114.
+
+       * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
+       temporary workaround for cygwin header problem.
+
+       * object.c (mono_object_isinst): Synchronize this with the code
+       generated by the JIT for casts.
+
+2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
+
+       * reflection.c (encode_type): Fix #38332.
+
+2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
+
+       * marshal.c (mono_marshal_method_from_wrapper): New function to return
+       the original method from the wrapper method.
+
+2003-09-25  Martin Baulig  <martin@ximian.com>
+
+       * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
+       interncall since it was identical to `Type.GetGenericTypeDefinition()'.
+       (ves_icall_Type_get_IsGenericInstance): New interncall.
+
+2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
+
+        * object.c: fix cast warning in big endian code.
+
+2003-09-19 Jackson Harper <jackson@latitudegeo.com>
+
+       * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
+       
+2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * assembly.c: don't call check_env from mono_assembly_load. It's
+       already done once in mono_assemblies_init and may cause headaches when
+       multiple threads are loading assemblies.
+
+2003-09-19  Martin Baulig  <martin@ximian.com>
+
+       * reflection.c (mono_reflection_define_generic_parameter): Don't
+       allocate `klass->methods', set `klass->flags' to
+       TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
+
+2003-09-18  Martin Baulig  <martin@ximian.com>
+
+       * class.c (mono_class_init): Don't create `class->methods' if it's
+       already initialized.
+
+       * metadata.c (mono_metadata_load_generic_params): Make this
+       actually work.
+
+       * reflection.c (mono_reflection_define_generic_parameter): Set
+       parent class and interfaces from the constraints.
+
+       * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
+       to keep this struct in sync with the declaration in TypeBuilder.cs.
+
+2003-09-17  Martin Baulig  <martin@ximian.com>
+
+       * metadata.h (MonoType): Replaced the data's `int type_param'
+       field with `MonoGenericParam *generic_param'.
+       (MonoGenericParam): Added `MonoClass *klass'.
+
+       * class.c (mono_class_from_gen_param): Removed the
+       `MonoImage *image' and `int type_num' arguments.
+
+       * metadata.c (mono_metadata_parse_generic_param): New static
+       method; creates a MonoGenericParam which just contains the index.
+       (do_mono_metadata_parse_type): Call
+       mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
+       MONO_TYPE_MVAR.
+
+       * reflection.c (mono_image_typedef_or_ref): Generic type
+       parameters may be in the same assembly, but never use a typedef
+       for them.
+       (mono_reflection_define_generic_parameter): We're now creating a
+       "real" class for the type parameter; it's now safe to call
+       mono_class_from_mono_type() on the class'es type, it'll do the
+       right thing.
+
+2003-09-16  Martin Baulig  <martin@ximian.com>
+
+       * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
+       `symfile->range_entry_size' and `symfile->class_entry_size' here;
+       the `symfile' data structure must be fully initialized before it
+       gets added to the table.
+
+2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
+
+       * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
+
+       * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
+       class init trampolines.
+
+2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
+
+       * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
+       to the built-in profiler to turn off time and allocation profiling
+       respectively.
+
+2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
+
+       * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
+       g_direct_equal.
+
+       * debug-helpers.c (mono_method_full_name): Print the wrapper type
+       in human readable form.
+
+2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
+
+       * reflection.c icall.c: Fixed warnings.
+
+       * image.c (load_class_names): Use a temporary hash table to hold the
+       namespaces in order to avoid doing many string comparisons.
+
+       * image.h: Fix typo.
+
+       * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
+       Pass NULL instead of g_direct_equal to the GHashTable constructor 
+       since the NULL case is short-circuited inside g_hash_table_lookup, 
+       leading to better performance.  
+
+       * metadata.c (mono_metadata_custom_attrs_from_index): New function to
+       obtain the first custom attribute for a given index. Depends on the
+       CustomAttribute table being sorted by the parent field.
+
+       * reflection.c (mono_custom_attrs_from_index): Use the new function 
+       for better performance.
+
+2003-09-07  Martin Baulig  <martin@ximian.com>
+
+       * class.c (mono_class_init): If we're a generic instance, inflate
+       all our methods instead of loading them from the image.
+       (mono_class_from_generic): Set `class->methods = gklass->methods'.
+
+2003-09-07  Martin Baulig  <martin@ximian.com>
+
+       * mono-debug-debugger.c: Added support for constructors.
+
+2003-09-06  Martin Baulig  <martin@ximian.com>
+
+       * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
+       New interncall.
+
+       * reflection.c (mono_reflection_setup_generic_class): Call
+       ensure_runtime_vtable() to create the vtable.
+
+2003-09-05  Martin Baulig  <martin@ximian.com>
+
+       * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
+       MONO_TYPE_MVAR.
+
+2003-09-04  Martin Baulig  <martin@ximian.com>
+
+       * reflection.c (mono_reflection_define_generic_parameter): Generic
+       parameters start with zero.
+
+2003-09-04  Martin Baulig  <martin@ximian.com>
+
+       * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
+
+       * reflection.h (MonoReflectionGenericParam): New typedef.
+       (MonoReflectionTypeBuilder): Added `generic_params' fields to get
+       the generic parameters from the managed TypeBuilder.
+
+       * reflection.c (mono_reflection_define_generic_parameter): New function.
+       (mono_reflection_create_runtime_class): Encode generic parameters.
+       (mono_reflection_setup_generic_class): New function; this is
+       called after adding adding all generic params to the TypeBuilder.
+       (encode_type): Added MONO_TYPE_VAR.
+
+2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
+
+       * class.h class.c (mono_class_needs_cctor_run): Moved this method
+       here from the JIT.
+
+       * assembly.h assembly.c: Moved the AOT loading code into an assembly
+       load hook.
+
+2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
+
+       * reflection.h reflection.c class.h class.c: Delete duplicate 
+       definition of mono_type_get_name () from reflection.c and export the
+       one in class.c.
+
+       * class.c: Class loading fixes from Bernie Solomon 
+       (bernard@ugsolutions.com).
+
+       * reflection.c: Endianness fixes from Bernie Solomon 
+       (bernard@ugsolutions.com).
+       
+2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
+
+       * assembly.h assembly.c: Define a file format version for AOT
+       libraries.
+       
+       * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
+
+       * appdomain.h (MonoJitInfo): New field to determine whenever the
+       code is domain neutral.
+       
+2003-08-31  Miguel de Icaza  <miguel@ximian.com>
+
+       * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
+
+2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
+
+       * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
+       (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
+       Avoid caching the result since strings must be domain specific. Fixes
+       #48050.
+
+2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
+
+       * marshal.c (mono_marshal_init): Make this callable multiple times
+       since it is hard to find a correct place to call it.
+
+       * object.c (mono_runtime_class_init): Execute static constructors in
+       the correct appdomain.
+
+       * image.c (build_guid_table): Handle the case when multiple images have
+       the same GUID.
+
+2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * icall.c: added a couple of icalls for System.Web.
+
+2003-08-28  Martin Baulig  <martin@ximian.com>
+
+       * icall.c (ves_icall_Type_BindGenericParameters): Use
+       `klass->generic_inst' instead of `&klass->byval_arg' in the
+       mono_type_get_object() call.  The returned type must be
+       MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
+
+2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
+
+       * NOTES: New file.
+
+       * object.c (mono_class_proxy_vtable): Make it thread safe.
+
+       * pedump.c: Fix warning.
+
+       * object.c appdomain.h: Get rid of metadata_section. 
+       It is no longer needed and it was causing deadlocks with domain->lock.
+
+       * appdomain.c (add_assemblies_to_domain): Make it thread safe.
+
+2003-08-26  Martin Baulig  <martin@ximian.com>
+
+       * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
+
+2003-08-26  Martin Baulig  <martin@ximian.com>
+
+       * pedump.c (main): Call mono_metadata_init(),
+       mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
+       and mono_loader_init().
+
+2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
+
+       * loader.h: Add missing include to fix build.
+
+       * image.h: mono_image_load_references is no more.
+
+       * assembly.c: Reworked assembly loading to make it really thread safe.
+       After these changes, the assembly returned by mono_assembly_open is
+       fully initialized, i.e. all its references assemblies are loaded.
+
+       * assembly.c (mono_image_load_references): Renamed to 
+       mono_assembly_load_references, and made private, since clients no
+       longer need to call it.
+
+       * class.c: Removed calls to mono_assembly_load_references, since it was
+       a source of deadlocks.
+
+       * loader.h loader.c class.h class.c: Protect data structures using a 
+       new lock, the loader lock.
+
+       * class.c (mono_class_setup_vtable): Create temporary hash tables and
+       GPtrArrays only when needed.
+
+       * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
+       into empty structures by mcs. Fixes pinvoke7.cs.
+       
+       * domain.c (mono_init): Call a new initialization function.
+
+       * appdomain.c (mono_runtime_init): Call the new initializer function
+       of the marshal module.
+
+       * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
+       inserted into empty structures by mcs. Fixes pinvoke7.cs.
+
+       * marshal.h marshal.c: Added locks around the wrapper caches to make
+       this module thread safe.
+
+       * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
+       this argument. Fixes pinvoke1.exe.
+
+2003-08-25  Lluis Sanchez <lluis@ximian.com>
+
+       * object.h: Added call_type field to MonoMethodMessage and the corresponding
+       enumeration of values. Removed fields to store remote call output values in
+       MonoAsyncResult. Not needed any more.
+       * object.c: Initialize call_type and async_result fields in mono_message_init.
+       * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
+       dispatching the message.
+       mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
+       async call to finish. To do it use a message with EndInvoke call type.
+
+2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
+
+       * loader.h loader.c (mono_method_hash_marhal_info): New function which
+       determines whenever a method has marshalling info.
+
+2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * assembly.c: fix the build on windows.
+
+2003-08-22 Lluis Sanchez <lluis@ximian.com>
+
+       * object.cs: Fixed bug #47785.
+
+2003-08-22 Jackson Harper <jackson@latitudegeo.com>
+
+       * string-icalls.c (StringReplace): If their are no occurances of
+       the old string found return a reference to the supplied
+       string. This saves some memory and matches MS behavoir.
+       
+2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * socket-io.c: fixed compilation for systems that define AF_INET6
+       and don't define SOL_IP/SOL_IPV6.
+
+2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
+
+       * object.c (mono_object_isinst): Fix casts to TransparentProxy in
+       the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
+
+       * rawbuffer.c rawbuffer.h: Make this module thread safe.
+
+       * domain.c: Make this module thread safe.
+
+       * domain.c (mono_init): Call new initialization function.
+
+       * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
+       reference types too. Fixes #38812.
+
+       * image.c (mono_image_init): Fixed warnings.
+
+       * class.c (mono_class_from_typeref): Handle assembly load failure
+       correctly.
+
+       * appdomain.c (add_assemblies_to_domain): Handle the case when
+       the references of an assembly are not yet loaded.
+
+       * metadata.c image.c assembly.c: Moved initialization of global
+       variables to a separate function called at startup since lazy 
+       initialization of these variables is not thread safe.
+       
+       * image.c assembly.c: Made this module thread safe by adding locks in 
+       the appropriate places.
+
+       * domain.c (mono_init): Call the new initialization functions of the
+       three modules.
+
+2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
+
+       * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
+         make a direct call. It is proxy's work to make the call asynchronous.
+         mono_delegate_end_invoke(): If the targe is a proxy, just collect
+         the return values.
+       * object.cs: mono_method_call_message_new(): read AsyncResult and
+         state object from parameters list, if this info is requested.
+       * object.h: Added fields to store remote call output values in
+         MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
+
+Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+       * object.h: add needed fields to MonoThread.
+       * threads.c, threads.h: allow registering a function to cleanup data
+       allocated per thread by the JIT.
+
+Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+       * loader.h: portability fix by Bernie Solomon
+       * <bernard@ugsolutions.com>.
+
+2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
+
+       * reflection.h reflection.c (mono_param_get_objects): Changed this to 
+       return a MonoArray. This simplifies the code and also ensures that
+       the cache allways contains an object reference as a value.
+
+       * icall.c (ves_icall_get_parameter_info): Simplified using the new
+       function.
+
+2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
+       fixes a problem with byte ordering when getting the address family for
+       a socket.
+
+2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
+
+       * .cvsignore: Added monosn.
+
+       * reflection.h reflection.c loader.c: Added support for parameter
+       marshalling to dynamically created types. Fixes #47295.
+
+Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+       * rand.c: remove useless warnings.
+
+Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+       * class.c: implemented ldtoken for methods and fieldrefs.
+
+2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * threadpool.c: when mono_async_invoke was called, no one took care of
+       monitoring the queue. So if the method invoked took some time and we
+       got new async invoke requests after 500 ms (the thread created waited
+       that long in WaitForSingleObject), the new async invoke was not called
+       until the previous one finished.
+
+       This is fixed now. Thanks to Totte for helping with it.
+
+2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
+
+2003-08-11  Martin Baulig  <martin@ximian.com>
+
+       * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
+
+2003-08-06  Martin Baulig  <martin@ximian.com>
+
+       * mono-debug-debugger.c: Added support for static fields,
+       properties and methods.
+
+2003-08-06  Martin Baulig  <martin@ximian.com>
+
+       * mono-debug-debugger.c: Don't store the MonoString's vtable to
+       make this work for applications with multiple application domains.
+
+2003-08-04  Martin Baulig  <martin@ximian.com>
+
+       * mono-debug-debugger.c: Completely reworked the type support; the
+       most important thing is that we're now just using one single
+       `MonoType' instance per type.
+
+Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
+
+       * mono-endian.h, mono-endian.c, icall.c: Added icall
+       ves_icall_System_Double_AssertEndianity to assert double word endianity
+       on ARM (FPA). The icall uses a macro defined in mono-endian.h.
+
+Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+       * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
+       support, icalls and fixes.
+
 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
 
        * unicode.c (ves_icall_System_Char_IsPunctuation): The set of