In .:
[mono.git] / mono / metadata / ChangeLog
1 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
2
3         * loader.c (method_from_memberref): Don't abort if the array
4         method is not found. A regular loader failure is more informative
5         and correct.
6
7         Fixes #474271.
8
9 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
10
11         *loader.c: Guard MonoImage::method_cache/methodref_cache
12         using the image lock instead of the loader lock.
13
14         * metadata.h: Add comments about which fields are protected by
15         the image lock.
16
17 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
18
19         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
20
21         * generic-sharing.c (mono_method_construct_object_context): Remove the
22         wrapper_type == NONE assert, it is not needed.
23
24 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
25
26         * reflection.c (clear_cached_object): New helper function.
27         (mono_method_clear_object): New function to clear the cached reflection
28         objects for a dynamic method.
29
30         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
31         Partly fixes # 463323.
32         
33 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
34
35         * class.c:
36         * loader.c:
37         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
38
39 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
40
41         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
42         take the image lock instead of the loader lock.
43
44         * metadata-internals.h: Export new functions.
45
46 2009-02-12  Miguel de Icaza  <miguel@novell.com>
47
48         * domain.c (app_config_parse): Remove another use of stat that is
49         not necessary as g_file_get_contents already does the presence
50         check. 
51
52 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
53
54         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
55
56         * marshal.c: Move the bstr handling code to cominterop.c.
57
58         * marshal.c: Remove some COM interop code missed previously.
59
60 2009-02-12  Miguel de Icaza  <miguel@novell.com>
61
62         More Paolo patches from the Wii port:
63         
64         * security.c: Remove ves_icall_System_Environment_get_UserName
65         from here.
66
67         * icall.c: And put ves_icall_System_Environment_get_UserName
68         here. 
69
70         * appdomain.c (mono_set_private_bin_path_from_config): Remove
71         redundant call to stat that was only used to test for the file
72         existence.   Patch from Paolo.
73
74         * gc.c (run_finalize): If COM is disabled, do not link in
75         mono_marshal_free_ccw.
76
77         * generic-sharing.c: Use alloca.h here as well.
78
79 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
80
81         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
82
83 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
84
85         * cominterop.c cominterop.h: New files.
86
87         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
88         function/typedefs which are needed by cominterop.c global.
89
90 2009-02-12  Mark Probst  <mark.probst@gmail.com>
91
92         * generic-sharing.c: Don't take the loader lock to guard image
93         mempool allocs.
94
95 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
96
97         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
98         called without the loader lock which is required to guard MonoImage:tokens.
99
100 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
101
102         * class.c:
103         * metadata.c:
104         * method-builder.c:
105         * marshal.c:
106         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
107
108 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
109
110         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
111         Rework the code to use regular mono_image_alloc/0.
112
113         * loader.c: Rework the code to use regular mono_image_alloc/0.
114
115         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
116
117 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
118
119         * object-internals.h : Fixing a typo in the 
120           MonoReflectionComVisibleAttribute struct.
121
122         * marshal.c (cominterop_com_visible): Check the implemented 
123           interfaces for ComImport.
124
125         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
126           assume that bools should be treated as VARIANTBOOLs.
127
128         * marshal.c (emit_marshal_boolean): Adding cases for 
129           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
130
131         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
132           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
133
134         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
135           should be treated as VARIANTBOOLs.    
136
137         Code is contributed under MIT/X11 license.
138
139 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
140
141         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
142         allocation with the image lock.
143
144 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
145
146         This patch is the last of a series to remove explicit reference of MonoImage::mempool
147         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
148
149         * object.c: Add mono_string_to_utf8_image.
150
151         * object-internals.h: Export mono_string_to_utf8_image.
152
153         * reflection.c: Rework all explicit references to the the image mempool to go thought
154         the mono_image_alloc set of functions.
155
156 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
157
158         This patch is the third of a series to remove explicit reference of MonoImage::mempool
159         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
160         and generics-sharing.c.
161
162         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
163         as first argument. Note that this function remains broken as it doesn't perform locking around the
164         mempool allocation.
165
166         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
167
168         * image.c: Add g_slist_append_image.
169
170         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
171         the supplied image for allocation. Move code into mono_metadata_field_info_full.
172
173         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
174         Fix all related code to do the same.
175
176         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
177
178         * metadata-internals.h: Fix the signatures.
179
180 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
181
182         This patch is the second of a series to remove explicit reference of MonoImage::mempool
183         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
184         and similar to work using MonoImage.
185
186         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
187         MonoMemPool.
188
189         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
190
191         * class.c (mono_metadata_signature_deep_dup): Same.
192
193         * class.c (inflate_generic_type): Same.
194
195         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
196
197         * metadata.c (mono_metadata_signature_dup_full): Same.
198
199         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
200         mono_metadata_signature_dup_full.
201
202         * metadata.c (mono_metadata_type_dup): Same.
203
204         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
205
206         * reflection.c: Same.
207
208         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
209
210         * metadata-internals.h: Fix the signatures.
211
212         * class-internals.h: Same.
213
214 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
215
216         This patch is the first of a series to remove explicit reference of MonoImage::mempool
217         and use mono_image_alloc set of functions instead. 
218
219         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
220         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
221         of a MonoMemPool.
222
223         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
224
225         * class.c (g_list_prepend_mempool): Removed.
226
227         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
228
229         * image.c: Add g_list_prepend_image.
230
231         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
232
233         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
234
235
236 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
237
238         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
239         mono_image_unlock.
240
241         * image.c (mono_image_init): Init the lock field.
242  
243         * image.c (mono_image_init): Cleanup the lock field.
244
245         * image.c: Add mono_image_(un)lock functions.
246
247 2009-02-11  Mark Probst  <mark.probst@gmail.com>
248
249         * class.c, class-internals.h: mono_method_get_context_general()
250         combines the functionality of mono_method_get_context() and
251         mini_method_get_context().
252
253         * generic-sharing.c, domain-internals.h:
254         mono_method_construct_object_context() and
255         mono_domain_lookup_shared_generic() moved from mini.
256
257         * icall.c (ves_icall_InternalInvoke): Handle the case where the
258         method doesn't have the correct instantiation because it's shared
259         generic code.  Fixes #473999.
260
261 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
262
263         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
264
265         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
266         
267 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
268
269         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
270
271         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
272
273         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
274         and recheck the cache for dups after it.
275
276         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
277
278         Fixes one of the deadlocks found in #473150.
279
280 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
281
282         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
283           For Win32, add additional break conditions for accept.
284
285         Code is contributed under MIT/X11 license.
286
287 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
288
289         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
290         lazily initialize the native wrapper cache.
291         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
292         cache, since they are different from the normal wrappers.
293
294         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
295
296         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
297         AOT compiled native wrappers.
298
299 2009-02-09  Geoff Norton  <gnorton@novell.com>
300
301         * appdomain.h:
302         * security-core-clr.c: Allow enabling core-clr from the embedding
303         API.
304
305 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
306
307         * socket-io.c: when requesting all the local ips, if there are no
308         interfaces up and running, MS returns 127.0.0.1.
309
310 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
311
312         * mono-perfcounters-def.h: processor time is an inverse time.
313         Fixes bug #468625.
314
315 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
316
317         * socket-io.c: an empty host name returns the list of local IPs.
318         Fixes bug #386637 part 1/2.
319
320 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
321
322         * verify.c (mono_class_interface_implements_interface): Call
323         mono_class_setup_interfaces ().
324         (merge_stacks): Ditto.
325
326 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
327
328         * class.c (mono_class_setup_interfaces): New function to lazily initalize
329         klass->interfaces.
330         (mono_generic_class_get_class): Don't initalize klass->interfaces.
331         (mono_generic_class_get_class): Ditto.
332
333 2009-02-06  U-QUACK\miguel  <miguel@quack>
334
335         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
336         they live in security.c
337
338         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
339         another bit from Paolo's code.
340
341 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
342
343         * object.c (build_imt_slots): Add a small optimization to avoid inflating
344         methods which will be discarded by add_imt_builder_entry ().
345
346         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
347         need to be boxed.
348
349         * loader.c: Add a statistics for the size of the memberref signature cache.
350         
351         * loader.c (find_cached_memberref_sig): New helper function.
352         (cache_memberref_sig): Ditto.
353
354         * loader.c: Cache the result of parsing memberref signatures, since otherwise
355         they will be parsed again for every generic instantiation, leading to unbounded
356         memory growth.
357
358 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
359
360         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
361         parameters of generic methods.
362
363         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
364         after the original method is copied to the inflated method.
365         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
366
367         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
368         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
369
370         * class.c metadata.c: Update after the changes above.
371
372 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
373
374         * metadata-verify.c: Simplified error handling and added
375         section table validation.
376
377 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
378
379         * class-internals.h (MonoClassExt): New structure containing rarely used
380         fields of MonoClass.
381         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
382         through a new 'ext' field.
383
384         * class.c (mono_class_alloc_ext): New helper function to allocate 
385         class->ext.
386
387         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
388
389 2009-02-05  Mark Probst  <mark.probst@gmail.com>
390
391         * object.c (mono_object_get_virtual_method): Properly inflate
392         generic methods.  Fixes #472692.
393
394 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
395
396         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
397         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
398         for the parent type, the created type must be ready to be used on a generic
399         instantiation.
400         We fill this_arg/byval_arg if the parent is a generic instance to make sure
401         we won't have duplicated entries in generic_inst_cache.
402
403         Fixes #469553.
404
405 2009-02-05  Miguel De Icaza  <miguel@novell.com>
406
407         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
408         replace with plain BSD per the comments on the bug MONO77637.
409
410 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
411
412         * class.c (mono_class_get_generic_class): New accessor function.
413         (mono_class_get_generic_container): Ditto.
414
415         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
416         fields, similar to the ones in MonoMethod.
417
418         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
419         (mono_class_create_from_typedef): Set klass->is_generic if needed.
420
421         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
422         
423         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
424         the same information as element_class->byval_arg.
425
426         * class.c reflection.c: Remove references to class->byval_arg.
427
428         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
429         klass->enum_basetype directly.
430
431         * verify.c metadata.c object.c icall.c reflection.c: Use 
432         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
433         directly.
434
435 2009-02-04  Miguel de Icaza  <miguel@novell.com>
436
437         * icall-def.h: Remove internal calls for sockets when
438         DISABLE_SOCKET is defined, file system writing features when the
439         OS only support reading and not writing data and Policy support if
440         the Policy is disabled.
441         
442         * image.c (do_mono_image_open): Apply Paolo's patches for using
443         mono_file_map_ APIs here.
444
445         * assembly.c: Add support for platforms to avoid prefix
446         auto-detection. 
447
448 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
449
450         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
451         warning.
452
453         * class.c (mono_class_inflate_generic_class): New helper function.
454
455         * class.c: Use mono_class_inflate_generic_class in a few places. Add
456         statistics for inflated methods/classes.
457
458         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
459
460         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
461         the call is made from Delegate.CreateDelegate () for the invoke method of
462         a delegate.
463
464         * loader.c: Add a statistics for the memory occupied by inflated signatures.
465
466         * metadata.c (mono_metadata_signature_size): New helper function.
467
468         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
469         generic instances.
470
471         * metadata.c (inflated_method_in_image): Avoid calling 
472         mono_method_signature () if the method does not already have a signature.
473
474 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
475
476         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
477         valuetype is compatible with target type, check by inheritance as a
478         VT is not really compatible with System.ValueType, for example.
479
480         * verify.c (do_invoke_method): Improve error message.
481
482         * verify.c (do_box_value): If boxing a nullable, use the type argument
483         on stack instead.
484
485         * verify.c (do_newobj): Improve error message.  
486
487         Fixes #469549.
488
489 2009-02-03  Miguel de Icaza  <miguel@novell.com>
490
491         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
492
493 2009-02-03  Mark Probst  <mark.probst@gmail.com>
494
495         * generic-sharing.c: Don't hold domain lock when calling
496         instantiate_other_info().  Fixes #471958.
497
498         * domain-internals.h, loader.c: Describe locking policy of domain
499         lock vs loader lock.
500
501 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
502
503         * verify.c (mono_delegate_signature_equal): Make it possible to check
504         first-arg-bound delegates to static method.
505
506         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
507         static methods with the first arg bound.
508
509         Fixes #469529.
510
511 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
512
513         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
514         errors.
515
516         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
517         under strict mode. Any type, when boxed can be seen as a reference type.
518
519         Fixes #469528.
520
521 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
522
523         * object.h: The lower bound of an array is a signed integer value.
524         Introduce mono_array_lower_bound_t typedef. It should be used instead of
525         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
526
527         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
528         calculate the upper bound.
529         
530         Fixes #471252.
531
532 2009-02-02  Miguel de Icaza  <miguel@novell.com>
533
534         From Paolo's work, refactored, cleared up:
535         
536         * threadpool.c, icall.c: ifdef code that requires a working socket
537         stack.
538
539         * metadata.c (mono_metadata_field_info): Do not attempt to return
540         a value from a function declared as void.
541
542         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
543         from the console stack.
544
545         * assembly.c: use strrchr instead of rindex.
546
547         * class.c, object.c, marshal.c, icall.c, reflection.c: include
548         alloca.h on systems that have it.
549
550         * environment.c: Avoid code that uses stuff from
551         HAVE_SYS_UTSNAME_H
552         
553         * appdomain.c: Include sys/time.h.
554
555         * console-io.c: include sys/ioctl.h if it is available.
556
557 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
558
559         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
560
561         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
562         the method builder.
563
564         * marshal.c: Set mb->skip_visibility instead of setting it on the method
565         after it was created and cached, as the later is not thread safe.
566         
567 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
568
569         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
570         called while the debugging module is not initialized. Fixes #471669.
571
572 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
573
574         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
575
576         Fixes #471255.
577
578 2009-02-02  Mark Probst  <mark.probst@gmail.com>
579
580         * generic-sharing.c (lookup_or_register_other_info): Make sure the
581         loader lock is not taken while the templates lock is held.  Fixes
582         #471089.
583
584 2009-02-02  Mark Probst  <mark.probst@gmail.com>
585
586         * metadata.c (type_in_image): Added a check to fix a monodis
587         crash.
588
589 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
590
591         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
592         nullable arguments.
593
594         * object.c (mono_runtime_invoke_array): Ditto.
595         
596         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
597         freeing wrappers of dynamic methods.
598
599         * loader.c (mono_free_method): Call it. Fixes #463323.
600         
601         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
602         methods taking vtype/byref arguments, to fix yet another bug caused by
603         the sharing of runtime invoke wrappers. Partly fixes #471259.
604
605 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
606
607         * debug-mono-symfile.c (check_line): Return NULL instead of returning
608         <first file in file table>:1 when the IL offset does not have an associated
609         line number.
610
611 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
612
613         * mono-debug.c (mono_debug_lookup_locals): New function to return local
614         variable info for a method.
615
616         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
617         
618 2009-01-30  Jb Evain  <jbevain@novell.com>
619
620         * pedump.c: reuse code from monodis to make sure pedump honors
621         MONO_PATH, which is needed to verify net_2_1 assemblies.
622
623 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
624
625         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
626         there is no line number info.
627
628 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
629
630         Avoid some MonoType allocations
631         * reflection.c (mono_reflection_initialize_generic_parameter):
632         Reuse MonoType from param->pklass rather than allocating one.
633         (mono_dynamic_image_free): Update to changes.
634
635 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
636
637         Rearrange some code to improve consistency
638         * reflection.c (mono_reflection_setup_generic_class): Move body ...
639         (mono_reflection_initialize_generic_parameter): ... here.
640
641 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
642
643         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
644         with type constraints as an experiment.
645
646         * boehm-gc.c (on_gc_notification): Update mono_stats.
647
648 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
649
650         Avoid some allocations
651         * class-internals.h (_MonoGenericInst::type_argv): Convert from
652         pointer to tail array to avoid extra allocation.
653         * metadata.c (free_generic_inst): Update to changes.
654         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
655         on-stack struct.
656
657 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
658
659         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
660         return TRUE if the two type objects are the same.
661
662 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
663
664         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
665         (mono_class_native_size): Use klass->marshal_info->min_align instead of
666         klass->min_align, since klass->min_align contains the managed alignment,
667         while the native alignment can be different, like for longs on x86.
668         Fixes #469135.
669
670         * class-internals.h (MonoMarshalType): Add a min_align field.
671
672 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
673
674         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
675         the 1.0 format.
676
677 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
678
679         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
680         some comments about the usage of the used_regs field.
681
682         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
683         Fixes #469217.
684
685 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
686
687         * appdomain.c: return NULL instead of throwing FileNotFoundException
688         when LoadAssembly() fails.
689
690 2009-01-23  Mark Probst  <mark.probst@gmail.com>
691
692         * metadata.c (mono_metadata_generic_param_equal): Only compare the
693         image if the owner is NULL.  Fixes the AOT failures.
694
695 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
696
697         * metadata.c (mono_metadata_load_generic_params): Initialize the 
698         MonoGenericParam structure using memset so the image field is initialized
699         as well.
700
701 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
702
703         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
704         a plain store.
705
706 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
707
708         * class.c (mono_class_setup_vtable_general): In the generic instance
709         optimization, set method->slot for abstract virtual methods. Fixes part of
710         #467834.
711
712 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
713
714         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
715         which signals that the unloading has started but all appdomain services must
716         remain operational.
717
718         * appdomain.c (mono_domain_unload): The initial state for unloading now
719         is unloading_start and we switch to unloading after the managed call to
720         AppDomain::DomainUnload has finished.
721
722         The new unloading state has to be created because managed code in the
723         DomainUnload event can depend on things like the threadpool still working.
724         The domain must remain fully functional while the event executes.
725
726         This shown as an issue due to Process::WaitForExit, which waits for
727         async reads of stdout and stderr to complete. Since those are processed
728         in the threadpool the code deadlocks because the DomainUnload callback 
729         waits for the async read finished event, which should have been set by a
730         threadpool job but has been discarded due to the domain been in unload
731         state.
732
733 2009-01-21  Mark Probst  <mark.probst@gmail.com>
734
735         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
736         image must match.
737
738 2009-01-21  Mark Probst  <mark.probst@gmail.com>
739
740         * reflection.c (resolve_object): For fields, inflate the class and
741         then get the field in the inflated class.
742
743 2009-01-20  Mark Probst  <mark.probst@gmail.com>
744
745         * object-internals.h (struct _MonoException): Added a comment
746         explaining the new use of trace_ips.
747
748 2009-01-20  Mark Probst  <mark.probst@gmail.com>
749
750         * generic-sharing.c (inflate_other_data): Inflate array methods
751         correctly.
752
753         * loader.c, class-internals.h: Rename search_in_array_class() to
754         mono_method_search_in_array_class() and make it non-static.
755
756 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
757
758         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
759         Hopefully fixes #458168.
760
761 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
762
763         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
764         as it is performed elsewhere.
765
766         Code is contributed under MIT/X11 license
767
768 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
769
770         * mono-perfcounters-def.h: Add counters for asp.net requests total and
771         requests queued.
772         * object.c (mono_raise_exception): Increment the exceptions total
773         counter when an exception is thrown.
774         * class-internals.h: Add a location for storing the total number of
775         asp.net requests served.
776         * mono-perfcounters.c: Implement update support for asp.net counters
777         from the class libraries. Implement read support for asp.net counters
778         and exceptions total counter.
779
780 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
781
782         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
783         accessing klass->methods. Fixes #467385.
784
785 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
786
787         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
788         for byval arguments without an [Out] attribute. Fixes #467212.
789
790         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
791         Fix compilation under android.
792         
793         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
794         processed, scan them directly after they are copied, to achieve better locality
795         and cache usage.
796
797         * socket-io.c: Applied patch from Koushik Dutta
798         (koush@koushikdutta.com). Disable IPV6 when running under android.
799
800 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
801
802         * icall.c (ves_icall_InternalExecute): Add write barriers.
803
804         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
805         the GC code.
806
807         * sgen-gc.c: Implement write barriers in IL code.
808
809 2009-01-17  Geoff Norton  <gnorton@novell.com>
810
811         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
812
813 2009-01-17  Geoff Norton  <gnorton@novell.com>
814
815         * image.c: When unloading the image->references table, there can be gaps
816         in it.  Ensure that we iterate every entry to avoid leaking assembly references
817         when unloading an appdomain.
818
819 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
820
821         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
822         speed up ptr-in-nursery checks.
823
824         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
825         threads_lock () to prevent deadlocks.
826
827         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
828         does not need to be scanned during minor collections, since writes to it
829         must use write barriers.
830
831 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
832
833         * metadata-verify.c: Add pe nt header verification.
834         
835 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
836
837         * gc.c: Fix a few warnings when using SGEN.
838
839 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
840
841         * metadata-verify.c: Add pe optional header verification.
842
843 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
844
845         * sgen-gc.c: Add support for user defined marker functions, used by
846         MonoGHashTable to avoid registering a GC root for every hash node.
847
848 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
849
850         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
851         non-pinned roots into separate hashes to avoid having to traverse them
852         in functions which are only interested in one kind.
853
854 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
855
856         * metadata-verify.c: Add pe header machine field verification.
857         
858 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
859
860         * metadata-verify.c: Add pe header size verification.
861
862 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
863
864         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
865         using the GC, they don't contain references.
866
867         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
868
869 2009-01-13  Geoff Norton  <gnorton@novell.com>
870
871         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
872         AppDomains created on the native side can be cleaned up on the native side.
873
874 2009-01-13  Geoff Norton  <gnorton@novell.com>
875
876         * appdomain.c: Ensure that we call mono_context_init for the embedding api
877         as well as the managed api.
878
879 2009-01-13  Geoff Norton  <gnorton@novell.com>
880
881         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
882         with a MonoAppDomain initialized against it.
883
884 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
885
886         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
887         
888         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
889
890         * marshal.c: Avoid setting the exception clauses after a method has been entered 
891         into the wrapper caches. Fixes #465700.
892
893         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
894         method builder.
895         (mono_mb_create_method): Set the clauses from the method builder.
896
897 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
898
899         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
900         Patch from Makoto Kishimoto.
901
902 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
903
904         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
905         encoding them as ROOT_DESC_COMPLEX.
906         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
907
908 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
909
910         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
911         no longer point to the nursery.
912
913         * sgen-gc.c: Add a few comments/FIXMEs.
914         
915         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
916
917         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
918         initialization of the various _method variables thread safe. Fixes
919         #465377.
920
921 2009-01-12  Mark Probst  <mark.probst@gmail.com>
922
923         * domain.c, domain-internals.h: Remove the shared_generics_hash
924         and its lookup functions.
925
926 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
927
928         * socket-io.c:  Fixing the MSVC build. 
929
930         Code is contributed under MIT/X11 license.
931
932 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
933
934         * metadata-verify.c: Add pe header watermark verification.
935
936 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
937
938         * metadata-verify.c: Add lfanew verification.
939
940 2009-01-12  Jb Evain  <jbevain@novell.com>
941
942         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
943         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
944
945 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
946
947         * socket-io.c: Fix the build.
948
949         * environment.c: Fix an #ifdef.
950
951 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
952
953         * threadpool.c (async_invoke_thread): Handle the wait function returning
954         WAIT_IO_COMPLETION as well.
955         (async_invoke_io_thread): Ditto.
956
957 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
958
959         * threads.c: Fixing the Windows build.
960
961         Code is contributed under MIT/X11 license.
962
963 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
964  
965         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
966         interrupt a wait.
967         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
968         the thread to wait again.
969
970 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
971
972         * metadata-verify.c: Initial skeleton of the metadata verifier.
973
974         * pedump.c: Add support for the metadata verifier.
975
976         * verify-internal.h: Export the whole assembly metadata verifier function.
977
978 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
979
980         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
981
982 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
983
984         * Makefile.am: Upgrade dtrace-prelink.sh location.
985
986 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
987
988         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
989         well. Otherwise the shutdown deadlock that happens on unix will can happen
990         as well.
991         If the main thread code finishes too fast it's possible that the finalizer
992         thread won't have executed yet, won't record itself as the finalizer thread
993         and the shutdown sequence will wait on it forever.
994
995 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
996
997         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
998         with MSVC.
999
1000 2009-01-08  Miguel de Icaza  <miguel@novell.com>
1001
1002         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
1003         Robert Jordan for pointing this out.
1004
1005 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
1006
1007         * icall.c
1008         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
1009         ves_icall_System_IO_DriveInfo_GetDriveType.
1010
1011 2009-01-07  Miguel de Icaza  <miguel@novell.com>
1012
1013         * icall.c: Wrap calls to mono_strtod in CriticalSection
1014         invocations when using eglib, to work around #464316.
1015
1016 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
1017
1018         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
1019         return value of GetCurrentDirectory to never access unitialized memory.
1020
1021 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
1022
1023         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
1024         return value of GetCurrentDirectory and expand the buffer if needed.
1025
1026         Fixes #459094.
1027
1028 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
1029
1030         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
1031           Adding a call to mono_init_com_types.
1032
1033         Code is contributed under MIT/X11 license.
1034
1035 2009-01-07  Geoff Norton  <gnorton@novell.com>
1036
1037         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
1038         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
1039         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
1040         be the value of the ip buffer.
1041
1042 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
1043
1044         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
1045         interfaces_packed here.
1046
1047         Fixes part of #463294.
1048
1049 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
1050
1051         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
1052
1053         Fixes part of #463294.
1054
1055 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
1056
1057         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
1058         is a boxed complex as well.
1059
1060         Fixes part of #463294.
1061
1062 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
1063
1064         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
1065         control if a methodspec should be created for the generic method definition from external assemblies.
1066         Caching of methodspec is done using the handleref hash table.
1067
1068         Fixes #462592.
1069
1070 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
1071
1072         * loader.c (find_method): When searching the interfaces of a class
1073         check the transitive closure of implemented interfaces.
1074
1075         Fixes #463303.
1076
1077 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
1078
1079         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
1080         
1081 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
1082
1083         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
1084         interfaces calculation to fill_valuetype_array_derived_types.
1085
1086         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
1087         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
1088         for example.
1089
1090         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
1091         interfaces for valuetypes if needed.    
1092
1093         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
1094         for their basetype as well. Types are array expanded if rank is > 0.
1095
1096         Fixes #400716.
1097
1098 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
1099
1100         * socket-io.h : Changing the signature of
1101           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
1102           the blocking state.
1103
1104         * icall-def.h :  Changing the signature of
1105           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
1106
1107         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
1108           For Windows only.  Avoid blocking when calling accept by
1109           querying for a connection via select.  The loop also queries
1110           the thread state every 1000 micro seconds for the thread
1111           stop state.  This will avoid the process hanging on shutdown
1112           when using a TcpChannel that is never connected to.
1113
1114         Code is contributed under MIT/X11 license.
1115
1116 2008-12-30  Marek Safar  <marek.safar@gmail.com>
1117
1118         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
1119
1120 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
1121
1122         * class.c (get_implicit_generic_array_interfaces): Extract common
1123         code to a helper function making it a lot easier on the eyes.
1124
1125 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
1126
1127         * class.c (get_implicit_generic_array_interfaces): If the internal
1128         enumerator is an interface inflate System.Object instead of itself.
1129
1130         Fixes #461261.
1131
1132 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
1133
1134         * object.c (mono_runtime_invoke_array): Don't assert with
1135         byref nullable types.
1136
1137         * marshal.c (mono_marshal_get_runtime_invoke): To handle
1138         byref nullables we unbox the object and store it on the
1139         stack. 
1140         We can't use the boxed object since it is the T of Nullable<T>
1141         and the boxed representation of a nullable it's underlying type
1142         or null.
1143         We could cheat and create a boxed nullable and use the same
1144         machinery of other byref VTs but this feels like a hack and
1145         using the stack has the bonus of reducing heap pressure.
1146
1147         Fixes #461941.
1148
1149 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
1150
1151         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
1152         return value.
1153
1154         Fixes #461867.
1155
1156 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
1157
1158         * icall-def.h : Adding an internal call definition for 
1159           System.Environment.internalBroadcastSettingChange.
1160
1161         * icall.c : Adding a Windows only implementation to broadcast a 
1162           WM_SETTINGCHANGE when an environment variable has changed.
1163
1164         Code is contributed under MIT/X11 license.
1165
1166 2008-12-19  Mark Probst  <mark.probst@gmail.com>
1167
1168         * class.c, class-internals.h: Made
1169         mono_class_has_parent_and_ignore_generics() non-static.
1170
1171 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
1172
1173         * image.c: deal with the mmap failing when loading an image.
1174
1175 2008-12-17  Geoff Norton  <gnorton@novell.com>
1176
1177         * threadpool.c: Ensure that the io_queue_lock is initialized
1178         in all circumstances, as we always attempt to cleanup against it.
1179
1180 2008-12-17  Miguel de Icaza  <miguel@novell.com>
1181
1182         * icall.c (ves_icall_System_Environment_get_Platform): For
1183         compatibility reasons for existing client code we will keep
1184         returning 4 for a while.   
1185
1186         For how long will depend on the documentation being updated, and
1187         for us to give client code a chance to be updated.
1188
1189         This reverts the original decison on #433108 since we did not
1190         catch roughly 33 instances of the broken code in our own source
1191         code base, we did not catch failures on the buildbots, and QA did
1192         not bring this as a problem.
1193
1194         Only today I found some customer's code breaking due to our own
1195         class libraries not being fully updated and tracked it down to
1196         this change.  I am reverting it because if we could not even get
1197         our story straight in our own code base, how can we hope that our
1198         end user code be fixed?
1199
1200         As of this morning, our Wiki page that documents how to detect
1201         Unix had not been fixed.    
1202
1203 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
1204
1205         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
1206
1207         * class.c (mono_class_get_fields): Handle loading errors.
1208
1209 2008-12-12 Mark Mason <mmason@upwardaccess.com>
1210
1211         * 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.
1212         
1213 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
1214
1215         * mono-perfcounters.c: avoid warning.
1216
1217 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
1218
1219         * reflection.c (ensure_runtime_vtable): Work on generic instances and
1220         make sure all interfaces have MonoClass::interface_id set.
1221
1222         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
1223         method table is property set.
1224
1225 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
1226
1227         * class.c: New function mono_class_setup_interface_id that setup
1228         MonoClass::interface_id if needed.
1229
1230         * class-internals.h: Export new function.
1231
1232 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
1233
1234         * class.c: Add code to sanity check the vtable after setup_vtable_general
1235         has done it's work.
1236
1237 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1238
1239         * icall.c: make Assembly.GetExecutingAssembly work properly when
1240         reflection is used to invoke the method.
1241         Bug #321781 fixed.
1242
1243 2008-12-11  Mark Probst  <mark.probst@gmail.com>
1244
1245         * metadata/generic-sharing.c: Look for constraints in all type
1246         arguments, not just the first one.
1247
1248 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
1249
1250         * appdomain.c: return the correct CodeBase for an Assembly instance
1251         that was loaded from the shadow-copy directories.
1252         Bug #458190 fixed.
1253
1254 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
1255
1256         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
1257
1258         * sgen-gc.c (check_object): New debugging helper function.
1259
1260         * object.c: Fix calls to mono_value_copy_array ().
1261
1262 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
1263
1264         * class.c (mono_class_setup_fields): If working on an inflated class
1265         first check if the generic definition did init with success.
1266
1267         Fixes #445361.
1268
1269 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
1270
1271         pedump.c (main): Fix a warning.
1272
1273 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
1274
1275         * object-internals.h : Adding a definition for 
1276           MonoReflectionComVisibleAttribute.
1277
1278         * marshal.c (cominterop_com_visible) :  Method added to check the 
1279           ComVisible attribute of a class.
1280
1281         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
1282           cominterop_raise_hr_exception added to consolidate common code 
1283           to raise hr exceptions.
1284
1285         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
1286           if a managed class should support IDispatch.
1287
1288         * marshal.c 
1289           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
1290           Added additional checks for managed object when getting 
1291           an IDispatch interface.
1292
1293         Code is contributed under MIT/X11 license.
1294
1295 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
1296
1297         pedump.c (main): Handle mono_get_method () returning NULL. 
1298
1299 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
1300
1301         * marshal.h: Fix a warning.
1302
1303 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
1304
1305         * marshal.c : Adding cominterop_release_all_rcws to release all
1306           runtime callable wrappers held by the runtime.
1307
1308         * marshal.h : Adding declaration for cominterop_release_all_rcws.
1309           
1310         Code is contributed under MIT/X11 license.
1311
1312 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
1313
1314         * metadata.c (mono_image_alloc_lock): New helper function.
1315         (mono_image_alloc0_lock): Ditto.
1316
1317         * metadata.c: Use the alloc_lock () helper functions for allocating
1318         memory from the image mempool.
1319
1320 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
1321
1322         * class.c (mono_class_from_generic_parameter): Document it's
1323         locking behavior. Fix double checked locking here, we stored in
1324         param->pklass a partially initialized MonoClass and no membar was used.
1325
1326 2008-12-05  Marek Habersack  <mhabersack@novell.com>
1327
1328         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
1329         (3) functions are present in the C library use them to do the
1330         job. If they are absent, make sure that the sum of int_part and
1331         dec_part is rounded before returning. This is necessary due to the
1332         division of dec_part by the power of 10 before the final addition
1333         is performed - if the result is not rounded in some cases it will
1334         yield invalid results.
1335
1336 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
1337
1338         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
1339         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
1340         instruction instead of a pointer constant.
1341
1342 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
1343
1344         * loader.c (mono_method_get_header): Do most of the work outside the
1345         loader lock, to avoid assembly load hook deadlocks.
1346
1347         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
1348         (mono_metadata_parse_type_full): Ditto.
1349
1350 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
1351
1352         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
1353         Make the stack depth fixed. Ensure proper argument passing to the backtrace
1354         funtions. Finally, use a lock to produce well ordered output.
1355
1356         The lock looks silly, as all calls to the corlib mempool should be guarded
1357         with the loader lock, but for some reason this fact doesn't help. 
1358
1359         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
1360
1361 2008-12-02  Mark Probst  <mark.probst@gmail.com>
1362
1363         * socket-io.c: 64 bit big-endian fixes.
1364
1365 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
1366
1367         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
1368         targets that require strict compatibility between the types.
1369
1370         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
1371         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
1372         Kill the strict argument and create a new one valuetype_must_be_boxed.
1373
1374         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
1375         state that all valuetypes must be boxed.
1376
1377         Fixes #448560.
1378
1379 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
1380
1381         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
1382         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
1383
1384         Contributed under MIT/X11 license.
1385
1386 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
1387
1388         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
1389         the inflate_generic_type machinery should handle it.
1390
1391         This avoids a crash when the field's flags is zero and it's type is
1392         a primitive.
1393         What happens is that mono_metadata_parse_type_full will see that opt_attrs
1394         is zero and will return one of the cached built-in primitive types. Since
1395         those types live in read-only memory, the code that copies it crashes.  
1396
1397 2008-11-28  Mark Probst  <mark.probst@gmail.com>
1398
1399         * object.c: Don't put function descriptors into generalized IMT
1400         thunks.
1401
1402 2008-11-28  Mark Probst  <mark.probst@gmail.com>
1403
1404         * class.c: Enable generic code sharing on PPC64.
1405
1406 2008-11-27  Mark Probst  <mark.probst@gmail.com>
1407
1408         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
1409         from mini/mini.c.
1410
1411         * generic-sharing.c: Allocate the method template slists from the
1412         image mempool so it doesn't leak.
1413
1414 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
1415
1416         * class.c (generic_array_methods): Release the linked list.
1417
1418 2008-11-27  Mark Probst  <mark.probst@gmail.com>
1419
1420         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
1421         invocation to g_utf16_to_utf8().
1422
1423 2008-11-26  Mark Probst  <mark.probst@gmail.com>
1424
1425         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
1426         arguments on big endian archs.
1427
1428 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1429
1430         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
1431         the type name (test added in corlib).
1432
1433 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1434
1435         * pedump.c: initialize perf. counters. Fixes a segv.
1436
1437 2008-11-25  Martin Baulig  <martin@ximian.com>
1438
1439         * mono-debug-debugger.c
1440         (mono_debugger_runtime_invoke): Return the exception object if an
1441         exception was thrown.  Visual Studio displays the exception object
1442         in the locals window.
1443
1444 2008-11-24  Mark Probst  <mark.probst@gmail.com>
1445
1446         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
1447         ftnptr.
1448
1449 2008-11-24  Mark Probst  <mark.probst@gmail.com>
1450
1451         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
1452         MONO_TYPE_U are sizeof (gpointer), too.
1453
1454 2008-11-24  Mark Probst  <mark.probst@gmail.com>
1455
1456         * marshal.c (mono_type_native_stack_size): Fixed size and
1457         alignment for reference types.
1458
1459 2008-11-23  Mark Probst  <mark.probst@gmail.com>
1460
1461         * class.c (mono_class_generic_sharing_enabled): Disable generic
1462         code sharing for PPC64.
1463
1464 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
1465
1466         * icall.c (mono_method_get_equivalent_method): Make sure
1467         method->klass->methods is inited before looping over it.
1468
1469 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1470
1471         * object.c: when calling ExecuteAssembly in a newly created domain,
1472         the configuration file and application base are already set up.
1473         Bug #446353 take 2 fixed.
1474
1475 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
1476
1477         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
1478         Fixes #444715. Fix a warning.
1479
1480 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
1481
1482         * appdomain.c: write the full path of the assembly to the .ini file
1483         created when "shadow-copying"
1484         Bug #446353 fixed.
1485
1486 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
1487
1488         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
1489         if signature==FALSE.
1490
1491 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
1492
1493         * marshal.h : Fix the cygwin build.
1494            marshal.c:12442: undefined reference to `_IID_IMarshal'
1495           
1496         Code is contributed under MIT/X11 license.
1497
1498 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
1499
1500         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
1501           free threaded marshaler when QueryInterface is called on a COM callable
1502           wrapper requesting the IMarshal interface.
1503           
1504         Code is contributed under MIT/X11 license.
1505
1506 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
1507
1508         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
1509
1510         * reflection.c (mono_type_get_object): Special case the very common
1511         void type.
1512
1513         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
1514         hold typeof(void).
1515
1516 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
1517
1518         * process.h : Adding method declaration for
1519           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
1520           
1521         * process.c : Adding implementation for
1522           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
1523           
1524         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
1525           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
1526
1527         Code is contributed under MIT/X11 license.
1528
1529 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
1530
1531         * appdomain.c (unload_thread_main): Clean up threadpool by
1532         calling mono_thread_pool_remove_domain_jobs.
1533
1534         * domain-internals.h (struct _MonoDomain): Add new fields to
1535         help coordinate the cleanup of the threadpool.
1536
1537         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
1538         that cleans up the threadpool of all jobs associated with an appdomain.
1539         It does that by cleaning up the queues and making sure all active
1540         threads are accounted.
1541
1542         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
1543         unloaded or in the process of. Take this is such way that there is
1544         no race condition between another thread starting the unload and the
1545         current thread acknowledging it.
1546
1547         * threadpool.c (async_invoke_thread): Same.
1548
1549         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
1550         firing the new thread.
1551
1552         * threadpool.c (start_tpthread): Same.
1553
1554         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
1555
1556         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
1557
1558 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
1559
1560         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
1561         Add support for DuplicateHandle.
1562         
1563         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
1564         Add support for DuplicateHandle.
1565         
1566         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
1567         Add support for DuplicateHandle.
1568
1569         Code is contributed under MIT/X11 license.
1570
1571 2008-11-06  Mark Probst  <mark.probst@gmail.com>
1572
1573         * class-internals.h: Make min_align into a whole byte.
1574
1575         * class.c: Set min_align for SIMD types to 16.
1576
1577 2008-11-05  Geoff Norton  <gnorton@novell.com>
1578
1579         * attach.c: Default the attacher to enabled for all cases including
1580         embedded.
1581
1582 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
1583
1584         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
1585         change r117650.
1586
1587 2008-11-04  Mark Probst  <mark.probst@gmail.com>
1588
1589         * monitor.c, monitor.h: New function for querying offsets of
1590         members of MonoThreadsSync.
1591
1592 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
1593
1594         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
1595         to speed up this function and to avoid the boundless memory growth caused by
1596         the signature_dup () calls.
1597
1598 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
1599
1600         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
1601         wrapper.
1602
1603         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
1604         by 1 bit.
1605
1606         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
1607
1608 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
1609
1610         * appdomain.c:
1611         * domain-internals.h: made mono_set_private_bin_path_from_config()
1612         "internal".
1613         * object.c: call the above function after setting the configuration
1614         file path for the root domain.
1615         Fixes bug #314478.
1616
1617 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
1618
1619         * assembly.c: when the assembly is loaded from an absolute path, end
1620         basedir with a directory separator.
1621         Bug #440781 fixed.
1622
1623 2008-10-30  Mark Probst  <mark.probst@gmail.com>
1624
1625         * monitor.c (mono_monitor_get_fast_enter_method): If
1626         CompareExchange is not available, don't create the fastpath
1627         instead of asserting.  (The method is missing in the 1.1 profile.)
1628
1629 2008-10-30  Mark Probst  <mark.probst@gmail.com>
1630
1631         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
1632
1633         * monitor.c, monitor.h: Code for generating Monitor.Enter and
1634         Monitor.Exit IL fastpaths.
1635
1636 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
1637
1638         * class.c (mono_class_create_from_typedef): Added Vector2ul.
1639
1640 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
1641
1642         * class.c (mono_class_create_from_typedef): Added Vector2l.
1643
1644 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
1645
1646         * class.c (mono_class_create_from_typedef): Added Vector2d.
1647
1648 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
1649
1650         * appdomain.c: translate \ into / for cache_path.
1651         * domain-internals.h: new mono_is_shadow_copy_enabled().
1652         * icall.c: (fill_reflection_assembly_name) do the same path
1653         manipulations that get_code_base does.
1654         (get_code_base) use mono_is_shadow_copy_enabled.
1655
1656 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
1657
1658         * appdomain.c: shadow-copied assemblies go to CachePath +
1659         ApplicationName when both are set. DynamicBase has nothing to do with
1660         shadow copies.
1661         Bug #406877 fixed.
1662
1663 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
1664
1665         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
1666         STANDALONESIG table.
1667
1668         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
1669         standalone signatures.
1670
1671         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
1672         comparison code: instead of comparing the signatures using a custom
1673         equals function, transform them to a common signature and compare that. This
1674         works better with AOT.
1675
1676 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
1677
1678         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
1679
1680         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
1681         call for generic instances.
1682         (mono_class_setup_properties): Call setup_properties () before accessing
1683         gklass->properties.
1684
1685         * class.c (mono_class_get_virtual_methods): New helper function to iterate
1686         over the virtual methods of a class using metadata if possible, avoiding the
1687         creation of MonoMethod's for non-virtual methods.
1688         
1689         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
1690         get_virtual_methods () to iterate over the virtual methods of classes.
1691
1692 2008-10-25  Martin Baulig  <martin@ximian.com>
1693
1694         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
1695
1696 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
1697
1698         * class.c (mono_class_create_from_typedef): Added Vector4i.
1699
1700 2008-10-24  Mark Probst  <mark.probst@gmail.com>
1701
1702         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
1703         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
1704         special-casing applies to eliminate the call completely.
1705
1706 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
1707
1708         * class.c (mono_class_create_from_typedef): Added Vector8s.
1709
1710 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
1711
1712         * class.c (mono_class_create_from_typedef): Added Vector16sb.
1713
1714 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
1715
1716         * icall.c: get rid of annoying warning.
1717
1718 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
1719
1720         * threadpool.c: in 1.x, if you change the background status of the
1721         threadpool thread, it's not reset.
1722         Remove unnecessary calls to SetState.
1723
1724 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1725
1726         * threadpool.c: asynchronously create a set of idle threads upon first
1727         use of the threadpool. SetMinThreads will now start the appropriate
1728         number of idle threads if they are not already running. The default is
1729         1 threadpool thread per CPU. Increased the maximum number of threads
1730         per CPU to 10.
1731
1732 2008-10-22  Martin Baulig  <martin@ximian.com>
1733
1734         Revert r116521 from Zoltan, it breaks the debugger:
1735
1736         * class.c (mono_class_get_virtual_methods): New helper function to iterate
1737         over the virtual methods of a class using metadata if possible, avoiding the
1738         creation of MonoMethod's for non-virtual methods.
1739         
1740         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
1741         get_virtual_methods () to iterate over the virtual methods of classes.
1742
1743 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1744
1745         * threads.c: when creating a threadpool thread, set its state to
1746         'background'.
1747         * threadpool.c: reset the background state of a threadpool thread
1748         after finishing each work item
1749         Bug #437888 fixed.
1750
1751 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
1752
1753         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
1754         
1755         * class.c (mono_class_setup_vtable_general): Add an optimized version for
1756         generic instances which works by inflating the methods in the container
1757         class's vtable.
1758
1759         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
1760         variant which doesn't make a copy if no inflation was done.
1761         (mono_class_setup_fields): Use it.
1762
1763         * metadata.c (mono_metadata_get_shared_type): New helper function to
1764         return a shared instance of a given MonoType.
1765
1766         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
1767         a copy of most non-generic types.
1768
1769 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
1770
1771         * threadpool.c: remove one more GetSystemInfo () call.
1772
1773 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
1774
1775         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
1776         use the code in mono-proclib.h to get processor information.
1777
1778 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
1779
1780         * appdomain.c: fixed the logic that determines whether assemblies in a
1781         directory are "shadow-copied" or not. Bug #433483 fixed.
1782
1783 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
1784
1785         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
1786         warning.
1787
1788 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
1789
1790         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
1791         returning a vtype.
1792
1793         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
1794         reflection.c: Use mono_field_get_name () for accessing a field's name.
1795
1796         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
1797         class.c
1798
1799         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
1800         field.
1801
1802         * loader.c (find_method_in_class): Reenable the metadata optimization by
1803         not using it for generic instances.
1804
1805         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
1806         data/def_type fields from MonoClassField into a separate structure.
1807         (struct MonoClassField): Remove data/def_type fields.
1808         (struct _MonoClass): Add a 'field_def_values' array to store the default
1809         values/RVA for fields.
1810
1811         * class.c reflection.c: Update after the changes.
1812         
1813         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
1814         for accessing field->data.
1815
1816         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
1817
1818         * loader.c (find_method_in_class): Revert the last change for now as
1819         it breaks Mono.C5 unit tests.
1820
1821         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
1822         'field_generic_types' and 'field_objects' which contain the information
1823         previously stored in MonoInflatedField.
1824         (MonoInflatedField): Delete.
1825         (struct _MonoClassField): Delete 'generic_info' field.
1826
1827         * reflection.c: Store the information which was previously in 
1828         field->generic_info in MonoDynamicGenericClass instead.
1829
1830         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
1831         MonoClassField changes.
1832
1833 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
1834
1835         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
1836         store the value inside the data array of the MonoMethodWrapper.
1837         This saves memory, is faster and fixes the lifetime issues (methods
1838         were never removed from the hash previously). May also fix bug#436996.
1839
1840 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
1841
1842         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
1843         generic instances, compute the type from the generic definition instead of
1844         looking in field->generic_info.
1845
1846         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
1847         for inflated fields, the only user was get_fieldref_token () which no
1848         longer needs it.
1849
1850         * class.c (mono_class_init): Revert the last change as it seems to cause
1851         crashes.
1852
1853         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
1854         bytes on 64 bit platforms.
1855
1856         * object.c (mono_class_create_runtime_vtable): Fix a warning.
1857         
1858         * object.c (mono_class_create_runtime_vtable): Don't initalize
1859         field->data/field->def_type here, it is done lazily by 
1860         mono_class_get_field_default_value ().
1861
1862         * icall.c (ves_icall_get_enum_info): Call 
1863         mono_class_get_field_default_value () instead of directly accessing
1864         field->data and field->def_type.
1865
1866         * object.c (get_default_field_value): Ditto.
1867
1868         * class.c (mono_field_get_data): Ditto.
1869         
1870         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
1871         call for generic instances.
1872
1873         * loader.c (find_method_in_class): If klass != from_class, then inflate
1874         the method with the context of from_class, since the caller assumes this.
1875
1876 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
1877
1878         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
1879         for accessing method->slot.
1880
1881 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
1882
1883         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
1884
1885 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
1886
1887         * class.c (mono_method_get_vtable_index): Use
1888         mono_method_get_vtable_slot () for accessing method->slot.
1889
1890         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
1891         accessing klass->methods.
1892
1893         * class.c (mono_method_get_vtable_slot): New helper function.
1894         (mono_class_get_vtable_entry): Ditto.
1895         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
1896         accessing method->slot.
1897
1898         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
1899         method to get_inflated_method ().
1900
1901         * class.c (mono_class_get_inflated_method): New helper method to obtain
1902         a method of an inflated class without calling setup_methods ().
1903         (mono_class_get_cctor): Use get_inflated_method.
1904
1905         * generic-sharing.c (mono_class_get_method_generic): Ditto.
1906         
1907         * marshal.c image.c: Lazily create all the marshal caches.
1908
1909         * image.c (mono_image_init): Move initialization of runtime_invoke
1910         caches to marshal.c.
1911
1912         * marshal.c (get_cache): New helper function to lazily initialize a 
1913         wrapper cache.
1914         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
1915
1916         * debug-helpers.c (mono_method_full_name): Include generic arguments.
1917
1918 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
1919
1920         * loader.c: fixed check for interface type.
1921
1922 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
1923
1924         * appdomain.c: check for NULL setup before it's referenced.
1925
1926 p
1927 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
1928
1929         * class.c: remove the unused old vtable setup code.
1930
1931 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
1932
1933         * class.c: don't depend on interface order in
1934         setup_interface_offsets (bug #435777).
1935         * reflection.c: sort the InterfaceImpl table (patch from
1936         Jb Evain  <jbevain@novell.com>).
1937
1938 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
1939
1940         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
1941         the low level assemblies lock.
1942
1943 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
1944
1945         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
1946         object.c, reflection.c, socket-io.c, threads.c: introduced
1947         mono_framework_version () to return the major framewrok version,
1948         changed the code that was using more complex patterns to use it.
1949         Return the correct value for PlatformID for OSX.
1950
1951 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
1952
1953         * icall-def.h, process.h, process.c: added an icall to get info about
1954         processes using mono-proclib.
1955
1956 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
1957
1958         * mono-perfcounters.c: use the mono-proclib functions to
1959         access process information.
1960
1961 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
1962
1963         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
1964         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
1965         reflection.c: remove rawbuffer usage: mmap support is more sanely
1966         provided by utils/mono-mmap.
1967
1968 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
1969
1970         * gc.c: use posix semaphores when possible so that
1971         mono_gc_finalize_notify() is signal safe.
1972
1973 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
1974
1975         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
1976         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
1977         be #ifdef-ed out, the linker will remove the rest.
1978
1979         * marshal.c: Implement DISABLE_COM.
1980
1981         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
1982
1983 2008-10-11  Miguel de Icaza  <miguel@novell.com>
1984
1985         * locales.c (string_invariant_compare_char): Optimization: do not
1986         call g_unichar_type unless we actually need the information.
1987
1988 2008-10-10  Mark Probst  <mark.probst@gmail.com>
1989
1990         * object.c, class-internals.h: Also create remoting trampolines
1991         for generic methods.  Pass the domain to the remoting trampoline
1992         creation function, too.
1993
1994 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
1995
1996         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
1997
1998 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
1999
2000         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
2001         Vector4ui.
2002
2003 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
2004
2005         * assembly.c:
2006         * locales.c: remove the use of g_strdown. Fixes bug #322313.
2007
2008 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
2009
2010         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
2011         for the least possible amount of time (extending the fix in r113458).
2012
2013 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
2014
2015         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
2016
2017 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
2018
2019         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
2020         as possible simd intrinsic types.
2021         Optimized the test to check for the common prefix first.
2022
2023 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
2024
2025         * class.c: back out part of a broken optimization committed on
2026         May 23th (bug #433908).
2027
2028 2008-10-09  Mark Probst  <mark.probst@gmail.com>
2029
2030         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
2031         Win32.  Should fix #432388 for most cases until we have the new
2032         profiler on Win32.
2033
2034 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
2035
2036         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
2037         instead of using inst->id so the hash is stable for AOT.
2038
2039 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
2040
2041         * appdomain.c:
2042         * icall.c: create a .ini file for shadow-copied assemblies that
2043         contains the location of the original assembly. Use this to return the
2044         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
2045         Also fix the number of '/' for windows when returning the CodeBase.
2046         Fixes bug #430920.
2047
2048 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
2049
2050         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
2051
2052         Code is contributed under MIT/X11 license.
2053
2054 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
2055
2056         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
2057           if if the class vtable needs initialized.
2058
2059         Code is contributed under MIT/X11 license.
2060
2061 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
2062
2063         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
2064           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
2065           STRING->BSTR, and CLASS->INTERFACE.
2066
2067         Code is contributed under MIT/X11 license.
2068
2069 2008-10-07  Marek Habersack  <mhabersack@novell.com>
2070
2071         * sysmath.h: changed the declaration of the
2072         ves_icall_System_Math_Round2 icall by adding an extra
2073         away_from_zero parameter.
2074
2075         * sysmath.c (ves_icall_System_Math_Round2): added support for
2076         away from zero rounding. The icall now takes an extra boolean
2077         parameter to signal that away from zero operation is requested.
2078
2079 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
2080
2081         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
2082         the delegate klass so it can work with full-aot.
2083         (mono_marshal_get_delegate_end_invoke): Ditto.
2084         (mono_marshal_get_delegate_invoke): Ditto.
2085
2086 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
2087
2088         * gc.c, attach.h, attach.c: remove a bad pattern:
2089         add_finalizer_callback () is not implemented correctly, it can't
2090         without adding more overhead to the finalizer loop and it's not
2091         even needed, since we know exactly what we need to call, so there is
2092         no need to do so through an expensive function pointer.
2093
2094 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
2095
2096         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
2097         for the no-gc case.
2098         * attach.c (mono_attach_init): Remove the #ifdef.
2099
2100 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
2101
2102         * attach.c (mono_attach_init): Don't use
2103         mono_gc_add_finalizer_thread_callback when compiling without GC.
2104         Fixes #432306.
2105         
2106         Code is contributed under MIT/X11 license.
2107
2108 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
2109
2110         * class.c (mono_class_create_from_typedef): Remove the 
2111         #ifndef DISABLE_SIMD stuff.
2112
2113 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
2114
2115         * class-internals.h (MonoClass): Added simd_type bit field.
2116
2117         * class.c (mono_class_create_from_typedef): Check if type is a simd
2118         intrinsic.
2119
2120 2008-10-03  Mark Probst  <mark.probst@gmail.com>
2121
2122         * object.c (mono_method_add_generic_virtual_invocation): Only add
2123         instantiations to the thunk whose count is at least as large as
2124         the threshold.
2125
2126 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
2127
2128         * icall.c: changed the Type of the exception thrown when trying to
2129         invoke a constructor on an abstract class. Part of the fix for bug
2130         #324185.
2131
2132 2008-10-02  Mark Probst  <mark.probst@gmail.com>
2133
2134         * class.c, class-internals.h (mono_method_get_vtable_index): New
2135         function which returns the index into the vtable and properly
2136         handles inflated virtual generic methods.
2137
2138 2008-10-01  Mark Probst  <mark.probst@gmail.com>
2139
2140         * object.c, domain.c, object-internals.h, domain-internals.h:
2141         Generalize IMT thunk machinery to also handle thunks for virtual
2142         generic method invokes.  When a virtual generic method is invoked
2143         more than a number of times we insert it into the thunk so that it
2144         can be called without lookup in unmanaged code.
2145
2146         * generic-sharing.c, class-internals.h: Fetching a
2147         MonoGenericInst* for a method from an (M)RGCTX.
2148
2149 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
2150
2151         * marshal.c (emit_marshal_string): Applied a variant of a patch by
2152         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
2153         marshalling. Fixes #431304.
2154
2155 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
2156
2157         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
2158           handle when ref is specified without In or Out.
2159
2160         Code is contributed under MIT/X11 license.
2161
2162 2008-09-30  Mark Probst  <mark.probst@gmail.com>
2163
2164         * loader.c (mono_get_method_constrained): Don't expand method with
2165         the class's context, because it's already a method of that class.
2166
2167 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
2168
2169         * attach.c : should be correct build fix.
2170
2171 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
2172
2173         * attach.c: Fix the previous change.
2174
2175 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
2176
2177         * attach.c : quick w32 build fix.
2178
2179 2008-09-27  Miguel de Icaza  <miguel@novell.com>
2180
2181         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
2182         crashes MonoDevelop: #430455.
2183
2184 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
2185
2186         * domain-internals.h (struct _MonoDomain): Move most fields used only by
2187         the JIT do MonoJitDomainInfo in ../mini/mini.h.
2188
2189         * domain.c: Remove initialization/cleanup of the removed fields.
2190
2191 2008-09-27  Mark Probst  <mark.probst@gmail.com>
2192
2193         * class.c (mono_class_generic_sharing_enabled): Enable generic
2194         code sharing for PPC.
2195
2196 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
2197
2198         * attach.c : Fixing the Windows builds.
2199
2200         Code is contributed under MIT/X11 license.
2201
2202 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
2203
2204         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
2205         the default generic sharing mode to 'all'.
2206
2207 2008-09-25  Mark Probst  <mark.probst@gmail.com>
2208
2209         * generic-sharing.c, class-internals.h: New function for checking
2210         whether a method needs a static RGCTX invoke wrapper.  A few
2211         funtions moved from mini/generic-sharing.c.
2212
2213         * icall.c: New function used.
2214
2215 2008-09-25  Mark Probst  <mark.probst@gmail.com>
2216
2217         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
2218         Static RGCTX invoke wrapping applies to value type methods, too.
2219
2220         * class.c (mono_class_setup_vtable_general): In generic-shared
2221         value types, wrap methods with a static RGCTX invoke wrapper.
2222
2223 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
2224
2225         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
2226         osx build.
2227
2228 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
2229
2230         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
2231         register a callback which is called when the finalizer thread is woken
2232         up.
2233         (finalizer_thread): Call the callback if it exists.
2234
2235         * attach.h attach.c: New files, implementing the attach mechanism.
2236
2237         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
2238         
2239         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
2240         by the previous change.
2241
2242 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
2243
2244         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
2245         loader.c, marshal.c, metadata-internals.h, metadata.c,
2246         method-builder.c, object.c, reflection.c: introduced specific functions
2247         to allocate from the domain and image mempools and cleaned up most of
2248         the code to use them (still missing a few in reflection.c).
2249         Keep the loader bytes counter updated.
2250
2251 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
2252
2253         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
2254         loader-related counters.
2255
2256 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
2257
2258         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
2259         added more MS-compatible counters.
2260
2261 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
2262
2263         * class.c (mono_class_setup_fields): Call setup_fields before accessing
2264         class->blittable. Fixes #428217.
2265
2266 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
2267
2268         * reflection.c (mono_image_get_field_on_inst_token): Call 
2269         field_encode_signature () since that handles custom modifiers too.
2270         Fixes #424663.
2271
2272 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
2273
2274         * reflection.c (add_custom_modifiers): New helper function to merge custom
2275         modifiers stored in objects to a MonoType.
2276         (fieldref_encode_signature): Encode custom modifiers.
2277         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
2278         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
2279
2280 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
2281
2282         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
2283         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
2284         64-bit IL only images because imports are not resolved for IL only images.
2285         Special thanks to Bill Holmes for finding this bug and testing the patch.
2286         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
2287
2288         Contributed under MIT/X11 license.
2289
2290 2008-09-19  Miguel de Icaza  <miguel@novell.com>
2291
2292         * mono-config.c (dllmap_start): Add support for the bits keyword
2293         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
2294
2295 2008-09-19  Mark Probst  <mark.probst@gmail.com>
2296
2297         * reflection.c (inflate_mono_method): When the class the method is
2298         to be inflated for is itself not inflated, just return the method.
2299
2300 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
2301
2302         * mono-perfcounters.c: use more user friendly process instance names.
2303
2304 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
2305
2306         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
2307           handle "[in] ref" and "[in][out] ref" cases.
2308
2309         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
2310           to mono_mb_create_method.  This was causing problems calling native to
2311           managed passing Variants by value.
2312
2313         Code is contributed under MIT/X11 license.
2314
2315 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
2316
2317         * class.c (can_access_internals): Call mono_assembly_load_friends ()
2318         before accessing the friend_assembly_names field.
2319
2320         * assembly.c (mono_assembly_load_friends): Make this callable multiple
2321         times.
2322         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
2323         called lazily when it is needed.
2324
2325         * metadata-internals.h (struct _MonoAssembly): Add 
2326         'friend_assembly_names_inited' flag.
2327
2328 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
2329
2330         * mono-perfcounters-def.h: fix the types of a few counters.
2331         * mono-perfcounters.c: implemented the instance names getter
2332         and a few bugfixes.
2333
2334 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
2335
2336         * culture-info-table.h : regenerated.
2337
2338 2008-09-17  Robert Jordan  <robertj@gmx.net>
2339
2340         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
2341         context bound objects. Fixes #415577.
2342
2343         Code is contributed under MIT/X11 license.
2344
2345 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
2346
2347         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
2348         implementation (bug #423582).
2349
2350 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
2351
2352         * object.c (mono_object_get_virtual_method): Handle the case method->slot
2353         is not set. Fixes #426309.
2354
2355 2008-09-16  Jb Evain  <jbevain@novell.com>
2356
2357         * class.c (mono_class_from_name): fix the exported type look up
2358         when the type is defined in a referenced assembly.
2359
2360 2008-09-16  Jb Evain  <jbevain@novell.com>
2361
2362         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
2363         increment the next index counter on each iteration to make that work
2364         for more than one type forwarder. Unmanaged part to fix #422929.
2365
2366 2008-09-15  Mark Probst  <mark.probst@gmail.com>
2367
2368         * object-internals.h: enum ComInterfaceType in
2369         MonoInterfaceTypeAttribute is guint32, not guint16.
2370
2371 2008-09-12  Mark Probst  <mark.probst@gmail.com>
2372
2373         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
2374         writing code.
2375
2376 2008-09-11  Mark Probst  <mark.probst@gmail.com>
2377
2378         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
2379         not gboolean.
2380
2381 2008-09-11  Mark Probst  <mark.probst@gmail.com>
2382
2383         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
2384         Endianness fixes for MonoSymbolFileOffsetTable.
2385
2386 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
2387
2388         * process.c (complete_path) : Removing quotes from the 
2389           input path.  The glib file routines do not handle file paths
2390           that have quotes around them.
2391
2392         Code is contributed under MIT/X11 license.
2393
2394 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
2395
2396         * socket-io.h : Adding a comment to provide locations where 
2397           changes to MonoSocketAsyncResult need to be synced.
2398
2399         Code is contributed under MIT/X11 license.
2400
2401 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
2402
2403         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
2404         parameters as well. Fixes #425001.
2405
2406 2008-09-08  Miguel de Icaza  <miguel@novell.com>
2407
2408         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
2409         windows build.
2410
2411 2008-09-07  Miguel de Icaza  <miguel@novell.com>
2412
2413         * console-io.c: Add support for tracking the window size if it
2414         changes.
2415
2416         The setup is very simple: the TtySetup function will now return a
2417         pointer to a location in memory that tracks the current console
2418         size.  The managed code checks its current value every time its
2419         queried against the last value set, and updates accordingly.
2420
2421         With this setup we can work with multiple consoles, and we do not
2422         require to poke into managed code from a signal handler.
2423
2424         Additionally, the environment for COLUMNS and LINES is now handled
2425         in unmanaged code.
2426
2427         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
2428
2429 2008-09-07  Mark Probst  <mark.probst@gmail.com>
2430
2431         * marshal.c (mono_type_native_stack_size): Treat
2432         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
2433
2434 2008-09-04  Jb Evain  <jbevain@novell.com>
2435
2436         * class.c (mono_class_is_assignable_from): fix assignability of nullables
2437         to nullables.
2438
2439 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
2440
2441         * verify.c (verify_type_compatibility_full): Revert change
2442         to allow converting a native int to unmanaged pointer be verifiable
2443         under non-strict mode.
2444         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
2445
2446         * verify.c: Added some TODOs.
2447
2448 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
2449
2450         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
2451           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
2452           Changed to use GlobalAlloc for the memory returned on Windows platforms.
2453
2454         Code is contributed under MIT/X11 license.
2455
2456 2008-09-02  Jb Evain  <jbevain@novell.com>
2457
2458         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
2459
2460 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
2461
2462         reflection.c (typebuilder_setup_fields): Handle classes with
2463         explicit size.
2464
2465 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
2466
2467         class.c (mono_class_setup_events): Add memory barrier due to
2468         double checked locking.
2469         
2470         class.c (mono_class_setup_properties): Same.
2471
2472 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
2473
2474         * class.c (mono_class_is_assignable_from): Fix the build.
2475         
2476         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
2477         before accessing klass->interface_bitmap. Fixes #421744.
2478
2479 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
2480
2481         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
2482         the runtime into no-exec mode, useful when running the AOT compiler.
2483
2484         * appdomain.c gc.c object.c: Avoid executing managed code when running
2485         in no-exec mode.
2486         
2487         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
2488
2489         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
2490         special case when the mono_assembly_loaded () returns NULL because the 
2491         search hook is not installed.
2492
2493 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
2494
2495         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
2496         crashes in bstr marshalling on linux.
2497
2498 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
2499
2500         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
2501         with more than one parameter.
2502
2503 2008-08-24  Miguel de Icaza  <miguel@novell.com>
2504
2505         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
2506         start/stop flow control as well when turning off ICANON (allows
2507         C-s and C-q to be read by Console.ReadKey).
2508
2509 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
2510
2511         * class.c (mono_class_init): Move the initialization of nested classes
2512         into mono_class_get_nested_types (). Fixes #418433.
2513
2514         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
2515         flag.
2516
2517         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
2518         iterating tough the nested classes of a class.
2519
2520 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
2521
2522         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
2523         on arm.
2524
2525 2008-08-22  Miguel de Icaza  <miguel@novell.com>
2526
2527         * console-io.c (sigcont_handler): Support signal chaining for
2528         SIGCONT.
2529
2530         (console_set_signal_handlers): Use best practices with sigaction,
2531         clear the structure before using it. 
2532
2533 2008-08-22  Robert Jordan  <robertj@gmx.net>
2534
2535         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
2536         Fix the Windows build.
2537
2538 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
2539
2540         * class.c (mono_class_generic_sharing_enabled): Make the default
2541         sharing mode 'corlib'.
2542
2543 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
2544
2545         * console-io.c (console_set_signal_handlers): Fix a warning.
2546
2547         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
2548         method normally, the JIT will take care of avoiding recursion.
2549
2550 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
2551
2552         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
2553
2554         Code is contributed under MIT/X11 license.
2555
2556 2008-08-20  Miguel de Icaza  <miguel@novell.com>
2557
2558         * console-io.c (sigcont_handler): We need to restore the entire
2559         termios state, not only the original settings, as things like echo
2560         can be controlled after this (Booish exposes this issue with its
2561         own ReadLine implementation).
2562
2563         Additionally, we need to set the terminal back into keypad_xmit
2564         mode.
2565         
2566         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
2567         string as a paramter as well.   Otherwise we get different
2568         keyboard sequences.
2569
2570 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
2571
2572         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
2573         delegates with byref out parameter passing. Fixes #351520.
2574
2575         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
2576         a generic context.
2577         (mono_type_get_desc): Add the type arguments for GENERICINST.
2578         (mono_method_full_name): Stringify the class name using mono_type_full_name
2579         so it picks up generic arguments.
2580
2581 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
2582
2583         * console-io.c: Removed debug output.
2584
2585 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
2586
2587         reflection.c (mono_reflection_create_runtime_class): Alloc
2588         the nested classes linked list using the dynamic image mempool.
2589         Fixes leak in corlib compilation.
2590
2591 2008-08-19  Miguel de Icaza  <miguel@novell.com>
2592
2593         * console-io.c: Fix incredibly annoying behavior on the console
2594         after resuming execution after control-z.   This affected every
2595         console application.
2596
2597 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
2598
2599         * mempool-internals.h: Header for mono private mempool functions. The first
2600         two function are for allocating glib linked lists using pools.
2601
2602         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
2603
2604         * Makefile.am: Added mempool-internals.h.
2605
2606 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
2607
2608         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
2609         (mono_domain_free): Ditto.
2610
2611         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
2612         be used by the JIT to store its domain-specific information, instead of putting
2613         it directly into MonoDomain.
2614
2615         * domain.c (mono_install_create_domain_hook): New helper function to install
2616         a hook which initializes domain->runtime_info.
2617
2618         * domain.c (mono_install_free_domain_hook): Ditto.
2619         
2620 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
2621
2622         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
2623         asserting if the ares parameter is null.
2624
2625         * mono-perfcounters.c: Fix warnings.
2626
2627         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
2628         is not needed, don't check for interruptions either.
2629         (mono_marshal_get_delegate_end_invoke): Ditto.
2630
2631 2008-08-15  Marek Habersack  <mhabersack@novell.com>
2632
2633         * mono-perfcounters.c (predef_readonly_counter): added support for
2634         reading the ASP.NET Requests Queued counter from another process.
2635
2636 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
2637
2638         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
2639         MonoImage to simplify the AOT code.
2640
2641 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
2642
2643         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
2644         marshalling. Fixes #416078.
2645
2646 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
2647         
2648         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
2649         it is set, looking up the icall address is deferred to the JIT, since 
2650         in embedded scenarios, the icall might not be registered in the runtime
2651         doing the AOT compilation. Backported from the 2.0 branch.
2652
2653 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
2654
2655         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
2656         Fixes #415621.
2657
2658 2008-08-05  Marek Habersack  <mhabersack@novell.com>
2659
2660         * Makefile.am: added support for cross-compilation.
2661
2662 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
2663
2664         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
2665
2666 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
2667
2668         * mono-perfcounters.c: jitted methods and jitted bytes counters.
2669
2670 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
2671
2672         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
2673         mono-perfcounters.c: performance counters implementation.
2674
2675 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
2676
2677         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
2678         to gpointer, letting the AOT code decide what to store in it.
2679
2680 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
2681
2682         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
2683           mono_class_setup_methods if the methods are not initialized.
2684
2685         Code is contributed under MIT/X11 license.
2686
2687 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
2688
2689         * verify.c: Remove some debug code I commited by accident.
2690
2691         * verify.c (mono_method_is_valid_in_context): Change the return value
2692         to make possible to distinguish between invalid and unverifiable.
2693
2694         * verify.c (verifier_load_method): Don't return NULL for unverifiable
2695         methods.
2696
2697 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
2698
2699         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
2700         constraints. Fixes regression in gtest-253.
2701
2702 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
2703
2704         * verify.c (mono_verifier_verify_class): Don't allow generic types
2705         with explicit layout.
2706
2707         * verify.c (mono_method_verify): Check locals and argument types.
2708
2709 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
2710
2711         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
2712         wait if the thread is in StopRequested state.
2713
2714         * class.c (mono_class_from_name): Refactor the module searching code into
2715         a separate function so it can be reused in the AOT case too.
2716
2717 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
2718
2719         * verify.c (mono_type_is_valid_in_context): Improve the error message.
2720         Check both the type and it's generic type definition for loader errors.
2721         
2722         * verify.c (mono_method_is_valid_in_context): Don't generate another
2723         error when a type errors occur, this leads to the wrong exception been
2724         thrown.
2725
2726 2008-07-28  Dick Porter  <dick@ximian.com>
2727
2728         * icall-def.h
2729         * process.c
2730         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
2731         New internal calls to duplicate and close a process handle.
2732
2733 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
2734
2735         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
2736
2737 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
2738
2739         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
2740
2741 2008-07-27  Robert Jordan  <robertj@gmx.net>
2742
2743         * class.c (mono_class_init): Don't compute class.has_finalize for
2744         valuetypes. Fixes #412477.
2745
2746 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
2747
2748         * verify.c: Implement constraint equivalence checking.
2749         This is required when a generic parameter is used as
2750         argument to a constrained one.
2751
2752         Fixes #410637.
2753
2754 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
2755
2756         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
2757
2758         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
2759
2760         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
2761         synch with managed object layout.
2762
2763 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
2764
2765         * verify.c (do_branch_op): Handle valuetypes and generic
2766         arguments properly.
2767
2768         * verify.c (do_cmp_op): Same.
2769
2770         Fixes #410383.
2771
2772 2008-07-24  Mark Probst  <mark.probst@gmail.com>
2773
2774         * generic-sharing.c: Fix memory leaks.
2775
2776         * class.c, class-internals.h: Make
2777         mono_class_inflate_generic_type_with_mempool() non-static.
2778
2779 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
2780
2781         * pedump.c (dump_verify_info): Dump full class name.
2782
2783 2008-07-24  Mark Probst  <mark.probst@gmail.com>
2784
2785         * generic-sharing.c: Removed some old code that didn't do anything.
2786
2787 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
2788         * profiler.c: Added runtime_initialized_event,
2789         mono_profiler_install_runtime_initialized and
2790         mono_profiler_runtime_initialized. This new hook tells the profiler
2791         when the runtime is sufficiently initialized to be able to call
2792         mono_thread_attach on the root appdomain.
2793         * profiler.h, profiler-private.h: Likewise.
2794
2795 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
2796
2797         * verify.c (do_cast): Do boxing for generic arguments as well.
2798
2799         * class.c (is_nesting_type): Drop generic instantiations before
2800         checking for nesting.
2801
2802         * class.c (can_access_instantiation): Allow access to generic
2803         arguments.
2804
2805 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
2806
2807         * verify.c (verify_class_for_overlapping_reference_fields):
2808         On some cases, the field size might be zero, guard against that.
2809         Fix the explicit layout check to work as expected.
2810
2811 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
2812
2813         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
2814         mono_thread_resume () during shutdown, since the thread we want to abort
2815         might be suspended.
2816
2817 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
2818
2819         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
2820         warning.
2821
2822         * debug-mono-symfile.c: Fix a warning.
2823
2824         * mono-perfcounters.c (get_cpu_times): Fix a warning.
2825
2826         * object.c (mono_class_vtable): Check if exception_type is set, and return
2827         NULL as defined by the function comments.
2828
2829 2008-07-22  Mark Probst  <mark.probst@gmail.com>
2830
2831         * mempool.c: Use malloc for every single mempool allocation if the
2832         configure option is set.  This makes it easier to track mempool
2833         allocations with tools like Valgrind.
2834
2835 2008-07-22  Jb Evain  <jbevain@novell.com>
2836
2837         * reflection.c (create_dynamic_mono_image): emit the same
2838         metadata version that SL2 does when creating a SL2 image.
2839
2840 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
2841
2842         * icall-def.h:
2843         * icall.c: New icall System.Enum:get_hashcode. This function
2844         avoids the overhead of boxing the enum to the underlying type.
2845
2846 2008-07-21  Mark Probst  <mark.probst@gmail.com>
2847
2848         * reflection.c (mono_method_get_object): Don't let static RGCTX
2849         invoke wrappers get into MonoReflectionMethods.
2850
2851 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
2852
2853         * object-internals.h:
2854         * object.c: New mono_runtime_class_init_full function
2855         that makes throwing the exception optinal.
2856
2857         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
2858         for the case where the exception object is supplied.
2859
2860 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
2861
2862         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
2863         old ld versions.
2864
2865         Contributed under MIT/X11 license.
2866
2867 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
2868
2869         * string-icalls.c (ves_icall_System_String_InternalSplit):
2870         Optimize array allocation by caching the MonoClass of the
2871         array type.
2872
2873         * icall.c (ves_icall_Type_GetMethodsByName): Same.
2874
2875         * reflection.c (mono_param_get_objects): Same.
2876
2877 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
2878
2879         * icall-def.h:
2880         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
2881         It inflates the given type using the class context.
2882
2883 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
2884
2885         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
2886         the vtable if it already exists.
2887
2888         * object-internals.h: Add mono_class_try_get_vtable as part of the
2889         internal API.
2890
2891         * reflection.c (mono_type_get_object): Use the MonoObject from the
2892         vtable when possible. Reduces locking contention on reflection heavy
2893         code.
2894
2895 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
2896
2897         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
2898         g_bit_nth_msf () since that macro is not implemented in eglib.
2899
2900 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
2901
2902         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
2903         on platforms which do not support it.
2904
2905 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
2906
2907         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
2908
2909 2008-07-11  Martin Baulig  <martin@ximian.com>
2910
2911         * mono-debug-debugger.h
2912         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
2913
2914         * mono-debug-debugger.c
2915         (_mono_debugger_interruption_request): New global volatile variable.
2916         (mono_debugger_check_interruption): New public function.
2917
2918         * threads.c
2919         (mono_thread_current_check_pending_interrupt): Call
2920         mono_debugger_check_interruption().
2921         (mono_thread_interruption_checkpoint_request): Likewise.
2922
2923 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2924
2925         * verify.c: Add more type checks for loaded types. Verify the result
2926         handle from ldtoken.
2927
2928 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2929
2930         * loader.c (field_from_memberref): Don't crash if the field
2931         wasn't found.
2932
2933 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2934
2935         * verify.c: Verify if type and method instantiations
2936         don't have invalid VAR or MVAR arguments.
2937
2938 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2939
2940         * verify.c: Fix double free of function pointer list.
2941
2942 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
2943
2944         * object.c (mono_string_to_utf8): Comment the new code as it
2945         breaks under eglib.
2946
2947 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
2948
2949         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
2950
2951 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
2952
2953         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
2954           is not throw too many times.
2955
2956         Code is contributed under MIT/X11 license.
2957
2958 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
2959
2960         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
2961         debugging is turned off.
2962
2963 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
2964
2965         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
2966
2967 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2968
2969         * class-internals.h, class.c: Added new generic sharing option:
2970         Share only stuff in System.Collections.Generic, which is now the
2971         default.
2972
2973 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2974
2975         * generic-sharing.c, class-internals.h: New function for getting a
2976         generic method in a generic class given the corresponding method
2977         for a different instantiation of the class.  Partly refactored
2978         from mini-trampolines.c.
2979
2980         * class.c: Make sure generic methods have a class_inst if they are
2981         part of a generic class.
2982
2983         * metadata.c (mono_type_stack_size_internal): Handle type
2984         variables.
2985
2986 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2987
2988         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
2989         Signifies whether information on the this/vtable/mrgctx variable
2990         is available.
2991
2992 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2993
2994         * object.c, object-internals.h, icall.c: New function
2995         mono_delegate_ctor_with_method(), which does the same as
2996         mono_delegate_ctor(), but takes an explicit method argument
2997         instead of taking the method from the jit info.
2998
2999         * marshal.c: When creating a delegate with an inflated method take
3000         the "this" argument as the target class for the castclass.
3001
3002 2008-07-03  Mark Probst  <mark.probst@gmail.com>
3003
3004         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
3005         mono_jit_info_table_find() to perform very badly in some cases.
3006
3007 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
3008
3009         * icall.c (type_from_typename): Handle 'string'.
3010
3011         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
3012         wrappers into the wrapper_hash, since the key is not a MonoMethod.
3013
3014 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
3015
3016         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
3017
3018         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
3019         number of available managed allocator types.
3020
3021         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
3022         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
3023
3024 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
3025
3026         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
3027         which is a low level lock protecting just the 'jit_code_hash' hash table.
3028
3029         * domain.c: Initialize+cleanup jit_code_hash_lock.
3030         
3031 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
3032
3033         * coree.c (mono_load_coree): Set coree_module_handle global variable only
3034         after initialization.
3035
3036         * coree.h: Make MonoFixupExe internal.
3037
3038         Contributed under MIT/X11 license.
3039
3040 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
3041
3042         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
3043         because that is platform independent. Check NumberOfRvaAndSizes in PE32
3044         as well.
3045         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
3046         image being loaded is a CLI image and _CorValidateImage gets called.
3047
3048         * coree.h: Add MonoLoadImage.
3049
3050         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
3051         instead of LoadLibrary.
3052
3053         Contributed under MIT/X11 license.
3054
3055 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
3056
3057         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
3058         for any primitive type.
3059
3060 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
3061
3062         * object.c (mono_array_new_specific): Optimize this and the other allocation
3063         functions a bit.
3064         
3065         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
3066         domains too if mono_dont_free_domains is set.
3067
3068         * domain-internals.h (mono_dont_free_domains): New internal option controlling
3069         whenever to free appdomain data after it has been unloaded.
3070
3071         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
3072         
3073 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
3074
3075         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
3076         (mono_method_get_equivalent_method): Fix a warning.
3077
3078         * object.c (mono_message_init): Avoid looking up array types for each call.
3079
3080 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
3081
3082         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
3083         call.
3084
3085         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
3086         even more.
3087
3088         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
3089         each iteration.
3090
3091         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
3092         fields of an enum.
3093
3094 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
3095
3096         * object.c (mono_value_box): Fix boxing of nullables.
3097
3098 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
3099
3100         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
3101         mono_module_handle that is defined by the linker; no initialization required.
3102         * coree.h: Remove mono_module_handle, add __ImageBase, update
3103         mono_image_open_from_module_handle.
3104         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
3105         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
3106         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
3107         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
3108         to 4 GB away from image base address. IA64 version is not tested but was very
3109         easy to implement and should work if we ever need it.
3110         * domain.c (mono_init_internal): Avoid system error message boxes.
3111         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
3112         with has_entry_point. Handle do_mono_image_load fauilre correctly.
3113         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
3114         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
3115         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
3116
3117         Contributed under MIT/X11 license.
3118
3119 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3120
3121         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
3122         as part of the private mono API.
3123         
3124         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
3125         Do proper argument checking for methods that belong to generic classes.
3126         Do proper type resolution for GMFH/2.
3127         Fixes #377324.
3128         
3129 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3130
3131         * verify.c (do_switch): Fix a memory corruption bug with
3132         the jump index is out of bound.
3133
3134 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3135
3136         * verify.c: Disable debug code.
3137
3138 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3139
3140         * reflection.c (mono_image_get_methodbuilder_token): Use
3141         mono_image_get_methodspec_token_for_generic_method_definition
3142         instead of mono_image_get_memberref_token. We cache more memberef
3143         entries now.
3144
3145 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3146
3147         * verify.c: Inflate exception clause types.
3148         Fixes #402606.
3149         
3150 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3151
3152         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
3153         name.
3154
3155         * reflection.c (mono_image_get_ctorbuilder_token): Same.
3156
3157         * reflection.c (mono_image_create_method_token): Same.
3158
3159 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
3160
3161         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
3162         It does the same as mono_image_get_methodref_token but works on
3163         MethodBuilder.
3164
3165         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
3166         and always generate a methodspec. This follows the old behavior and fixes
3167         the regressions in System.Core. 
3168
3169 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
3170
3171         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
3172         don't event mono_class_get () succeeds. Fixes #402182.
3173
3174 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
3175
3176         * metadata-internals.h: Added MonoDynamicImage::methodspec
3177         hashtable to store methodspec tokens created for MethodBuilders.
3178
3179         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
3180         MethodBuilders as open instantiations if a methodspec was requested.
3181
3182         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
3183
3184         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
3185
3186         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
3187
3188         Fixes bug #349190.
3189
3190 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
3191
3192         * loader.c (method_from_methodspec): Avoid crashing if the
3193         method lookup fails.
3194
3195 2008-06-20  Dick Porter  <dick@ximian.com>
3196
3197         * socket-io.c (get_socket_assembly): Cope with Moonlight network
3198         classes being in a different assembly.  Fixes bug 399184.
3199
3200 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
3201
3202         * loader.c (mono_loader_init): Make this callable multiple times.
3203         (mono_dllmap_insert): Call mono_loader_init () so this works even before
3204         the runtime is initialized. Fixes #401755.
3205
3206 2008-06-19  Dick Porter  <dick@ximian.com>
3207
3208         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
3209         Fixes bug 349688.
3210
3211 2008-06-19  Dick Porter  <dick@ximian.com>
3212
3213         * socket-io.c:
3214         * icall-def.h: Implement Socket generic Send() and Receive()
3215         methods.  Fixes bug 395168.
3216
3217 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
3218
3219         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
3220
3221         Contributed under MIT/X11 license.
3222
3223 2008-06-18  Martin Baulig  <martin@ximian.com>
3224
3225         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
3226         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
3227         set to 80.0.  The debugger <-> runtime interface is now frozen as
3228         well.   
3229
3230         * mono-debug.c
3231         (mono_debug_debugger_version): Bump to 4.
3232
3233 2008-06-18  Martin Baulig  <martin@ximian.com>
3234
3235         * debug-mono-symfile.c
3236         (load_symfile): Don't check the minor version.
3237
3238         * debug-mono-symfile.h: Bump the version number to 50.0.
3239
3240 2008-06-18  Martin Baulig  <martin@ximian.com>
3241
3242         * debug-mono-symfile.c
3243         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
3244         minimum required version.
3245
3246 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
3247
3248         * reflection.c (mono_custom_attrs_from_property): Fix support for
3249         retriveving cattrs of dynamic inflated generic types.
3250
3251         * reflection.c (mono_custom_attrs_from_event): Same.
3252
3253         * reflection.c (mono_custom_attrs_from_field): Same;
3254
3255         * reflection.c (typebuilder_setup_events): Same cattrs of events.
3256
3257         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
3258         Moved to metadata.c.
3259
3260         * metadata.c: New functions to retrive the equivalent field, event
3261         of property from the generic type definition.
3262
3263         * metadata-internals.h: Added new functions from metadata.c.
3264
3265 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
3266
3267         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
3268         to cached in a mempool is used.
3269
3270         * metadata.c (free_generic_class): In some situations field generic_info type
3271         is not properly dup'ed and leads to double free'ing.
3272
3273         Fixes #400643.
3274
3275 2008-06-17  Mark Probst  <mark.probst@gmail.com>
3276
3277         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
3278         this arguments (will be needed later for generic methods).
3279         Collect stats.
3280
3281 2008-06-17  Mark Probst  <mark.probst@gmail.com>
3282
3283         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
3284         Create a static RGCTX invoke wrapper for methods which require it.
3285
3286 2008-06-17  Mark Probst  <mark.probst@gmail.com>
3287
3288         * object.c, class-internals.h: New function for checking whether
3289         an individual field is special static.
3290
3291 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
3292
3293         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
3294         linear search since the table is sorted.
3295
3296         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
3297         Fixes #324180.
3298
3299 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
3300
3301         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
3302         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
3303
3304         * gc.c (mono_domain_finalize): Allow an infinite timeout.
3305
3306         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
3307         
3308         * threads.c (mono_thread_request_interruption): Get rid of locking, use
3309         InterlockedCompareExchange to query and modify 
3310         thread->interruption_requested.
3311
3312         * object-internals.h (struct _MonoThread): Change interruption_requested
3313         to a gint32 so it can be modified by atomic operations. Add 
3314         'critical_region_level' from the managed side, change small_id to a guint32,
3315         add new set of 'unused' fields.
3316
3317         * appdomain.c: Bump corlib version.
3318
3319 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
3320
3321         * class.c (mono_class_from_name): Search modules as well. Fixes
3322         #322332.
3323
3324 2008-06-13  Mark Probst  <mark.probst@gmail.com>
3325
3326         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
3327         templates.  Templates are generalized with an additional type_argc
3328         argument.  RGCTX templates have type_argc==0, MRGCTX templates
3329         have type_argc>0.
3330
3331         * domain-internals.h, domain.c: New hash table for looking up
3332         MRGCTXs.
3333
3334         * metadata.c, metadata-internals.h: Rename hash and equal
3335         functions for MonoGenericInst's and make them public.
3336
3337         * class-internals.h: New data structures for the MRGCTX.  Macros
3338         for distinguishing slots in the RGCTX and the MRGCTX.
3339
3340 2008-06-13  Mark Probst  <mark.probst@gmail.com>
3341
3342         * object.c (mono_method_get_imt_slot): Put the same methods of
3343         different instantiations of the same generic interface in the same
3344         IMT slots, to make generic sharing simpler.
3345
3346 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
3347
3348         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
3349
3350         * metadata.c (mono_metadata_field_info_with_mempool): Added.
3351         This function works just like mono_metadata_field_info, but
3352         accept a mempool as argument to be used allocating memory.
3353
3354         * marshal.c (mono_marshal_load_type_info): Use new function
3355         to load marshal data into image mempool.
3356
3357 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
3358
3359         * class.c (mono_class_inflate_generic_type_with_mempool):
3360         This function allows to inflate a generic type using
3361         a mempool.
3362
3363         * class.c (inflate_generic_type): Take a mempool as argument
3364         and use it to do type dup'ing.
3365
3366         * class.c (mono_class_setup_fields): Field type for generic
3367         generic classes are allocated from the image mempool.
3368
3369         * metadata.c (free_generic_class): Inflated field type is
3370         now allocated in the image mempool.
3371
3372 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
3373
3374         * threads.c (thread_cleanup): Free MonoThread::name.
3375
3376 2008-06-12  Marek Habersack  <mhabersack@novell.com>
3377
3378         * appdomain.c (ensure_directory_exists): avoid unnecessary
3379         mkdir(2) calls when the shadow directory already exists.
3380         (mono_make_shadow_copy): copy also satellite assemblies from the
3381         private bin directories.
3382
3383 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
3384
3385         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
3386         
3387         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
3388         a page boundary. Fixes #396219.
3389
3390 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3391
3392         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
3393         due to double-checked locking.
3394
3395 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3396
3397         * assembly.c (build_assembly_name): Release memory on failure.
3398
3399         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
3400
3401 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3402
3403         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
3404         memory on failure.
3405
3406 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3407
3408         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
3409         memory on failure.
3410
3411 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3412
3413         * loader.c (field_from_memberref): Check if field signature type is equal
3414         to the non-inflated type of the field. Fixes #398980.
3415
3416 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
3417
3418         * assembly.c (mono_assembly_load_from_full): Call 
3419         mono_assembly_load_friends () outside the assemblies lock, since it can
3420         acquire the loader lock. Fixes #323696.
3421
3422         * reflection.c (resolve_object): Inflate the inst with the context for
3423         FieldOnTypeBuilderInst. Fixes #399010.
3424
3425 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3426
3427         * reflection.c (mono_image_get_field_on_inst_token): Don't
3428         inflate the field to encode it's signature. If it's a
3429         VAR or MVAR it should stay that way in the signature.
3430         Fixes #399047.
3431
3432 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3433
3434         * reflection.c (resolve_object): Release memory of inflated types.
3435
3436 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3437
3438         * loader.c (mono_method_get_signature_full): Remove assert about
3439         loading a methodspec to a generic method. We have such methods, such as
3440         System.Threading.Interlocked::CompareExchange<T>.
3441         This assert was removed since it crashes the verifier when it checks
3442         methods calling CompareExchange<T>.
3443
3444 2008-06-10  Marek Safar  <marek.safar@gmail.com>
3445
3446         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
3447         of Type array and not MonoType.
3448
3449 2008-06-10  Marek Habersack  <mhabersack@novell.com>
3450
3451         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
3452         <lupus@ximian.com>
3453
3454 2008-06-10  Martin Baulig  <martin@ximian.com>
3455
3456         * debug-mono-symfile.h
3457         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
3458         changes to the file format, but we were generating incorrect
3459         source file indices in the line number table due to a bug, which
3460         made backtraces report an incorrect source file.
3461
3462 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
3463
3464         * mono-debug.c: Moved mono_debug_free_method_jit_info from
3465         mini/debug-mini.c to here.
3466
3467         * mono-debug.c (il_offset_from_address): Free memory from find_method.
3468
3469         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
3470         use it to release structs returned by mono_debug_find_method.
3471
3472 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
3473
3474         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
3475         since it needs to set method->slot for all interface methods.
3476
3477 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3478
3479         * class-internals.h: Forgot to add.
3480
3481 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3482
3483         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
3484
3485         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
3486         Lookup the custom attributes from property_hash.
3487
3488         * reflection.c (mono_save_custom_attrs): Save the custom attributes
3489         in property_hash. Allocate all data using the image mempool.
3490
3491         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
3492         for dynamic_custom_attrs to checks if the image is dynamic.
3493
3494 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
3495
3496         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
3497         assemblies array.
3498         
3499         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
3500         runtime functions while holding the domain assemblies lock.
3501
3502 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3503
3504         * verify.c: Reapplied the last bit of the reverted changes.
3505
3506 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
3507
3508         * verify.c: Reapplied more of the reverted changes.
3509
3510 2008-06-09  Martin Baulig  <martin@ximian.com>
3511
3512         * debug-mono-symfile.c (load_symfile): Check the major version
3513         first; if it's wrong, don't print the minor version in the error message.
3514
3515 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
3516
3517         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
3518         lock instead of the domain lock to avoid deadlocks, since the thread might
3519         already hold the loader lock.
3520
3521         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
3522         (mono_thread_attach): Ditto.
3523
3524         * monitor.c: Use a TLS variable for holding the current thread id instead
3525         of calling pthread_self ().
3526         (mono_monitor_init_tls): New internal function to initialize the TLS
3527         variable.
3528         (mono_monitor_try_enter_internal): Put the owner == id check after the
3529         owner == 0 check.
3530
3531         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
3532         missed optimizations when using gcc-4.3.
3533
3534 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
3535
3536         * reflection.c (mono_dynamic_image_free): Free the memory
3537         used by MonoGenericParam in MonoDynamicImage::gen_param.
3538
3539         * reflection.c (mono_reflection_setup_generic_class): Allocate
3540         container from mempool.
3541
3542         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
3543         container from mempool.
3544
3545 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
3546
3547         * threads.c (mono_set_pending_exception): New internal function to set the
3548         pending exception of the current thread.
3549         (mono_thread_get_and_clear_pending_exception): Check for 
3550         thread->pending_exception as well.
3551
3552         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
3553
3554         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
3555         it can trigger a collection.
3556
3557 2008-06-06  Martin Baulig  <martin@ximian.com>
3558
3559         Merged the `debugger-kahalo' branch.
3560
3561         * mono-debug.h
3562         (MONO_DEBUGGER_VERSION): Bumped to 72.
3563
3564         * debug-mono-symfile.h
3565         (MonoSymbolFileMethodIndexEntry): Removed.
3566         (MonoSymbolFileMethodEntry): New public typedef.
3567         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
3568         (MonoSymbolFileSourceEntry): Remove everything except `index' and
3569         `data_offset'.
3570         (MonoSymbolFileMethodEntry): Removed.
3571         (MonoSymbolFileLexicalBlockEntry): Removed.
3572         (MonoSymbolFileLineNumberEntry): Removed.
3573         (MonoDebugLexicalBlockEntry): Removed.
3574         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
3575         removed `num_il_offsets' and `il_offsets'.
3576         (MonoSymbolFile): Replace `version' with `major_version' and
3577         `minor_version'.
3578         (MONO_SYMBOL_FILE_VERSION): Replace with
3579         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
3580         `MONO_SYMBOL_FILE_MINOR_VERSION'.
3581
3582         * debug-mono-symfile.c
3583         (mono_debug_symfile_lookup_location): Add support for the new line
3584         number table format.
3585
3586 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3587
3588         * metadata.c (free_generic_class): Release the inflated
3589         MonoClass of dynamic generic classes if it's not a generic
3590         type definition.
3591
3592 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3593
3594         * verify.c: Reapplied more of the reverted changes.
3595
3596 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3597
3598         * reflection.c (lookup_custom_attr): Clean the cached flag or
3599         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
3600         for SRE types.
3601
3602 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
3603
3604         * verify.c: Reapplied a small part of the reverted changes.
3605
3606 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
3607
3608         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
3609
3610         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
3611         previously in managed code.
3612         (mono_monitor_exit): Ditto.
3613         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
3614
3615         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
3616         the managed definition.
3617
3618 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
3619
3620         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
3621
3622 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
3623
3624         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
3625         
3626         * monitor.c: Add some micro optimizations.
3627
3628         * icall.c (type_from_typename): Handle 'bool'.
3629
3630 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
3631
3632         * verify.c: Implement constructor verification per P III 1.8.1.4.
3633         Fixes #396716.
3634
3635 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
3636
3637         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
3638         holding the assemblies lock here too.
3639
3640 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3641
3642         * verify.c: Kill stack_top function.
3643
3644 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3645
3646         * verify.c: Kill stack_get function.
3647
3648 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3649
3650         * verify.c (mono_method_verify): Last change broke the build. Fixed.
3651
3652 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
3653
3654         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
3655         more reliable.
3656
3657         * verify.c (mono_method_verify): Inflate params and locals to avoid
3658         mismatch when checking for compatibility.
3659
3660 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
3661
3662         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
3663         Length prefix should be size in bytes. Fix bug #339530.
3664         
3665         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
3666         Length prefix should be size in bytes. Fix bug #339530.
3667
3668         Code is contributed under MIT/X11 license.
3669
3670 2008-06-05  Bill Holmes <billholmes54@gmail.com>
3671
3672         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
3673
3674         Contributed under MIT/X11 license.
3675
3676 2008-06-05  Martin Baulig  <martin@ximian.com>
3677
3678         * mono-debug-debugger.c
3679         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
3680
3681 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
3682
3683         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
3684         while holding the assemblies lock to prevent deadlocks. Handle the case
3685         where the search hook returns NULL but the assembly was still loaded.
3686         Fixes #323696.
3687
3688         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
3689         modify domain state.
3690
3691 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
3692
3693         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
3694         * Makefile.am (pedump_LDADD): Post-process object files and
3695         add dtrace-generated object file, if necessary.
3696
3697         Code is contributed under MIT/X11 license.
3698
3699 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3700
3701         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
3702
3703 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3704
3705         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
3706
3707 2008-06-04  Mark Probst  <mark.probst@gmail.com>
3708
3709         * threads.c: Try to free everything from the delayed free table
3710         when shutting down threads, and set the variable to NULL after the
3711         table is freed so that calling
3712         mono_thread_hazardous_try_free_all() when shutting down the root
3713         domain doesn't crash.
3714
3715 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
3716
3717         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
3718         the caller if resulting type was inflated.
3719
3720         * class.c (mono_class_create_from_typespec): Free the MonoType if it
3721         was inflated.
3722
3723         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
3724
3725
3726 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
3727
3728         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
3729         class library tests.
3730
3731         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
3732         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
3733         #396989.
3734
3735 2008-06-04  Mark Probst  <mark.probst@gmail.com>
3736
3737         * domain.c, domain-internals.h: The JIT infos are now freed by the
3738         JIT info table code.  They are freed immediately if there only a
3739         single JIT info table in circulation.  If there is more, the free
3740         is delayed via a queue.
3741
3742         * threads.c, threads-types.h: New hazard pointer function for
3743         freeing all freeable delayed items in one sitting.
3744
3745 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3746
3747         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
3748
3749         * reflection.c (typebuilder_setup_properties): Same.
3750
3751         * reflection.c (typebuilder_setup_events): Same.
3752
3753 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3754
3755         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
3756         and use it for allocating memory.
3757
3758         * reflection.c (mono_marshal_spec_from_builder): Same.
3759
3760         * reflection.c: Change code to use new signatures.
3761
3762         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
3763
3764 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
3765
3766         * decimal.c (rescale128): Put back one line which was accidently commented
3767         out.
3768         
3769         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
3770         to cause crashes.
3771
3772 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3773
3774         * reflection.c (mono_reflection_generic_class_initialize): Name must
3775         be always malloc'ed so we can free it later on. Do this for field, property
3776         and event.
3777
3778         * metadata.c (free_generic_class): Free field, property and event names.
3779
3780 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3781
3782         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
3783         instead of g_memdup.
3784
3785         * reflection.c (typebuilder_setup_fields): Same.
3786
3787 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
3788
3789         * decimal.c (rescale128): Optimize this function a bit more.
3790
3791 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3792
3793         * metadata.c (free_generic_class): Release some memory from
3794         SRE generic classes.
3795
3796 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
3797
3798         * reflection.c (mono_image_get_generic_field_token): No reference
3799         to name is kept, free it.
3800
3801         * reflection.c (mono_reflection_generic_class_initialize): Free
3802         more memory of the inflated field.
3803
3804 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
3805
3806         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
3807         code.
3808
3809 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
3810
3811         * reflection.c (mono_dynamic_image_free): Release memory used by
3812         MonoDynamicImage::array_methods elements.
3813
3814         * reflection.c (assembly_add_win32_resources): Release memory after
3815         encoding.
3816
3817 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
3818
3819         * decimal.c (log2_32): Use an optimized version for this function too.
3820         
3821         * decimal.c (log2_64): Fix this on 32 bit machines.
3822
3823 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
3824
3825         * class.c (mono_dup_array_type): Implement allocation using a mempool.
3826
3827         * class.c (mono_metadata_signature_deep_dup): Same.
3828
3829         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
3830         a mempool.
3831
3832         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
3833
3834         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
3835
3836         * metadata-internals.h: Added mono_metadata_signature_dup_full.
3837
3838         * class-internals.h: Update signatures to take a MonoMemPool.
3839
3840 2008-06-02  Dick Porter  <dick@ximian.com>
3841
3842         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
3843         * icall-def.h: Add
3844         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
3845         FormatMessage API to get the error text.  Fixes bug 321827.
3846
3847 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
3848
3849         * decimal.c: Add some micro optimizations to make decimal operations faster.
3850
3851 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
3852
3853         * reflection.c (method_encode_clauses): Take a mempool
3854         as parameter and use it to allocate the clause array.
3855
3856         * reflection.c (mono_image_get_field_on_inst_token): Free
3857         the inflated type after encoding it.
3858
3859         * reflection.c (mono_dynamic_image_free): Free each element
3860         of MonoDynamicImage::gen_params.
3861
3862         * reflection.c (reflection_methodbuilder_to_mono_method):
3863         Allocate the generic param array from the mempool.
3864         Allocate signature params from the mempool.
3865
3866         * reflection.c (mono_reflection_generic_class_initialize):
3867         Free inflated fields after been used.
3868
3869 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
3870
3871         * icall.c: Reapply the memory leak fixes as they no
3872         longer make mono crash.
3873
3874 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
3875
3876         * reflection.c (mono_type_get_object): Don't store the suplied
3877         MonoType with type_hash. A caller which pass a type that
3878         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
3879         might end with a pointer to freed memory.
3880         The solution is to use byval_arg or this_arg from the associated
3881         MonoClass of the supplied type.
3882
3883 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
3884
3885         * icall.c: Revert the rest of the last change as it breaks the build too.
3886
3887 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3888
3889         * icall.c: Revert a leak fix as it's breaking the build.
3890
3891 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3892
3893         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
3894
3895 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3896
3897         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
3898
3899 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
3900
3901         * icall.c: Fix some memory leaks.
3902
3903 2008-05-29  Dick Porter  <dick@ximian.com>
3904
3905         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
3906         async socket operations from the pending list when a socket
3907         closes.  Leaving it until the threadpool services the event
3908         exposes a race condition when a socket descriptor is reused.
3909         Fixes bug 377589.
3910
3911 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3912
3913         * object.c: Fix negative index check for array alocation.
3914
3915 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3916
3917         * icall.c, marshal.c: Delegate wrappers should skip visibility.
3918         This check is performed by the verifier for IL created delegates
3919         and by Delegate::CreateDelegate for programatically created ones.
3920         Fixes #372406.
3921
3922 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3923
3924         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
3925         Fix code to use mono_array_size_t instead of int.
3926
3927         Based on patch by Luis F. Ortiz.
3928         Contributed under X11 license.
3929         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3930
3931 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3932
3933         * icall.c: Added ves_icall_System_Array_GetLongLength and
3934         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
3935         arrays.
3936
3937         * icall.h: Export both new functions.
3938
3939         Based on patch by Luis F. Ortiz.
3940         Contributed under X11 license.
3941         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3942
3943 2008-05-28  Martin Baulig  <martin@ximian.com>
3944
3945         The debugger now requires exactly r103463.
3946
3947         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
3948         This version is not supported by the debugger, wait for 72.
3949
3950 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3951
3952         * object.h: Changed array related functions to use
3953         mono_array_size_t instead of guint32. Forgot to commit this file.
3954
3955         Patch by Luis F. Ortiz.
3956         Contributed under X11 license.
3957         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3958
3959
3960 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
3961
3962         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
3963         don't define it. Use the number literal instead.
3964
3965 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3966
3967         * icall.c: Changed array related functions to use
3968         mono_array_size_t instead of guint32.
3969
3970         * icall.c (ves_icall_System_Array_GetLength): Check for length
3971         overflow under MONO_BIG_ARRAYS.
3972
3973         Based on patch by Luis F. Ortiz.
3974         Contributed under X11 license.
3975         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3976
3977 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3978
3979         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
3980
3981         Based on patch by Luis F. Ortiz.
3982         Contributed under X11 license.
3983         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3984
3985 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3986
3987         * object.c, object.h: Changed array related functions to use
3988         mono_array_size_t instead of guint32.
3989
3990         Patch by Luis F. Ortiz.
3991         Contributed under X11 license.
3992         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3993
3994 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3995
3996         * object.h: Introduced mono_array_size_t typedef. This must be used
3997         in all places an array length is expected. This is 64bits wide if
3998         MONO_BIG_ARRAYS is enabled.
3999
4000         Patch by Luis F. Ortiz.
4001         Contributed under X11 license.
4002         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
4003
4004 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
4005
4006         * security-manager.c class.c: Set the class exception info by calling
4007         mono_class_set_failure ().
4008
4009         * class.c (mono_class_get_exception_data): New accessor function.
4010         (mono_class_set_failure): Store exception_data in the property hash.
4011
4012         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
4013         the struct as a property.
4014
4015         * loader.c (mono_get_method_full): Store the lookup result for method
4016         tokens in method_cache, the others in methodref_cache to decrease the memory
4017         usage of hash tables.
4018
4019         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
4020         (mono_image_init): method_cache is lazy inited now.
4021
4022         * metadata-internals.h (struct _MonoImage): Change method_cache to
4023         a MonoValueHashTable, add a separate methodref_cache.
4024
4025 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
4026
4027         * number-formatter.h: Fix tables to avoid arithemtic overflow in
4028           Double.ToString as exposed by Bug #383531.
4029
4030 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
4031
4032         * number-formatter.h: Make some tables static.
4033
4034         * class.c (mono_method_set_generic_container): New accessor function.
4035         (mono_method_get_generic_container): Ditto.
4036
4037         * class-internals.h (struct _MonoMethod): Remove rarely used 
4038         'generic_container' field, store it in the property hash instead. Add 
4039         'is_generic' boolean field instead.
4040
4041         * image.c (mono_image_init): Initialize property_hash.
4042         (mono_image_close): Destroy property_hash.
4043
4044         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
4045         hold rarely used fields of runtime structures belonging to this image.
4046
4047         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
4048         to get/set method->generic_container.
4049
4050         * loader.c (mono_get_method_from_token): Avoid loading the method header for
4051         generic methods.
4052
4053 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
4054
4055         * class.c (mono_class_inflate_generic_method_full): Don't increase
4056         mono_stats.inflated_method_count for methods found in the cache.
4057
4058         * threads.c (mono_thread_request_interruption): Add a comment about 
4059         QueueUserAPC ().
4060
4061 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
4062
4063         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
4064         interface_offsets_packed table.
4065         
4066         * class.c (mono_class_init): Remove some dead code.
4067
4068         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
4069         mono_class_setup_vtable () when CAS is active to detect security problems.
4070
4071 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
4072
4073         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
4074
4075         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
4076         parameters as it's irrelevant for delegate checking.
4077
4078 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
4079
4080         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
4081
4082         * class.c (mono_class_init): Control the creation of a generic vtable using
4083         a global which is true by default, but set to false by the runtime startup code.
4084         
4085         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
4086         Disabled for now since it breaks the embedding API.
4087         Move the setup of class->methods for arrays to mono_class_setup_methods ().
4088         (mono_class_setup_methods): Add a memory barrier.
4089
4090         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
4091         when mono_class_init () doesn't compute the generic vtable.
4092         
4093 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
4094         * profiler.c: Added mono_profiler_install_statistical_call_chain,
4095         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
4096         to support call chains (backtrace) in the stat profiler.
4097         * profiler.c, profiler-private.h: Likewise.
4098
4099 2008-05-22  Mark Probst  <mark.probst@gmail.com>
4100
4101         * generic-sharing.c: Init generic class when a method of it is
4102         requested via a runtime generic context.
4103
4104 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
4105
4106         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
4107
4108         * reflection.c (mono_type_get_object): Add a FIXME.
4109
4110         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
4111
4112         * class.c (mono_class_get_method_by_index): New helper function, returning an
4113         entry in the class->methods array.
4114
4115 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
4116
4117         * class.c (mono_class_init): Only do the array optimization for szarrays. 
4118         Avoid creating a generic vtable for generic instances as well.
4119         (mono_class_get_method_from_name_flags): Don't search in the metadata for
4120         generic instances.
4121
4122 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
4123
4124         * loader.c (mono_get_method_constrained): Inflate the signature
4125         with class context. Fix #325283.
4126
4127 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
4128
4129         * object.c (mono_class_create_runtime_vtable): Add a comment.
4130
4131         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
4132         where needed.
4133         (setup_interface_offsets): Handle the case when this is called twice for arrays.
4134         (mono_class_setup_vtable_general): Add an assert.
4135         (mono_class_init): Avoid creating a generic vtable for arrays.
4136
4137         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
4138         here, let mono_class_init () do that.
4139
4140         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
4141         interfaces in mscorlib.
4142
4143         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
4144         interfaces. Add some comments.
4145         (mono_class_init): Call mono_class_setup_methods () here since it is no
4146         longer called by mono_class_setup_vtable ().
4147
4148         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
4149         not set in class->vtable.
4150         (mono_class_create_runtime_vtable): Reenable the disabled code.
4151
4152         * object.c (mono_class_create_runtime_vtable): Disable the last change for
4153         now as it causes some test failures.
4154
4155         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
4156         if using the vtable trampoline. Also remove some strange code which put the
4157         generic methods themselves into the vtable slots. Remove the AOT init_vtable
4158         stuff as it is no longer needed.
4159
4160 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4161
4162         * pedump.c: Give make --verify all option check code as well.
4163         Using --verify code won't check for metadata now.
4164
4165 2008-05-19  Martin Baulig  <martin@ximian.com>
4166
4167         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
4168
4169         * mono-debug.c
4170         (_mono_debug_using_mono_debugger): New global variable; it's set
4171         directly by the debugger, so mono_debug_using_mono_debugger() also
4172         works after attaching.
4173
4174 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
4175
4176         * object.c (mono_class_create_runtime_vtable): Use memory barriers
4177         as we do double checked locking on MonoClass::runtime_info and
4178         MonoClassRuntimeInfo::domain_vtables.
4179
4180 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
4181
4182         * debug-helpers.c (print_field_value): Fix a warning.
4183
4184 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
4185
4186         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
4187         set in the AOT case.
4188
4189 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
4190
4191         * class.c (mono_class_setup_vtable_general): Use memory barriers
4192         as we do double checked locking on MonoClass::vtable.
4193
4194 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
4195
4196         * reflection.c (resolve_object): Inflate only if the generic context
4197         is not null. Fixes #389886.
4198
4199 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
4200
4201         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
4202         instead of g_free.
4203
4204         Code is contributed under MIT/X11 license.
4205
4206 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
4207
4208         * class.c: Revert unrelated change.
4209
4210 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
4211
4212         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
4213         a generic instantiation, use mono_class_from_mono_type instead of playing
4214         with MonoType directly.
4215
4216 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
4217
4218         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
4219         checks must ignore generic instantiations, so mono_class_has_parent is not
4220         suitable. Fixes #390128.
4221
4222 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
4223
4224         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
4225         it to avoid registering tokens during metadata generation. Fixes #390023.
4226
4227 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
4228
4229         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
4230         consistent.
4231
4232         Contributed under MIT/X11 license.
4233
4234 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
4235
4236         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
4237         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
4238         to fixup the EXE image.
4239         (mono_cleanup): Use mono_close_exe_image.
4240         (mono_close_exe_image): New function.
4241         * image.c: Include "marshal.h".
4242         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
4243         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
4244         counting when the image is loaded outside of mono_image_open_full. Set status
4245         based on GetLastError.
4246         * coree.c: Include required headers. Add init_from_coree.
4247         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
4248         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
4249         (_CorExeMain): Set init_from_coree.
4250         (CorExitProcess): Only call ExitProcess for now.
4251         (CorBindToRuntimeEx): New stub implementation.
4252         (CorBindToRuntime): New function.
4253         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
4254         (MonoFixupExe): ILONLY executables require no fixups.
4255         (mono_set_act_ctx): New function to set activation context.
4256         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
4257         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
4258         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
4259         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
4260         as MONO_INTERNAL.
4261         * domain-internals.h: Add mono_close_exe_image.
4262
4263         Contributed under MIT/X11 license.
4264
4265 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
4266
4267         * metadata.c (mono_metadata_compute_size): Correctly calculate field
4268         size for generic param and event tables. Fixes #388977.
4269
4270 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
4271
4272         * loader.c (mono_method_signature): Use memory barriers because of the double
4273         checked locking pattern.
4274
4275         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
4276         aborting or aborted as well. Fixes #376391.
4277         
4278         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
4279         existing runtime state in the Suspend handler during shutdown.
4280
4281 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
4282
4283         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
4284
4285         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
4286         which are starting up or shutting down.
4287
4288         * threads.c (mono_threads_set_shutting_down): Don't return a value since
4289         this function never returns if the runtime is already shutting down.
4290
4291         * icall.c (ves_icall_System_Environment_Exit): Update after 
4292         mono_threads_set_shutting_down () signature change.
4293         
4294 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
4295
4296         * class.c: Added can_access_instantiation to verify if the instantiation
4297         is visible. Fix access check for nested types as they returned TRUE
4298         before doing type and generic instantiation visibility checks.
4299
4300 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
4301
4302         * reflection.c (mono_reflection_create_generic_class): The created type
4303         must have a different container from its TypeBuilder. Otherwise they
4304         will end sharing generic arguments, which is wrong.
4305
4306         Due to the sharing, making a generic instance of the created type using
4307         the TypeBuider generic arguments resulted in the generic type definition
4308         been returned, which is wrong as well.
4309
4310         As a bonus the code was leaking the type_params array. This memory should
4311         be allocated from the image mempool.
4312
4313         This fixes bug #354047.
4314
4315 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
4316
4317         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
4318         to here         as they are now used in assembly.c new code.
4319         Added a skipverification flag to MonoAssembly.
4320         New internal function mono_assembly_has_skip_verification.
4321
4322         * assembly.c: New function mono_assembly_has_skip_verification. It checks
4323         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
4324         part of #387274.
4325
4326 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
4327
4328         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
4329         needed. Fixes #387034.
4330
4331         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
4332
4333 2008-05-06  Miguel de Icaza  <miguel@novell.com>
4334
4335         * assembly.c (mono_assembly_load_reference): Prevent crash while
4336         disassembling Silverlight 2.0 executables while we still do not
4337         have GACed libraries.
4338
4339 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
4340
4341         * reflection.c: Special case generic type definitions as well. Fixes #383444.
4342
4343 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
4344
4345         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
4346         of the dynamic case. Fixes #387404.
4347
4348 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4349
4350         *verify.c (mono_verifier_is_class_full_trust): If under
4351         verify_all and the verifier mode was not set, only
4352         gac and corlib types are fulltrust. This makes --verify-all
4353         usable to detect unverifiable code, which is the expected
4354         use case.
4355
4356 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4357
4358         * verify.h: Ops, commited the header with debug
4359         enabled.
4360
4361 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4362
4363         * verify.c (merge_stack): Use the new value on unverifiable
4364         stack merges.
4365
4366         * verify.c (verify_type_compatibility_full): Comparison
4367         of nullable types can't use mono_class_is_assignable_from.
4368
4369         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
4370         that makes all verification errors be reported.
4371
4372         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
4373         mono_method_verify.
4374
4375 2008-05-05  Robert Jordan  <robertj@gmx.net>
4376
4377         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
4378         support for value types. See #386415.
4379
4380         * object.c: comments.
4381
4382         Code is contributed under MIT/X11 license.
4383
4384 2008-05-05  Martin Baulig  <martin@ximian.com>
4385
4386         * debug-mono-symfile.h
4387         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
4388         for old pre-terrania symbol files.
4389
4390 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
4391
4392         * mono-config.c: Add ppc64 architecture.
4393
4394         Code is contributed under MIT/X11 license.
4395
4396 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
4397
4398         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
4399           PPC64 uses function descriptors as well.
4400
4401         Code is contributed under MIT/X11 license.
4402
4403 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
4404
4405         * object.c (compute_class_bitmap): Ignore literal static fields.
4406
4407         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
4408         var has an invalid format.
4409         (describe_ptr): Add some sanity checks for the vtable.
4410         (add_nursery_frag): Clear unused nursery fragments.
4411         (major_collection): Clear all remaining nursery fragments.
4412
4413 2008-05-03  Robert Jordan  <robertj@gmx.net>
4414
4415         * image.c, metadata-internals.h: add thunk_invoke_cache.
4416
4417         * marshal.c, marshal.h: implement
4418         mono_marshal_get_thunk_invoke_wrapper ().
4419
4420         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
4421
4422         Code is contributed under MIT/X11 license.
4423
4424 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
4425
4426         * verify.c (do_leave): Empty the stack.
4427
4428 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
4429
4430         * class.c (mono_class_is_assignable_from): Variance
4431         doesn't work between reference and value types. For example,
4432         given type C<T+>, C<int32> is not assignable to C<object>.
4433         Break the argument checking loop on first error. 
4434
4435 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
4436
4437         * icall.c : base64_to_byte_array() needs some more strict
4438           check for sequence of '=' characters. Patch by Santa
4439           Marta (http://deee.g.hatena.ne.jp/santamarta).
4440
4441           Contributed under MIT/X11 license.
4442           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
4443
4444 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
4445
4446         * domain.c: Disable LoadLibrary support to fix Win32 build.
4447
4448         Code is contributed under MIT/X11 license.
4449
4450 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
4451
4452         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
4453         to help with cache behaviour.
4454
4455 2008-05-01  Miguel de Icaza  <miguel@novell.com>
4456
4457         * appdomain.c (mono_domain_from_appdomain): Add new accessor
4458         method. 
4459
4460 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
4461
4462         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
4463
4464 2008-05-01  Dick Porter  <dick@ximian.com>
4465
4466         * process.c (process_get_fileversion): Only pass 16 bits of
4467         language ID to VerLanguageName.  Fixes bug 381204.
4468
4469 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4470
4471         * verify.c (mono_method_verify): Fix the comparison
4472         operator for code bounds check.
4473
4474 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4475
4476         * verify.c (mono_method_verify): Check the bounds of
4477         all access of the code array.
4478
4479 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
4480
4481         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
4482
4483 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
4484
4485         * image.c (mono_image_strong_name_position): Fix return value when the rva is
4486         not valid.
4487
4488 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
4489
4490         * loader.c (mono_get_method_from_token, mono_method_signature): Add
4491         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
4492         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
4493         fixup main EXE images when using mono.exe for mixed-mode assembly support.
4494         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
4495         mono_runtime_load.
4496         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
4497         runtime initialization from metadata.
4498         * assembly.c: Remove obsolete ceGetModuleFileNameA.
4499         (mono_set_rootdir): Use mono_get_module_file_name.
4500         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
4501         handles.
4502         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
4503         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
4504         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
4505         MonoCLIImageInfo. Add support for module handles.
4506         (load_cli_header): Update mono_cli_rva_image_map signature.
4507         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
4508         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
4509         (mono_image_rva_map): Add support for module handles.
4510         (mono_image_ensure_section_idx): Add support for module handles.
4511         (mono_image_close): Add support for module handles.
4512         (do_load_header): Add support for module handles.
4513         (mono_image_open_from_module_handle): New function for internal use.
4514         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
4515         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
4516         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
4517         handles.
4518         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
4519         * image.h: Add mono_image_fixup_vtable.
4520         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
4521         support.
4522         * coree.h: New file.
4523         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
4524         unsupported native code.
4525         (mono_marshal_set_callconv_from_modopt): New function splitted from
4526         mono_marshal_get_managed_wrapper.
4527         (mono_marshal_get_managed_wrapper): Use
4528         mono_marshal_set_callconv_from_modopt.
4529         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
4530         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
4531         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
4532         that results in a deadlock when the runtime is loaded in _CorDllMain.
4533         * Makefile.am: Add coree.c and coree.h.
4534
4535         Contributed under MIT/X11 license.
4536
4537 2008-04-28  Mark Probst  <mark.probst@gmail.com>
4538
4539         * generic-sharing.c: Search for type arguments in array element
4540         types as well.
4541
4542 2008-04-28  Mark Probst  <mark.probst@gmail.com>
4543
4544         * class-internals.h, generic-sharing.c: New, small runtime generic context.
4545
4546         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
4547
4548         * object.c: Don't setup the RGCTX when the vtable is created,
4549         because we're setting it up lazily now.
4550
4551 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
4552
4553         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
4554         64 bit support.
4555
4556 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4557
4558         * verify.c (verify_class_for_overlapping_reference_fields): 
4559         If class is under fulltrust allow reference types to overllap
4560         if they have the same RVA.
4561
4562 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4563
4564         * pedump.c: Added new flag valid-only, that makes the verifier
4565         behaves just like --security=validil. It won't fail type load
4566         due to unverifiable restrictions.
4567
4568 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4569
4570         * class-internals.h (struct MonoMethod): Added a verification_success
4571         field to cache verifier executions. Reduced MonoMethod:slot size by
4572         one bit.
4573
4574 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
4575
4576         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
4577         instead of a 'vt' argument to save an indirection and to allow these to be used
4578         for valuetypes.
4579         (scan_vtype): New helper function to scan an area using a gc descriptor.
4580         (mono_gc_wbarrier_value_copy): Implement this.
4581         (handle_remset): Add support for REMSET_VTYPE.
4582         (find_in_remset_loc): Ditto.
4583         (mono_gc_base_init): Allow some debugging options to be controlled through the
4584         use of the MONO_GC_DEBUG env variable.
4585         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
4586         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
4587
4588 2008-04-23  Martin Baulig  <martin@ximian.com>
4589
4590         * domain.c (mono_domain_create): Move the call to
4591         mono_debug_domain_create() down, after allocating the domain id.
4592
4593 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
4594
4595         verify.c (verify_class_for_overlapping_reference_fields): Skip
4596         static fields while verifying for overlapping fields as they
4597         don't matter at all.
4598
4599 2008-04-23  Marek Habersack  <mhabersack@novell.com>
4600
4601         * domain-internals.h: added a declaration of
4602         mono_make_shadow_copy.
4603
4604         * assembly.c (mono_assembly_open_full): shadow copying of
4605         assemblies moved to here, so that all the assemblies within the
4606         application domain's private binary directories can be
4607         processed. Fixes bug #380546
4608
4609         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
4610         mono_make_shadow_copy and made non-static. The decision whether
4611         to shadow-copy an assembly is made based on its location - it's
4612         copied if it's in one of the private application domain binary
4613         directories and its different to the target file in the shadow
4614         directory. Fixes bug #380546
4615
4616 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
4617
4618         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
4619
4620         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
4621         types.
4622
4623         * reflection.c (mono_image_create_token): Handle 
4624         Method/ConstructorOnTypeBuilderInst.
4625         (resolve_object): Ditto.
4626         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
4627         so it can be called from resolve_object. Also handle the case when the inflated
4628         class already has its methods setup.
4629
4630 2008-04-21  Martin Baulig  <martin@ximian.com>
4631
4632         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
4633
4634 2008-04-20  Geoff Norton  <gnorton@novell.com>
4635
4636         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
4637         pointer dereference.
4638
4639 2008-04-15  Marek Habersack  <mhabersack@novell.com>
4640
4641         * appdomain.c (try_load_from): if IOMAP is in effect, call the
4642         portability API to look up the assembly file. Fixes behavior in
4643         situations when the application has a bin/ directory, but the
4644         assembly search patch refers to Bin/ (and thus the requested file
4645         name is Bin/SomeLibrary.dll). Fixes bug #379888
4646
4647 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
4648
4649         verify.c (mono_type_is_generic_argument): Extracted this check
4650         from a dozen places to here.
4651
4652         verify.c: Fixed all issues related to boxing generic arguments
4653         and their constraints.
4654
4655 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
4656
4657         verify.c (mono_class_interface_implements_interface): Fix win32 build.
4658
4659 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
4660
4661         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
4662         isn't finished yet. Fixes #363447.
4663
4664 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
4665
4666         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
4667         Fixes #346419.
4668
4669 2008-04-13  Jb Evain  <jbevain@novell.com>
4670
4671         * domain.c: update the 2.1 profile versions.
4672         Merged from the Moonlight 2 branch.
4673
4674 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
4675
4676         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
4677         mscorlibs for the non-refonly case as well.
4678
4679         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
4680         in mono_assembly_load_from_full (). Fixes #378924.
4681
4682 2008-04-11  Geoff Norton  <gnorton@novell.com>
4683
4684         * icall.c: The global extern environ doesn't exist on Mac.  We
4685         need to call NSGetEnviron instead.
4686
4687 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4688
4689         verify.c: Add generic method constraint verification.
4690
4691 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4692
4693         class.c (mono_class_inflate_generic_method_full): Add a long
4694         explanation to the is_mb_open hack. Remove the FIXME.
4695
4696 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4697
4698         * verify.c (mono_method_verify): Mark all unknown opcodes
4699         as invalid. Mark jmp as unverifiable.
4700
4701 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4702
4703         * verify.c: Add code to do type constraint verification on class instances.
4704
4705         * verify.c (mono_verifier_verify_class): Use the type constraint 
4706         verification code.
4707
4708 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
4709
4710         * class.c (mono_class_get_field_default_value): Don't pass cindex
4711         as hint to mono_metadata_get_constant_index. The local is not initialized
4712         and should contain garbage most of the time. This could only work
4713         with a lot of luck.
4714
4715 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
4716
4717         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
4718
4719 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
4720
4721         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
4722
4723         * class.c (mono_class_from_generic_parameter): Save the token of the
4724         generic param in MonoClass::sizes.generic_param_token.
4725
4726         * reflection.c (mono_custom_attrs_from_class): If the class type is
4727         VAR or MVAR retrieve the attributes of the generic param.
4728
4729 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4730
4731         * class.c (mono_class_init): Do class verification if the verifier
4732         is enabled.
4733
4734 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4735
4736         * verify-internal.h: Added mono_verifier_verify_class.
4737
4738         * verify.c: Added mono_verifier_verify_class. It checks for
4739         classes with explicit layout that have overlapping reference fields.
4740
4741         * pedump.c: Init the verifier state prior to verification. Fixed
4742         command line arguments.
4743
4744 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
4745
4746         * Makefile.am: Added verify-internals.h, hopefully fix the build.
4747
4748 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
4749
4750         * verify-internals.h: Fix a warning.
4751
4752 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4753
4754         * verify-internals.h: New header with the verifier configuration
4755         extracted from mini.c.
4756
4757         * verify.c: Implemented the new functions exported by verify-internals.h.
4758
4759 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
4760
4761         * verify.c: Add proper verification of ckfinite.
4762
4763 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
4764
4765         * verify.c (do_conversion): Improved error message to something
4766         more meanfull.
4767
4768         * verify.c (check_is_valid_type_for_field_ops): Fix to work
4769         with primitive types.
4770
4771 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
4772
4773         * verify.c: Added tail prefix checking. Marked icall
4774         as unverifible.
4775
4776 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
4777
4778         * verify.c: Fix the detection of branches to the middle
4779         of an instruction.
4780
4781 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
4782
4783         * verify.c: Implemented verification of volatile. and
4784         unaligned. prefix. Check if a type is valid after retrieving it.
4785
4786 2008-04-01  Dick Porter  <dick@ximian.com>
4787
4788         * process.c (process_get_fileversion): If there's no string block,
4789         set the file language to en_US.  Fixes the other new part of bug
4790         374600.
4791
4792 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
4793
4794         * class.c: New functions mono_method_can_access_field_full and
4795         mono_method_can_access_method_full. They perform type visibility
4796         and type site check.
4797
4798         * class-internal.h: Added exported functions.
4799
4800         * verify.c: Use new functions to implement proper visibility checks.
4801
4802 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
4803
4804         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
4805
4806 2008-03-28  Dick Porter  <dick@ximian.com>
4807
4808         * process.c (process_get_fileversion): Use the first language ID
4809         we see, rather than insisting on an invariant language.  Fixes bug
4810         374600.
4811
4812 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
4813
4814         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
4815         the streams to fix reading of invalid memory later.
4816
4817         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
4818         to ease debugging.
4819
4820 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
4821
4822         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
4823         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
4824
4825 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
4826         * threads.h: Added MonoThreadManageCallback type and
4827         mono_thread_set_manage_callback prototype
4828         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
4829         (used to store the mono_thread_manage callback).
4830         * threads.c: Added mono_thread_set_manage_callback, and handle
4831         "MonoThread->manage_callback" in build_wait_tids.
4832
4833 2008-03-26  Dick Porter  <dick@ximian.com>
4834
4835         * process.c (process_get_fileversion): Set FileVersionInfo strings
4836         to Empty when the resource doesn't have the particular info.
4837         Fixes bug 355717.
4838
4839 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
4840
4841         * verify.c (mono_method_verify): Proper prefix validation.
4842
4843 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
4844
4845         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
4846         itself in a separate argument instead of throwing them. Fixes #373448.
4847
4848         * appdomain.c: Bump corlib version.
4849
4850 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
4851
4852         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
4853
4854 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
4855
4856         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
4857         version macros.
4858
4859 2008-03-20  Mark Probst  <mark.probst@gmail.com>
4860
4861         * generic-sharing.c, class-internals.h: Code for putting
4862         reflection types into the runtime generic context.
4863
4864 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
4865
4866         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
4867         Fixes #340662. 
4868
4869
4870 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
4871
4872         * verify.c (VerifyContext): Added instruction prefix data to the struct.
4873
4874         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
4875
4876         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
4877
4878         * verify.c (do_cast): Let the result value keep the boxed status.
4879
4880         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
4881
4882 2008-03-17  Jb Evain  <jbevain@novell.com>
4883
4884         * reflection.c: when running on a 2.0 runtime, emit
4885         unconditionally the #~ header version as 2.0, and the
4886         CLI header version as 2.5, for symmetry's sake with csc.
4887
4888 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
4889
4890         * class.c: Remove the unused cache_interface_offsets stuff.
4891
4892         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
4893         profiler.c: Fix warnings.
4894
4895 2008-03-16  Mark Probst  <mark.probst@gmail.com>
4896
4897         * generic-sharing.c, class-internals.h: Support for putting
4898         methods into the runtime generic context.
4899
4900 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
4901
4902         * class.c (mono_class_setup_fields): Ignore calls made to this function for
4903         classes which are generic instances of not-yet finished typebuilders. Fixes
4904         #351172.
4905
4906         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
4907
4908 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
4909
4910         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
4911
4912         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
4913         field, replace it with a hash table in MonoDynamicImage.
4914
4915         * reflection.c (inflate_mono_method): Access the generic definition object from
4916         image->generic_def_objects instead of imethod->reflection_info.
4917
4918         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
4919
4920         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
4921         
4922         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
4923         function in reflection.c so it is easier to keep in sync with the dynamic image
4924         creation code.
4925
4926         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
4927         mono_image_close ().
4928
4929 2008-03-15  Mark Probst  <mark.probst@gmail.com>
4930
4931         * class.c (mono_class_generic_sharing_enabled): Disable generic
4932         sharing for all architectures except AMD64 and x86 to fix build.
4933
4934 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
4935
4936         * verify.c: Use the generic definition MonoGenericContext when available.
4937         Remove code for checking generics instance compatibility in favor of
4938         mono_class_is_assignable_from.
4939
4940 2008-03-14  Mark Probst  <mark.probst@gmail.com>
4941
4942         * marshal.c, marshal.h, metadata-internals.h, image.c,
4943         wrapper-types.h: New wrapper for invoking a shared static method
4944         without having to pass the runtime generic context argument.
4945
4946 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
4947
4948         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
4949
4950 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
4951
4952         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
4953         
4954         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
4955         create a token from a FieldOnTypeBuilderInst.
4956         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
4957         (resolve_object): Ditto.
4958
4959         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
4960         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
4961
4962 2008-03-14  Martin Baulig  <martin@ximian.com>
4963
4964         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
4965
4966         * debug-mono-symfile.h
4967         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
4968         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
4969
4970 2008-03-10  Martin Baulig  <martin@ximian.com>
4971
4972         * debug-mono-symfile.h
4973         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
4974         `lexical_block_table_offset'.
4975         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
4976         `lexical_blocks'.
4977         (MonoSymbolFile): Added `version'.
4978
4979         * mono-debug.h
4980         (MonoDebugLexicalBlockEntry): Removed.
4981         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
4982         `lexical_blocks'.
4983
4984         * mono-debug.c (mono_debug_add_method): Don't compute lexical
4985         blocks here; the debugger now does this internally.
4986
4987 2008-02-27  Martin Baulig  <martin@ximian.com>
4988
4989         * object.c (mono_runtime_exec_main): Call
4990         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
4991         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
4992
4993 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4994
4995         * verify.c (verify_type_compatibility_full): Allow native int to be converted
4996         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
4997
4998 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4999
5000         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
5001         ldftn with a virtual method.
5002
5003 2008-03-13  Geoff Norton  <gnorton@novell.com>
5004
5005         * decimal.c:  Only include memory.h if the platform has it.
5006
5007 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
5008
5009         * assembly.c, class.c, metadata-internals.h: make sure public key
5010         tokesns are compared in a case-insensitive way. Also, all
5011         the lookups in the GAC use a lowercase public key token
5012         (gaacutil already does the lowercasing on install). Fixes
5013         bug #369541.
5014
5015 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
5016
5017         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
5018         and return value.
5019
5020 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
5021
5022         * image.c: when someone loads a mscorlib from a file, return the
5023         currently loaded mscorlib (fixes bug #369253).
5024
5025 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
5026
5027         * class.c: handle types with no parents by forcing them to have
5028         System.Object as a parent and marking them as broken (this currently
5029         allows the first part of bug #369173 to work as well, likely because
5030         we don't check for typeload exceptions everywhere yet).
5031
5032 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
5033
5034         * class.c: more complete check that types belong to corlib
5035         (fixes second part of bug #369173).
5036
5037 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
5038
5039         * generic-sharing.c:  Including glib.h for the MSVC builds to define
5040           "inline" to "__inline" before including mono-membar.h.
5041           
5042         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
5043           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
5044           MSVC builds.
5045
5046         Contributed under MIT/X11 license.
5047
5048 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
5049
5050         * verify.c (do_invoke_method): Remove return type validation.
5051
5052         * verify.c (do_ret): Do return type validation at return site instead of
5053         call site.
5054
5055 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
5056
5057         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
5058
5059         * verify.c: Some todos cleaned and improved a few error messages.
5060
5061 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
5062
5063         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
5064
5065 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
5066
5067         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
5068         system types correctly.
5069
5070         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
5071         function.
5072
5073 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
5074
5075         * assembly.c (build_assembly_name): Fix a warning.
5076
5077 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
5078
5079         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
5080         the called function takes an object type argument. Fixes storing or
5081         valuetypes across remoting as well as reducing memory usage.
5082         * image.c, metadata-internals.h: remove now unused ldfld_remote and
5083         stfld_remote wrapper caches.
5084
5085 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
5086
5087         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
5088         is not found.
5089
5090         * reflection.c (mono_image_register_token): New helper function to save
5091         a token->object mapping.        
5092
5093         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
5094         managed code.
5095
5096         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
5097         one dimension arrays. Fixes #367670.
5098         (mono_reflection_get_type_internal): Ditto.
5099
5100 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
5101
5102         * marshal.c: mono_load_remote_field_new() always returns object.
5103         so use the proper signature (fixes bug #366445).
5104
5105 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
5106         
5107         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
5108         add an 'inline_failure' flag instead.
5109
5110 2008-03-04  Mark Probst  <mark.probst@gmail.com>
5111
5112         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
5113         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
5114         contains the location of "this", used for exception handling.
5115
5116 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
5117
5118         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
5119         their size on all platforms for perf reasons.
5120
5121 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
5122
5123         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
5124         object-internal.h
5125
5126         * object-internal.h: Same.
5127
5128 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
5129
5130         * reflection.h: Fix the build I just broke.
5131
5132 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
5133
5134         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
5135         Test if a token is valid, this remove explicit usage of 
5136         MonoDynamicImage::tokens from the verifier code.
5137
5138         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
5139
5140         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
5141         instead of direct access to MonoDynamicImage::tokens.
5142
5143 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
5144
5145         * verify.c (token_bounds_check): Fix the build I just broke.
5146
5147 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
5148
5149         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
5150
5151         * verify.c (verifier_load_method): Fixed the errors message.
5152
5153         * verify.c (mono_method_verify): Fixed a debug message.
5154
5155 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
5156
5157         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
5158         mono-perfcounters.h, class-internals.h: support for predefined
5159         writable counters, query of categories and counters, bugfixes.
5160
5161 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
5162
5163         * verify.c (do_refanytype): Verify the refanytype opcode.
5164
5165         * verify.c (mono_method_verify): Use do_refanytype.
5166
5167 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
5168
5169         * verify.c (do_mkrefany): Verify the mkrefany opcode.
5170
5171         * verify.c (mono_method_verify): Use do_mkrefany.
5172
5173 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
5174
5175         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
5176         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
5177         implementation.
5178
5179 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
5180
5181         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
5182         the type load exception.
5183
5184 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
5185
5186         * verify.c: Added a few FIXME for method signatures
5187
5188         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
5189         of mono_method_get_signature and get vararg call working. Removed unused
5190         checks for return value.
5191
5192         * verify.c (do_refanyval): Verify the refanyval opcode.
5193
5194         * verify.c (mono_method_verify): Implemented verification of arglist and
5195         use do_refanyval.
5196
5197 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
5198
5199         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
5200         vtypes to marshal.c.
5201
5202         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
5203         it works for AOT as well.
5204
5205 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
5206
5207         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
5208         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
5209         the system time is adjusted.
5210
5211 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
5212
5213         * icall.c, icall-def.h: use the new time functions (fixes the
5214         non-monotonic behaviour of TickCount).
5215
5216 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
5217
5218         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
5219         it breaks the build.
5220         
5221         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
5222         cattr is not finished yet.
5223
5224 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
5225
5226         * verify.c: Proper token validation for field, method and type.
5227
5228 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
5229
5230         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
5231
5232         * loader.c (method_from_memberref): Generate type load error instead of method missing
5233         if the type is not found.
5234
5235 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
5236
5237         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
5238         some of the conversions caused the generation of a marshal directive exception.
5239
5240 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
5241
5242         verify.c: Report which exception should be thrown by the JIT.
5243         Added a lot of FIXME notes.
5244
5245 2008-02-22  Mark Probst  <mark.probst@gmail.com>
5246
5247         * generic-sharing.c: Runtime generic context slots are not
5248         instantiated on init anymore.  Instead, provide function to do the
5249         instantiating on demand.
5250
5251         * class-internals.h: Added vtable to runtime generic context.
5252         Macros for encoding direct and indirect slot offsets in one
5253         guint32.
5254
5255 2008-02-21  Mark Probst  <mark.probst@gmail.com>
5256
5257         * object.c, generic-sharing.c: Moved some generic sharing code
5258         from object.c to generic-sharing.c.
5259
5260         * generic-sharing.c: Added support for extensible runtime generic
5261         context.
5262
5263         * metadata-internals.h: Two new hash tables in MonoImage for
5264         extensible runtime generic context support.
5265
5266         * domain.c: Unregister generic vtables upon domain unloading.
5267
5268         * image.c: Destroy new hash tables upon image unloading.
5269
5270         * metadata.c: Unregister generic subclasses upon image unloading.
5271
5272         * class-internals.h: New data structure for runtime generic
5273         context template.  New fields in the runtime generic context for
5274         extensible part.
5275
5276         * Makefile.am: Added generic-sharing.c.
5277
5278 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
5279
5280         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
5281         there is a pending loader exception, raise it.
5282
5283         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
5284         same.
5285
5286         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
5287         same.
5288
5289         Fixes #363450.
5290
5291 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
5292
5293         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
5294
5295         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
5296         
5297         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
5298         ref-only requests for compatibility with MS.
5299
5300 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
5301
5302         * reflection.c (mono_custom_attrs_from_method): Don't silently
5303         return an empty list for generic method instances.
5304         (mono_custom_attrs_from_param): Likewise.
5305
5306 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
5307             Raja R Harinath  <harinath@hurrynot.org>
5308
5309         Fix #354757
5310         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
5311         * class.c (mono_class_inflate_generic_method_full): Initialize it
5312         when a fully-open method is instantiated.
5313         * metadata.c (inflated_method_equal, inflated_method_hash): Update
5314         to new field.
5315         * reflection.c (inflate_mono_method): Don't create a temporary context.
5316
5317 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
5318
5319         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
5320         Compute correct value, to prepare for imethod->reflection_info going away.
5321
5322 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
5323
5324         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
5325
5326 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
5327
5328         * verify.c: Implement skip visibility flag.
5329
5330 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
5331
5332         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
5333         which contains an extra field to tell the kind of exception that should be thrown.
5334
5335         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
5336
5337 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
5338
5339         * loader.c (mono_method_get_param_names): Initialize 'klass' after
5340         'method' is updated.
5341
5342 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
5343
5344         * class.c (mono_class_layout_fields): Set class->min_align for classes using
5345         explicit layout as well. Fixes #360375.
5346
5347 2008-02-11  Geoff Norton  <gnorton@novell.com>
5348
5349         * loader.c: Guard and dereference against inflated generic methods
5350
5351 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
5352
5353         * class.c: Include Retargetable spec in assembly name.
5354         * assembly.c: Always include PublicKeyToken spec in assembly name
5355         (with value "null" if assembly is not signed), and include
5356         Retargetable spec.
5357         * icall-def.h: Added icall for Assembly.get_fullname.
5358         * icall.c: Added icall returning the fullname of an assembly.
5359
5360 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
5361
5362         * class.c (mono_class_setup_vtable_general): Add a missing call to
5363         mono_class_setup_methods () which is needed in the AOT case.
5364
5365 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
5366
5367         * verify.c (mono_type_get_stack_name): Added. Return the name for the
5368         stack type of the given MonoType.
5369
5370         * verify.c (verify_type_compatibility_full): Handle the void type.
5371
5372         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
5373         way stack merging works.
5374
5375         * verify.c (store_local): Improved verification message.
5376
5377         * verify.c (do_branch_op): If the merging is invalid, the method
5378         is unverifiable and not invalid. Improved error message.
5379
5380         * verify.c (merge_stacks): Properly merge a boxed valuetype and
5381         a reference type diferent than System.Object. Improved error
5382         message.
5383
5384 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
5385
5386         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
5387
5388         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
5389         type of an enum even if the argument is byref.
5390
5391         * verify.c: Replace all explicit uses of enumtype and enum_basetype
5392         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
5393
5394         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
5395
5396         *verify.c (verify_type_compatibility_full): Make enum types
5397         compatible with their base types.
5398
5399         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
5400         types are compatible for the special case of a boxed valuetype and
5401         System.Object.
5402
5403         * verify.c (verify_stack_type_compatibility): The function
5404         is_compatible_boxed_valuetype was extracted from here.
5405
5406         * verify.c (push_arg): Only set ctx->has_this_store if the method
5407         is not static.
5408
5409         * verify.c (do_ldelem): Fixed a typo in an error message and added
5410         strict check for mixing int32 and native int as the array type
5411         and ldelem type.
5412
5413         * verify.c (merge_stacks): Consider boxed valuetypes in the
5414         compatibility checks.
5415
5416 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
5417         * profiler.h: (MonoGCEvent): Added start-stop the world events.
5418
5419 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
5420         *class.c: use_new_interface_vtable_code: renamed the env var to have
5421         a "MONO_" prefix, and fix the logic to enable it by default.
5422
5423 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
5424         *class.c:
5425         mono_class_setup_vtable_general: rewrote the way in which interface
5426         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
5427         makes the code more maintainable.
5428         For now the old code is still there, and can be activated setting
5429         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
5430
5431 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
5432
5433         * verify.c: guarded some debug functions around and #ifdef.
5434
5435         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
5436
5437 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
5438
5439         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
5440         changes for now since they seem to break too many things.
5441
5442 2008-02-05  Mark Probst  <mark.probst@gmail.com>
5443
5444         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
5445         mono_marshal_find_nonzero_bit_offset): Added macro and function
5446         for finding the byte- and bit-offset of a bitfield within a
5447         struct.
5448
5449 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
5450
5451         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
5452         (mono_marshal_get_struct_to_ptr): Ditto.
5453
5454         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
5455         cctor_signature.
5456
5457 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
5458
5459         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
5460         between methods for non-corlib types.
5461
5462 2008-02-02  Geoff Norton  <gnorton@novell.com>
5463
5464         * loader.c (mono_method_get_param_names): Populate the parameter name for 
5465         generic parameters as well. (Fixes #342536)
5466
5467 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
5468
5469         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
5470
5471         * verify.c (do_invoke_method): Fix for calling with byref structs.
5472
5473         * verify.c (do_cast): push a boxed value type based on the type token and not
5474         the type of stack.
5475
5476 2008-01-31  William Holmes  <billholmes54@gmail.com>
5477
5478         * process.c (process_module_string_read): Check the size returned form 
5479           VerQueryValue to avoid out of memory exception. 
5480
5481 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
5482
5483         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
5484         Handle properly modules which are not in the moduleref table. Fixes
5485         #356938.
5486
5487 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
5488
5489         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
5490         the dynamic case which is now in managed code.
5491         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
5492
5493         * marshal.c (mono_string_to_bstr): Fix a warning.
5494         (init_com_provider_ms): Ditto.
5495
5496         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
5497
5498         * exception.c (mono_get_exception_out_of_memory): New helper function.
5499
5500 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
5501
5502         * marshal.c: Add support for BSTR marshalling
5503         using other COM systems.
5504
5505         Code is contributed under MIT/X11 license.
5506
5507 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
5508
5509         * object.c (mono_runtime_invoke_array): reverted previous
5510         commit as it breaks the build.
5511
5512 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
5513
5514         * object.c (mono_runtime_invoke_array): Verify arguments for
5515         invalid types. Fixes #348522.
5516
5517 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
5518
5519         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
5520         non-final virtual calls using call. 
5521
5522         * verify.c (do_invoke): fixed some TODOs.
5523
5524         * verify.c (push_arg): set has_this_store for "ldarga 0".
5525
5526 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
5527
5528         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
5529         which belong to an inflated class. Fixes #356531.
5530
5531 2008-01-26  Robert Jordan  <robertj@gmx.net>
5532
5533         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
5534         which resort to FindFirstFile when a certain error condition
5535         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
5536         Code is contributed under MIT/X11 license.
5537
5538 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
5539
5540         * marshal.c (emit_marshal_string): Fix out string marshalling
5541         to use specified encoding. Fixes #323900.
5542
5543         Code is contributed under MIT/X11 license.
5544
5545 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
5546
5547         * class.c (mono_class_inflate_generic_method_full): Don't modify
5548         iresult->context after cache check.
5549
5550 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
5551
5552         * class.c (mono_class_inflate_generic_method_full): Change the
5553         struct assignments to memcpy for better visibility and add some comments.
5554
5555 2008-01-23  Dick Porter  <dick@ximian.com>
5556
5557         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
5558         procedure, and make it work on windows.
5559
5560 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
5561
5562         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
5563         a MonoReflectionTypeBuilder since it is always of that type.
5564
5565         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
5566
5567         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
5568
5569         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
5570         
5571         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
5572
5573         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
5574
5575         * reflection.c (mono_reflection_create_runtime_class): Remove already created
5576         instantiations from the type cache.
5577
5578 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5579
5580         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
5581
5582         * verify.c (do_unbox_value): push a controled mutability managed pointer.
5583
5584 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5585
5586         * verify.c (do_ldstr): added, verifies if the #US token is valid.
5587
5588         * verify.c (mono_method_verify): removed old TODO
5589
5590 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5591
5592         * verify.c (do_newobj): add visibility check.
5593
5594 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5595
5596         * verify.c (do_load_function_ptr): add visibility check.
5597
5598 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
5599         *class.c:
5600         mono_generic_class_get_class: hook profiler events.
5601         mono_field_get_offset: added to support heap-shot in the new profiler.
5602         *class.h: exported mono_field_get_offset.
5603         * reflection.c:
5604         mono_reflection_setup_internal_class: hook profiler events.
5605
5606 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
5607
5608         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
5609         argument here too and use it to avoid checking for pending exceptions if 
5610         possible.
5611
5612 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
5613
5614         * assembly.c (build_assembly_name): add arg for passing the assembly
5615         flags. Do not consider a PublicKey with value "null" valid.
5616         (mono_assembly_name_parse_full): added boolean argument that will be
5617         set if the assembly name contains a PublicKeyToken spec. Added support
5618         for the Retargetable spec for which only Yes or No are allowed as valid
5619         value. Consider assembly name invalid if Retargetable spec is set, but
5620         either version, culture or public key (token) are not specified.
5621         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
5622         with implementation in assembly.c.
5623         * icall.c (fill_reflection_assembly_name): also copy assembly flags
5624         from MonoAssemblyName.
5625         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
5626         introduced argument for mono_assembly_name_parse_full to know if the
5627         assembly name has a PublicKeyToken spec, and if it has instruct
5628         fill_reflection_assembly_name to use default value for keyToken (if
5629         PublicKeyToken is null).
5630
5631 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
5632
5633         * verify.c (mono_method_verify): fixed ovf ops with
5634         float values. They are unverifiable now.
5635
5636 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
5637
5638         * class.c (set_failure_from_loader_error): add BadImageException to the
5639         list of exceptions that can cause a type to fail to load.
5640
5641         * class.c (mono_class_get_exception_for_failure): same.
5642
5643 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
5644
5645         * verify.c (in_any_exception_block): added, check if offset
5646         is part of any exception handling clause.
5647
5648         * verify.c (get_stack_type): added VAR and MVAR types.
5649
5650         * verify.c (do_stobj): better error messages.
5651
5652         * verify.c (do_cpobj): added, check cpobj.
5653
5654         * verify.c (do_initobj): added, check initobj.
5655
5656         * verify.c (do_sizeof): added, check sizeof.
5657
5658         * verify.c (do_localloc): added, check localloc.
5659
5660         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
5661
5662 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
5663
5664         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
5665         save_lmf/restore_lmf opcodes.
5666
5667         * threads.c (mono_threads_install_notify_pending_exc): New function to
5668         install a callback notifying the JIT there is a pending exception on a thread.
5669         (mono_thread_request_interruption): Call the new callback.
5670         (mono_thread_get_and_clear_pending_exception): New function to return the
5671         exception pending on a thread.
5672
5673         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
5674         to turn off checking for pending exceptions.
5675         (mono_marshal_get_native_wrapper): Ditto.
5676
5677 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
5678
5679         * threads-types.h: Get rid of the unnecessary extern declarations.
5680
5681 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
5682
5683         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
5684         return field from parent class if not private.
5685         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
5686         returns fields from parent class if they are not private.
5687         (method_nonpublic): added function to determine if a given method
5688         should be considered non-public. Returns false for private methods
5689         on parent class, and internal methods from parent on the 1.0 profile.
5690         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
5691         use method_nonpublic function to determine whether method should be
5692         returned.
5693         (property_accessor_public): use newly introduced method_nonpublic
5694         function to determine whether accessor is non-public. 
5695         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
5696         event from parent class if not private. Only return static event if
5697         Static flag is set, and only return static event from parent class if
5698         FlattenHierarchy flag is set.
5699         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
5700         include non-private events from parent class.
5701
5702 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
5703
5704         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
5705         warning.
5706
5707 2008-01-16  Wade Berrier <wberrier@novell.com>
5708
5709         * security.c: Add assembly.h header to appease some warnings
5710
5711 2008-01-16  Dick Porter  <dick@ximian.com>
5712
5713         * process.c (process_module_string_read): Remove trailing null
5714         when saving string.
5715
5716 2008-01-16  Mark Probst  <mark.probst@gmail.com>
5717
5718         * class-internals.h: A new data structure describing the layout of
5719         a runtime generic context (MonoRuntimeGenericContextTemplate).
5720
5721         * metadata-internals.h: Added a hash table to MonoDomain that maps
5722         from open generic classes to their runtime generic context
5723         templates.
5724
5725         * object.c: Building of the runtime generic context, including
5726         proper handling of generic type arguments of superclasses.
5727         Building of the runtime generic context according to the template.
5728
5729 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
5730
5731         * class.c (mono_class_setup_fields): Set field.count for generic instances.
5732         Fixes #350856.
5733
5734         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
5735         mono_portability_find_file (). Fixes #325466.
5736         (mono_image_get_public_key): Fix a warning.
5737
5738 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
5739
5740         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
5741         Fixes #353550.
5742         (mono_class_from_name_case): Ditto.
5743
5744 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
5745
5746         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
5747           common storage for the tables used in the System/NumberFormatter class.
5748
5749 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
5750
5751         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
5752
5753 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
5754
5755         * verify.c (get_boxable_mono_type): check if the token is valid.
5756
5757         * verify.c (set_stack_value): changed to add an error if an
5758         invalid type is set on stack. Changed all callers due to signature change.
5759
5760         * verify.c (do_stobj): implement stobj validation.
5761
5762 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
5763
5764         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
5765         set container->is_method, it was set earlier.
5766
5767         * metadata.c (type_in_image): Handle MVARs which belong to not finished
5768         generic methods.
5769
5770         * reflection.c (mono_reflection_initialize_generic_parameter): Set
5771         is_method of the generic container to TRUE for methods.
5772
5773 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
5774
5775         * metadata.c (type_in_image): Handle type parameters properly.
5776
5777         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
5778         memory ownership of this structure.
5779
5780 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
5781
5782         * verify.c (get_boxable_mono_type): make typedref types been just
5783         unverifiable. check for void type.
5784
5785         * verify.c (do_unbox_any): added, verify opcode unbox.any.
5786
5787         * verify.c (do_load_function_ptr): accept method spec tokens.
5788
5789 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
5790
5791         * marshal.c (mono_class_native_size): Always set *align even if this is called
5792         recursively.
5793
5794 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
5795
5796         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
5797         out-of-date.
5798
5799 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
5800
5801         * verify.c: removed some old unused tables. A huge bunch of small fixes
5802         to things found while testing the verifier with mono basic.
5803
5804         * verify.c (dump_stack_value): dump null literal flag to.
5805
5806         * verify.c (verify_type_compatibility_full): fix comparison
5807         for types that have a generic super type.
5808
5809         * verify.c (verify_stack_type_compatibility): fix compatibility
5810         between null literals and reference types. fix compatibility between
5811         boxed valuetypes and object. fix corner case test for enums.
5812
5813         * verify.c (do_cmp_op): proper verification of cgt.un in case
5814         of reference types.
5815
5816         * verify.c (do_invoke_method): fix error message.
5817
5818         * verify.c (do_store_indirect
5819
5820         * verify.c (check_is_valid_type_for_field_ops): proper verification
5821         of managed pointers to valuetypes and boxed valuetypes. proper verification
5822         of null literals.
5823
5824         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
5825         allow token to be a reference type.
5826
5827         * verify.c (do_cast): proper handling of boxes valuetypes.
5828
5829         * verify.c (do_stelem): proper handling of storing a boxed valuetype
5830         in object[].
5831
5832         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
5833         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
5834         fixed the decoding of unbox_any
5835
5836 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
5837
5838         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
5839
5840 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
5841
5842         * verify.c (do_newobj): do delegate verification.
5843
5844         * verify.c (verify_delegate_compatibility): perform delegate
5845         verification.
5846
5847         * verify.c (verify_ldftn_delegate): perform tests related to
5848         ldftn delegates.
5849
5850         * verify.c (mono_delegate_signature_equal): perform the
5851         slightly diferent signature comparison required by delegates.
5852
5853         * metadata.c (mono_metadata_type_equal_full): added and exported
5854         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
5855         allows signature only comparison.
5856
5857         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
5858         as MONO_INTERNAL.
5859
5860 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
5861
5862         * verify.c: added a bunch of stack_slot_* functions to
5863         make access to stack slot type easier. This is required to
5864         allow optional flags, like null literal, boxed value and
5865         this pointer.
5866         All access paths to IlStackDesc::stype have been changed 
5867         to use these new funcions.
5868         Removed a bunch of unused functions and cleared all warnings.
5869         This patch introduces the usage of the this pointer and 
5870         boxed value flags.
5871
5872 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
5873
5874         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
5875
5876 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
5877
5878         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
5879         match managed version.
5880
5881         * appdomain.c: Bump corlib version.
5882         
5883         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
5884         argument.
5885
5886 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
5887
5888         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
5889         Set public key token to zero-length byte array if assembly is not
5890         strongnamed.
5891
5892 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
5893
5894         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
5895         writing a vtype array elem.
5896
5897 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
5898
5899         * assembly.c (build_assembly_name): return FALSE if length of token is
5900         not 16 (if not "null").
5901         (mono_assembly_name_parse_full): return FALSE if value of version,
5902         culture, token or key is 0.
5903         * icall.c (fill_reflection_assembly_name): add boolean arguments to
5904         specify whether public key and public key token must be set to default
5905         value (zero-length byte array) if not available. Set versioncompat to
5906         SameMachine. If public key is available or the default is set, then
5907         set PublicKey flag.
5908         (ves_icall_System_Reflection_Assembly_FillName): if no public key
5909         is available, use empty byte array as default value. On the 2.0
5910         profile, use default value for public key token if not set.
5911         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
5912         profile, use default value for public key if not set. On the 2.0
5913         profile, use default value for public key token if not set.
5914         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
5915         default values for public key and public key token.
5916
5917 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
5918
5919         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
5920         field to keep it in synch with the managed object.
5921
5922         * marshal.c (emit_marshal_object): Add support for byref marshalling of
5923         delegates. Fixes #351520.
5924
5925         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
5926         contains defined memory.
5927         
5928         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
5929
5930         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
5931         
5932         * sgen-gc.c (check_consistency): New helper function to do a consistency check
5933         of the GC data structures.
5934
5935         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
5936
5937         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
5938         
5939         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
5940         barrier.
5941         (mono_array_clone_in_domain): Ditto.
5942         (mono_array_clone_in_domain): Ditto.
5943
5944         * threads.c (start_wrapper): Register the thread start argument as a GC root.
5945         (cache_culture): Use a write barrier.
5946
5947         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
5948         (ves_icall_get_property_info): Ditto.
5949
5950         * object.h (MONO_STRUCT_SETREF): New macro.
5951
5952         * class-internals.h (MonoStats): Add some GC statistics.
5953
5954         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
5955
5956 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
5957
5958         * exception.c (mono_exception_from_name_two_strings):
5959         Break from loop after method is found.
5960
5961 2008-01-04  Dick Porter  <dick@ximian.com>
5962
5963         * process.c (process_module_string_read): Rename variable to
5964         reflect correct usage, after fixing bug 345972.
5965
5966 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
5967
5968         * verify.c (mono_type_create_fnptr_from_mono_method): 
5969         created a MonoType function pointer instance to be used during
5970         verification. The verifier releases this memory at end.
5971
5972         * verify.c (mono_method_is_constructor): extracted repeated
5973         checks for constructor into a single class.
5974
5975         * verify.c (do_push_field): use new extracted method
5976         for constructor check.
5977
5978         * verify.c (do_newobj): same.
5979
5980         * verify.c (do_ldftn): renamed to do_load_function_ptr
5981         and make it verify ldvirtftn too.
5982
5983         * verify.c (mono_method_verify: proper verification
5984         of ldvirtftn. release created MonoMethod instances.
5985
5986 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
5987
5988         * verify.c (token_bounds_check): added.
5989
5990         * verify.c (do_ldftn): added.
5991
5992         * verify.c (mono_method_verify): proper verificartion of ldftn.
5993
5994 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
5995
5996         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
5997         than the table row count. It's the resposibility of the caller to
5998         make the bounds check and raise the correct error.
5999
6000         * metadata.c (mono_metadata_decode_row_col): Same.
6001
6002         * loader.c (mono_get_method_from_token): perform bounds check
6003         on token for methoddef table.
6004
6005 2007-12-29  Miguel de Icaza  <miguel@novell.com>
6006
6007         * icall.c
6008         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
6009         assert into a negative result, the managed code already coped with
6010         that.
6011
6012         Some folks on Windows reported this error. 
6013
6014 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
6015
6016         * appdomain.c: Bump corlib version.
6017         * icall.c:
6018         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
6019         CultureInfo.CreateCulture to create CultureInfo for name.
6020         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
6021         create CultureInfo for name. Fixes bug #347174.
6022
6023 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
6024
6025         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
6026         flags.
6027
6028         * verify.c (is_valid_branch_instruction): allow branching to the
6029         first instruction of the protected block.
6030
6031         * verify.c (is_valid_cmp_branch_instruction): same.
6032
6033         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
6034         avoid double initialization.
6035
6036         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
6037         detect which cases the eval stack should just be copied.
6038
6039         * verify.c (mono_method_verify): check if the eval stack
6040         is empty when entering a protected block.
6041
6042 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
6043
6044         * verify.c: added is_clause_in_range, is_clause_inside_range,
6045         is_clause_nested and verify_clause_relationship. They perform
6046         the verifications stated in P1 12.4.2.7.
6047
6048         * verify.c (mono_method_verify): remove some unused variables,
6049         add the new exception clause checks, add instruction border
6050         checks for protected block start/end, improved some error 
6051         messages and fixed a bug in the way invalid instruction access
6052         is detected.
6053
6054 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
6055
6056         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
6057         from GC 7.0 if available.
6058
6059         * object.c: Remove an unused define.
6060         
6061         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
6062
6063         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
6064
6065         * null-gc.c (mono_gc_make_descr_for_array): Implement.
6066
6067         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
6068
6069         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
6070         to take the same arguments as the other make_descr functions.
6071
6072         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
6073
6074         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
6075         directly.
6076
6077         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
6078         mini.c.
6079
6080         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
6081         call to boehm-gc.c.
6082
6083         * boehm-gc.c (mono_gc_register_root): Fix a warning.
6084
6085         * null-gc.c (mono_gc_register_root): Fix a warning.
6086
6087         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
6088
6089         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
6090         (mono_gc_base_init): Call GC_init ().
6091
6092         * null-gc.c: Define mono_gc_register_root () as a no-op.
6093
6094         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
6095
6096 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
6097
6098         * verify.c: add prototype for merge_stacks at top
6099
6100         * verify.c (do_switch): added.
6101
6102         * verify.c (merge_stacks): on some cases the stack merging
6103         was not happening properly. Unequal stack sizes at merge
6104         points should be invalid.
6105
6106         * verify.c (mono_method_verify): added more debug info on stack state.
6107         verify switch properly.
6108
6109 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
6110
6111         * method-builder.h: New file, moved the mono_mb_ declarations here from 
6112         marshal.h.
6113
6114         * boehm-gc.c marshal.c: Include method-builder.h.
6115
6116         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
6117
6118         * marshal.c: Remove some code which is now in method-builder.c.
6119
6120 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
6121
6122         * method-builder.c: New file, extraction of the method builder functionality 
6123         from marshal.c.
6124
6125         * marshal.c: Move the mb functions into method-builder.c.
6126
6127         * marshal.h marshal.c: Export some mono_mb_... functions.
6128
6129         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
6130
6131         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
6132         the caller.
6133
6134         * class.c (mono_class_get_full): Check the token type in the dynamic case.
6135
6136         * loader.c (mono_field_from_token): Ditto.      
6137
6138         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
6139         type as well.
6140         
6141         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
6142         Fixes #342565.
6143
6144         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
6145         a helper function for setting it.
6146
6147         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
6148
6149         
6150         * assembly.c: Significally simplify code now that referenced assemblies are 
6151         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
6152
6153         * threads.h: Don't include  the internal threads-types.h header file. Fixes
6154         #349952.
6155
6156 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
6157
6158         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
6159         instructions that were target of branches or are at protected block boundaries.
6160
6161         * verify.c (in_same_block): handle filter clauses.
6162
6163         * verify.c (is_valid_branch_instruction): added. checks the target of
6164         instructions br or brtrue/false.
6165
6166         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
6167         binary branch instructions such as beq and bge.
6168
6169         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
6170         and made it pin the instruction as been part of the exception block.
6171
6172         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
6173         of in_same_block.
6174
6175         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
6176         of in_same_block.
6177
6178         * verify.c (do_ret): ret from a protected block is unverifiable and
6179         not invalid.
6180
6181         * verify.c (do_static_branch): verify br and br.s instructions.
6182
6183         * verify.c (merge_stacks): add extra param to support detection
6184         of branches in the middle of instructions.
6185         
6186         * verify.c (mono_method_verify): verify branches and exception blocks
6187         that target the middle of instructions. Proper verification of br and br.s.
6188
6189 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
6190
6191         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
6192         skip_visibility field.
6193         (reflection_methodbuilder_from_dynamic_method): Ditto.
6194
6195         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
6196         registrations. Fixes #348193.
6197
6198         * threads.h: Move the internal mono_thread_get_pending_exception () to
6199         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
6200
6201 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
6202
6203         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
6204         icall registration. Fixes #348193.
6205
6206         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
6207         for corlib classes into object. Fixes #349621.
6208
6209 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
6210
6211         * icall.c (property_accessor_nonpublic): new function to determine
6212         whether an accessor allows a property to be considered non-public.
6213         Returns false for private accessor(s) from parent class, and internal
6214         accessor(s) from parent on 2.0 profile (and higher).
6215         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
6216         to determine whether property should be included if NonPublic flag
6217         is set. Fixes bug #349078.
6218
6219 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
6220
6221         * verify.c (init_stack_with_value): added.
6222
6223         * verify.c (mono_method_verify): extracted common
6224         code for exception initialization into init_stack_with_value.
6225
6226         * verify.c (mono_method_verify): initialize the exception
6227         for handler clauses as well.
6228
6229         * verify.c (mono_method_verify): fix the exception clause
6230         ordering rules, it should use handler end offset and not
6231         start offset.
6232
6233 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
6234
6235         * rawbuffer.c: remove useless warning.
6236
6237 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
6238
6239         * threads.h, threads-types.h: move functions to the correct header
6240         (fixes bug#349952).
6241
6242 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
6243
6244         * verify.c (mono_method_verify): proper verification
6245         of exception handling clauses ranges and fallthru in
6246         and out of protected blocks.
6247
6248 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
6249
6250         * verify.c (mono_method_verify): fixed compilation issue.
6251
6252 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
6253
6254         * verify.c (mono_method_verify): a printf slipped in, changed
6255         to use verifier debug macro.
6256
6257 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
6258
6259         * verify.c (is_correct_leave): check for filter clauses.
6260
6261         * verify.c (do_filter): added.
6262
6263         * verify.c (mono_method_verify): property verification of leave.
6264
6265
6266 2007-12-18  Mark Probst  <mark.probst@gmail.com>
6267
6268         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
6269         Win32 build, until we figure out how to do the proper thing on
6270         Win32.
6271
6272 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
6273
6274         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
6275         by the previous patch.
6276         
6277         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
6278         the assembly resolve handler for refonly assemblies.
6279
6280 2007-12-17  Mark Probst  <mark.probst@gmail.com>
6281
6282         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
6283         Make sure only one thread is allowed to commence shutdown, and
6284         don't allow new threads to be started once shutdown is in
6285         progress.
6286
6287 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
6288
6289         * verify.c (is_correct_endfilter): added.
6290
6291         * verify.c (is_unverifiable_endfilter): added.
6292
6293         * verify.c (do_endfilter): added.
6294
6295         * verify.c (mono_method_verify): property verification of endfilter
6296         and fixed a corner case or endfinally.
6297
6298 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
6299
6300         * verify.h: new flags to support fail fast of unverifiable code and
6301         do non-strict verification. Non-strict verification is required to
6302         have MS runtime compatibility. There are a huge amount of unverifiable
6303         code that it accepts as verifiable. The strict mode verifies the code
6304         as the specs says.
6305         Non-strict mode will be required in cases where code needs to be
6306         accepted as verifiable but fails under strict mode.
6307
6308         * pedump.c: added support to fail fast and non-strict verification.
6309
6310         * verify.c: added support for both fail fast and non-strict verification.
6311
6312 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
6313
6314         * verify.c (is_correct_endfinally): added.
6315
6316         * verify.c (mono_method_verify): property verification of endfinally.
6317
6318 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
6319
6320         * verify.c (in_any_block): check for filter clauses.
6321
6322         * verify.c (is_correct_rethrow): added.
6323
6324         * verify.c (mono_method_verify): property verification of rethrow.
6325
6326         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
6327
6328 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
6329
6330         * verify.c (do_throw): added.
6331
6332         * verify.c (mono_method_verify): property verification of throw
6333
6334 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
6335
6336         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
6337         assemblies. Fixes #346425.
6338
6339 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
6340
6341         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
6342         FieldBuilders.
6343
6344         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
6345
6346         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
6347         prevent asserts when this is called with a token which might not be valid.
6348
6349         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
6350         lookup_dynamic_token_class with valid_token == FALSE.
6351
6352         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
6353
6354         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
6355
6356         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
6357         
6358 2007-12-10  Mark Probst  <mark.probst@gmail.com>
6359
6360         * gc.c: Don't delay threadpool thread finalization unless Mono is
6361         shutting down.
6362
6363 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
6364
6365         * threads.c: turn an assert into a non-fatal warning.
6366
6367 2007-12-09  Robert Jordan  <robertj@gmx.net>
6368
6369         * icall.c (GetVirtualMethod): Add missing argument validation.
6370
6371 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6372
6373         * verify.c (do_cast): added.
6374
6375         * verify.c (mono_method_verify): property verification of castclass and isinst.
6376
6377
6378 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6379
6380         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
6381
6382         * verify.c (do_stelem): added.
6383
6384         * verify.c (mono_method_verify): property verification of stelem.X.
6385
6386 2007-12-07  Mark Probst  <mark.probst@gmail.com>
6387
6388         * class.c, class-internals.h: Introduce an environment variable
6389         (MONO_GENERIC_SHARING) through which the extent of generic code
6390         sharing can be controlled (share all classes, share only corlib
6391         classes, or share nothing).
6392
6393         * object.c: Only create runtime generic context for classes for
6394         which sharing is enabled.
6395
6396 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6397
6398         * verify.c (do_ldelem): refactor it to work with ldelem.any.
6399
6400         * verify.c (mono_method_verify): property verification of ldelem.any.
6401
6402 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
6403
6404         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
6405         added ldelem.X opcodes.
6406
6407         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
6408
6409         * verify.c: proper verification of ldelem.X 
6410
6411 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
6412
6413         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
6414
6415 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
6416
6417         * verify.c (mono_method_verify): null literal requires special handling,
6418         the value pushed on stack need to be flagged as so.
6419
6420         * verify.c (do_ldelema): Verify ldelema properly.
6421
6422 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
6423
6424         * verify.c: Verify ldlen properly.
6425
6426 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
6427
6428         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
6429         to the target object's type. Fixes #346160.
6430
6431 2007-12-05  Dick Porter  <dick@ximian.com>
6432
6433         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
6434         Solaris needs the same workaround as BSD-derived systems.  Fixes
6435         bug 323524, patch by Burkhard Linke
6436         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
6437
6438 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
6439
6440         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
6441         handle to use when error dialog is shown; otherwise, update mask
6442         to show no error dialog when an error occurs.
6443
6444 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
6445
6446         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
6447
6448         * class.c (mono_class_get_field_default_value): New helper function to initialize
6449         field->def_type and field->data.
6450
6451 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
6452
6453         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
6454         the general one.
6455
6456         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
6457
6458         * marshal.c: Avoid depending on delegate->method_info being set.
6459
6460         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
6461         
6462         * object.c (mono_delegate_ctor): Set delegate->method.
6463
6464         * object-internals.h (struct _MonoDelegate): Add 'method' field.
6465
6466         * appdomain.c: Bump corlib version.
6467
6468 2007-11-27  Raja R Harinath  <harinath@gmail.com>
6469
6470         * metadata.c (mono_generic_inst_equal_full): Short-circuit
6471         equality check if we're comparing canonicalized MonoGenericInsts.
6472
6473 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
6474
6475         * class.c (generic_array_methods): Call mono_class_setup_methods () before
6476         accessing class->methods.
6477
6478 2007-11-22  Dick Porter  <dick@ximian.com>
6479
6480         * threads.c: Ensure that the synch_cs is set before trying to use
6481         it.
6482
6483 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
6484
6485         * profiler.c: r89126 broke the statistial profiler, unbreak.
6486
6487 2007-11-22  Martin Baulig  <martin@ximian.com>
6488
6489         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
6490
6491         * mono-debug.c
6492         (mono_debug_debugger_version): Bump to 3.
6493         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
6494         -> mono_debugger_class_initialized().
6495
6496         * mono-debug-debugger.c
6497         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
6498
6499         * class.c
6500         (mono_debugger_start_class_init_func): Removed.
6501         (mono_debugger_class_loaded_methods_func): Added.
6502         (mono_class_setup_methods): Call it here.
6503
6504 2007-11-22  Martin Baulig  <martin@ximian.com>
6505
6506         * mono-debug.c
6507         (mono_debug_add_delegate_trampoline): New public method.
6508         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
6509
6510         * mono-debug.h
6511         (MonoSymbolTable): Added `global_data_table'.
6512         (MonoDebuggerTypeKind): Removed.
6513
6514 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
6515
6516         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
6517         these methods.
6518
6519         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6520         
6521 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
6522
6523         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
6524
6525 2007-11-20  Martin Baulig  <martin@ximian.com>
6526
6527         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
6528
6529         * mono-debug-debugger.c
6530         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
6531         (mono_debugger_remove_breakpoint): Likewise.
6532         (mono_debugger_check_breakpoints): Likewise.
6533         (mono_debugger_register_class_init_callback): New public method.
6534         (mono_debugger_remove_class_init_callback): Likewise.
6535         (mono_debugger_add_type): Likewise.
6536
6537         * mono-debug-debugger.h
6538         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
6539
6540 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
6541
6542         * class.c: more interface implementations needed for the
6543         array enumerator (fixes bug #341112).
6544
6545 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
6546
6547         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
6548         fix ParamName of ArgumentNullExceptions.
6549
6550 2007-11-17  Miguel de Icaza  <miguel@novell.com>
6551
6552         * reflection.c (mono_reflection_encode_sighelper): Generate the
6553         modopts and modreqs.   I have a useless test that crashes monodis,
6554         but that shows the code working.
6555
6556 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
6557
6558         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
6559         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
6560
6561 2007-11-15  Dick Porter  <dick@ximian.com>
6562
6563         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
6564         When joining a thread, it's the thread that's calling Join that
6565         gets WaitSleepJoin state not the target.  Fixes the standalone
6566         test case in bug 334740, and hopefully the whole bug too.
6567
6568 2007-11-15  Dick Porter  <dick@ximian.com>
6569
6570         * process.c: Read file version info from the files pointed at by
6571         process modules, not the current process.  Fixes bug 315969.
6572
6573         Use windows typedef names in some places to fix warnings on the
6574         windows build.
6575
6576 2007-11-15  Mark Probst  <mark.probst@gmail.com>
6577
6578         * image.c, metadata-internals.h: Added a generic_class_cache hash
6579         to MonoImage for looking up generic classes when sharing generics.
6580
6581 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
6582
6583         * sgen-gc.c: warning cleanups.
6584
6585 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
6586
6587         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
6588         inherited properties.
6589
6590 2007-11-14  Mark Probst  <mark.probst@gmail.com>
6591
6592         * object.c, class-internals.h: Added more information to the
6593         runtime generic context.
6594
6595 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
6596
6597         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
6598         instead of just the target method. Generalize the abstract method handling to
6599         handle any non-static method.
6600
6601         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
6602         mono_marshal_get_delegate_invoke () signature change.
6603
6604 2007-11-13  Mark Probst  <mark.probst@gmail.com>
6605
6606         * class.c, class-internals.h: Made
6607         mono_type_get_basic_type_from_generic () public.  Fixed member
6608         access check for shared generics.
6609
6610         * loader.c: Don't insert field into field cache if it's part of a
6611         non-inflated generic class.
6612
6613         * domain.c, domain-internals.h: The generic sharing context is now
6614         part of the jit info data structure.  Added two accessor
6615         functions.
6616
6617 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
6618
6619         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
6620         the array Get/Set/Address methods, since the JIT inlines them.
6621
6622         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
6623
6624         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
6625         (mono_image_init): Initialize runtime_invoke_direct_cache.      
6626
6627         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
6628         mono_marshal_get_delegate_invoke signature change.
6629
6630         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
6631         an additional argument. Add support for invoking abstract methods.
6632
6633         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
6634
6635         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
6636
6637 2007-11-09  Mark Probst  <mark.probst@gmail.com>
6638
6639         * class.c: Do field layout for open generic classes as well.
6640
6641 2007-11-09  Mark Probst  <mark.probst@gmail.com>
6642
6643         * gc.c, gc-internal.h: Don't finalize threadpool threads with
6644         other objects, because the threadpool is still around.  Put them
6645         in a list instead and after finalizing all other objects in the
6646         root domain shut down the thread pool and then finalize the
6647         threads.  Fixes bug #337383.
6648
6649         * threads.c, thread-types.h: New mono_thread_create_internal()
6650         function for marking a thread with the threadpool flag before it
6651         started.  Set synch_cs to NULL after freeing it.
6652
6653         * threadpool.c: Mark threadpool threads before they start.
6654
6655 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
6656
6657         * reflection.h, reflection.c: don't export random functions
6658         and lazy load dbnull and missing objects.
6659
6660 2007-11-07  Jonathan Chambers <joncham@gmail.com>
6661
6662         * class.c: Initialize COM types if COM interfaces
6663         are present (not just COM classes).
6664         
6665         Code is contributed under MIT/X11 license.
6666
6667 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
6668         * reflection.c:
6669         create_dynamic_mono_image: hook module profiler events (dynamic case).
6670         mono_image_basic_init: hook assembly profiler events (dynamic case).
6671
6672 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
6673         * profiler.c:
6674         simple_appdomain_unload: completely terminate the profiler
6675         instead of only processing the statistical samples.
6676         simple_shutdown: make sure this is really called exactly once,
6677         even in multithreaded applications, and always listen to
6678         appdomain events.
6679         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
6680         here, the "[un]load" functions will do it.
6681         Fixes bugs #333791 and #325261.
6682
6683 2007-11-07  Geoff Norton  <gnorton@novell.com>
6684
6685         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
6686         rather than depend on __APPLE__.
6687
6688 2007-11-07  Mark Probst  <mark.probst@gmail.com>
6689
6690         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
6691
6692 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
6693
6694         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
6695         UTF16 MonoString. Fix the crash from bug #335488
6696
6697 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
6698
6699         * marshal.c: Correct (for non-Win32 OS) length != size in 
6700         mono_string_from_bstr. Fix #339530.
6701
6702 2007-11-06  Geoff Norton  <gnorton@novell.com>
6703
6704         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
6705         to succeed
6706
6707 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
6708
6709         * process.c: Added run-time GetProcessId API detection for Windows.
6710
6711 2007-11-04  Miguel de Icaza  <miguel@novell.com>
6712
6713         * reflection.c  (mono_param_get_objects): If a parameter has the
6714         attribute [System.Runtime.InteropServices.Optional] we should
6715         set the DefaultValue of the ParameterInfo to be
6716         System.Reflection.Missing instead of DBNull.
6717
6718         See bug #339013.
6719
6720         (mono_get_reflection_missing_object): New method,
6721         returns the System.Reflection.Missing.Value singleton instance.
6722
6723 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
6724
6725         * culture-info-table.h : regenerated.
6726
6727 2007-11-02  Jonathan Chambers <joncham@gmail.com>
6728
6729         * icall.c: Use GetEnvironmentStrings on windows
6730         so we are using the same environment block as 
6731         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
6732         #333740.
6733         
6734         Code is contributed under MIT/X11 license.
6735
6736 2007-10-31  Martin Baulig  <martin@ximian.com>
6737
6738         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
6739
6740         * mono-debug-debugger.h
6741         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
6742
6743 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
6744
6745         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
6746         classes.
6747
6748 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
6749
6750         * culture-info-table.h : regenerated.
6751
6752 2007-10-30  Robert Jordan  <robertj@gmx.net>
6753
6754         * icall-def.h, icall.c:
6755         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
6756
6757         Code is contributed under MIT/X11 license.
6758
6759 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
6760
6761         * class.c (mono_class_setup_vtable): Find the inflated methods in the
6762         inflated class instead of inflating them again.
6763         
6764         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
6765         dynamic case.
6766
6767         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
6768         Call setup_supertypes () after klass->parent is set.
6769         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
6770
6771         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
6772         for inflated instances of not yet created dynamic generic classes.
6773         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
6774         times from inflated_method.
6775         (methodbuilder_to_mono_method): Ditto.
6776
6777 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
6778
6779         * gc.c: code cleanup and removed old untested option of not creating the
6780         finalizer thread.
6781
6782 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
6783
6784         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
6785         creating a jump trampoline for dynamic methods.
6786
6787 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
6788
6789         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
6790         generic TypeBuilders when called from another method of the same type (bug #335131).
6791
6792
6793 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
6794
6795         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
6796         doesn't seem to work perfectly.
6797         
6798         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
6799         called multiple times.
6800         (methodbuilder_to_mono_method): Ditto.
6801         (resolve_object): Inflate FieldBuilder's.
6802
6803 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
6804
6805         * string-icalls.c, string-icalls.h, appdomain.c: patch from
6806         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
6807         RemoveEmptyEntries in the string.Split implementation (bug #322375).
6808
6809 2007-10-26  Dick Porter  <dick@ximian.com>
6810
6811         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
6812         Thread initialisation changes
6813
6814 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
6815
6816         * verify.c: fix compatibility check between arrays and System.Array
6817
6818 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
6819
6820         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
6821         too. Fixes #336999.
6822
6823 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
6824
6825         * object.c (mono_value_box): Use typed allocation here.
6826
6827 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
6828
6829         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
6830         trampoline instead of compiling the method right away.
6831
6832         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
6833
6834 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
6835
6836         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
6837         related fields for dynamic classes. Fixes #334493.
6838
6839 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
6840
6841         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
6842         
6843         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
6844
6845         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
6846         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
6847
6848         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
6849
6850         * reflection.c (create_generic_typespec): Initialize klass->generic_container
6851         if needed.
6852         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
6853
6854 2007-10-18  Jonathan Chambers <joncham@gmail.com>
6855
6856         * marshal.c: Use correct key when removing item
6857         from ccw_hash.
6858         
6859         Code is contributed under MIT/X11 license.
6860
6861 2007-10-17  William Holmes  <billholmes54@gmail.com>
6862
6863         *marshal.c: Adding a case to marshal booleans to U1
6864
6865         Code is contributed under MIT/X11 license.
6866
6867 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
6868
6869         * class.c (mono_class_from_name): Search the modules compromising dynamic
6870         assemblies. Fixes #331601.
6871
6872 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
6873
6874         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
6875         exception if the type name contains an assembly component. Fixes #334203.
6876
6877         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
6878         modules inside dynamic assemblies. Fixes #334200.
6879         
6880         * reflection.c: Set image->public_key and image->public_key_length;
6881
6882         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
6883         fields.
6884
6885         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
6886         
6887 2007-10-16  Mark Probst  <mark.probst@gmail.com>
6888
6889         * metadata.c: Implemented correct comparing of generic classes.
6890         An inflated generic class can be equal to a non-inflated one if it
6891         is inflated with generic type variables as type arguments.  Fixes
6892         bug #333798.
6893
6894 2007-10-15  Dick Porter  <dick@ximian.com>
6895
6896         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
6897         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
6898         81646.
6899
6900         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
6901         instead of a monitor lock.  This means that monitor_try_enter and
6902         co can set the thread state safely.
6903         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
6904         thread_interrupt_requested, so interrupt actually works.
6905
6906         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
6907         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
6908         state accessor function
6909
6910 2007-10-15  Martin Baulig  <martin@ximian.com>
6911
6912         * mono-debug.h
6913         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
6914         the debugger with the current runtime.
6915
6916 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
6917
6918         * object.c, object-internals.h: added the ability to set a single
6919         trampoline for all the slots in a vtable.
6920
6921 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6922
6923         * marshal.c: deal with a possible race condition during multicast
6924         delegate invocation.
6925
6926 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6927
6928         * class.c: ensure value type methods don't have the synchronized
6929         flag set.
6930
6931 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
6932
6933         * string-icalls.c, string-icalls.h: reverted unapproved patch that
6934         breaks the build.
6935
6936 2007-10-11  Joel Reed  <joelwreed@comcast.com>
6937
6938         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
6939         to take an options parameter so that empty entries can be removed during
6940         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
6941
6942 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
6943
6944         * marshal.c: make sure we don't store the signature from a dynamic
6945         method into the runtime invoke cache (bug #327189).
6946
6947 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
6948
6949         * marshal.c: make sure the wrapper methods are properly initialized.
6950
6951 2007-10-11  Mark Probst  <mark.probst@gmail.com>
6952
6953         * metadata.c, metadata-internals.h: Generalized
6954         mono_type_stack_size() to mono_type_stack_size_internal() which
6955         takes an additional argument specifying whether it allows open
6956         types.
6957
6958 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
6959
6960         * verify.c (do_invoke_method): handle typedbyref params
6961         correctly and check for unverifiable return values.
6962
6963         * verify.c (do_newobj): fix a warning.
6964
6965 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
6966
6967         * verify.c: don't tread typedbyref as allways unverifable,
6968         so uses, like (ld/st)loc.0 are valid. verify for the cases
6969         that it matters, like boxing related operations.
6970
6971 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
6972
6973         * verify.c: add verification of the newobj opcode. verification
6974         of delegate instantation still missing due ldftn and virldftn not
6975         pushing the function type on stack
6976
6977 2007-10-08  Mark Probst  <mark.probst@gmail.com>
6978
6979         * class-internals.h: Runtime generic context data structure
6980         definition.
6981
6982         * object.c: Initialization of runtime generic context at runtime
6983         vtable creation time.
6984
6985 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
6986         * class.c (mono_class_create_from_typedef,
6987         mono_class_from_generic_parameter, mono_ptr_class_get,
6988         mono_fnptr_class_get, mono_bounded_array_class_get)
6989         * domain.c (mono_domain_create, mono_domain_free)
6990         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
6991         * image.c (do_mono_image_load, mono_image_close):
6992         Hooked up load-unload profiler events.
6993
6994 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
6995
6996         * domain.c: track statistics about the actual amount of native code
6997         allocated.
6998
6999 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
7000
7001         * class.c: the valuetype enumerators don't have the additional
7002         supertypes interfaces.
7003
7004 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
7005
7006         * class.c: need more interfaces setup for the IEnumerator<T>
7007         object created for arrays (tests/ienumerator-interfaces.2.cs).
7008
7009 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
7010
7011         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
7012
7013 2007-10-05  Alp Toker  <alp@atoker.com>
7014
7015         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
7016         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
7017         #315863.
7018
7019 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
7020
7021         * verify.c (verify_type_compatibility_full): verification of
7022         compatibility improved, validates correctly non-strict checks between
7023         native int and I4 types different than (unsigned)int32.
7024
7025         * verify.c (do_store_indirect): added, do all verification of
7026         ldind.X opcodes. 
7027
7028         * verify.c (get_load_indirect_mono_type): renamed to
7029         get_indirect_op_mono_type, as it now returns the MonoType for 
7030         ldind.X and stind.X opcodes.
7031
7032 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
7033
7034         * reflection.c: Fix the encoding of generic type definition for
7035         TypeBuilders.
7036
7037         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
7038         mono_image_typedef_or_ref but allows to specify if typespec lookups should
7039         be made. Typespec check is done prior to typeref cache lookup.
7040
7041         * reflection.c (mono_image_typedef_or_ref): now just delegate to
7042         mono_image_typedef_or_ref_full.
7043
7044         * reflection.c (encode_generic_class): encode the generic class
7045         directly instead of calling encode_type.
7046
7047         * reflection.c (encode_type): encode the generic type definition
7048         MonoClass as a generic instantiation.
7049
7050         * reflection.c (create_typespec): cache typespec tokens in
7051         the assembly->typespec cache. Don't create typespec for a generic
7052         instance MonoClass. Create typespec for the generic type defintion.
7053
7054         * reflection.c (create_generic_typespec): encode the generic
7055         class directly instead of calling encode_type.
7056
7057         * reflection.c (mono_image_create_token): encode the generic
7058         type definition not using a typespec for MonoType instances.
7059
7060
7061 2007-10-04  Raja R Harinath  <rharinath@novell.com>
7062
7063         Fix #328812
7064         * class.c (mono_image_init_name_cache): Don't return nested
7065         'protected internal' classes.
7066         (mono_class_from_name_case): Likewise.
7067
7068 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
7069
7070         * icall-def.h, icall.c : get_bundled_machine_config() is now the
7071           common function used by both DefaultConfig in System.dll and
7072           InternalConfigurationHost in System.Configuration.dll.
7073
7074 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
7075
7076         * class.c: automatically add to vectors only a few essential explicit
7077         generic interfaces. The rest of the interfaces that arrays should
7078         provide are currently implicitly added (but still not lazily, see the
7079         design in the discussion of bug#325495 for the details of what is
7080         needed for that). Additionally, implicit interfaces are assigned the
7081         same vtable slot as the explicit interfaces (as they are compatible):
7082         this enables huge memory savings since we don't need to instantiate
7083         as many memthods and as large vtables anymore. Also, Since
7084         GetEnumerator<T> returns an instance of a type that is required to
7085         support a similarly large set of interfaces as arrays, we add
7086         implicit interfaces and interface offset sharing support to those
7087         types, too. This change adds all the required interfaces so that
7088         the anonarray.cs test case in the bug report works (we don't add
7089         all the interfaces to arrays of arrays 3-level deep and more because
7090         of the memory requirements explained in the bug and since they are much
7091         less common: the lazy-loading support will enabled them to work, too).
7092
7093 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
7094
7095         * verify.c (merge_stacks): major clean up, all type compatibility
7096         checks are done by verify_type_compatibility. This fix my earlier lack
7097         of understanding of the CLR type system and merge_stacks no longer looks
7098         scary.
7099
7100         * verify.c: fixed some bad spelling.
7101
7102 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
7103
7104         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
7105         a given stack slock.
7106         
7107         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
7108         verify_type_compatibility_full. This removed a near indentical function and fixed
7109         handling of Int32 and IntPtr across all opcodes.
7110
7111 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
7112
7113         * class.c: only vectors have the additional generic interfaces.
7114
7115 2007-10-01  Jonathan Chambers <joncham@gmail.com>
7116
7117         * mono-config.c: Use g_strcasecmp instead of
7118         strcasecmp like everywhere else to fix
7119         compilation with MSVC.
7120         
7121         Code is contributed under MIT/X11 license.
7122
7123 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
7124
7125         * object.c, object-internals.h: refactored the IMT code to enable
7126         building a single slot at a time and lazily creating the IMT trampolines
7127         and thunks.
7128
7129 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
7130
7131         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
7132
7133         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
7134         Fixes #328501.
7135         
7136 2007-09-29  Raja R Harinath  <harinath@gmail.com>
7137
7138         * loader.c (method_from_methodspec): Rearrange to avoid
7139         un-necessary exposition.  Don't assert out if the method's
7140         declaring type is a generic type definition.
7141
7142 2007-09-28  Martin Baulig  <martin@ximian.com>
7143
7144         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
7145
7146 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
7147
7148         * class-internals.h: optimize field layout of MonoClass to
7149         requires less cachelines at runtime and save a few bytes on 64 bit
7150         systems.
7151
7152 2007-09-28  Jb Evain  <jbevain@novell.com>
7153
7154         * reflection.c: when encoding type names in custom attributes,
7155         if the type is a closed generic type, its generic arguments
7156         have to be serialized as AssemblyQualifiedName, so that when
7157         they are deserialized, it's possible to re-create them properly.
7158         Fixes #329450.
7159
7160
7161 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
7162
7163         * object.c, class-internals.h: added delegate-creation counter.
7164
7165 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
7166
7167         * class.c: cleanup of the code that synthetizes interfaces for
7168         arrays in 2.0: saves quit a bit of corlib mempool memory.
7169         Code to fix bug #325495 ifdeffed out for now until the issues
7170         with memory usage and O(n^2) behaviour are fixed.
7171
7172 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
7173
7174         * marshal.c: when possible, do not duplicate the name of the methods
7175         in the method builder and in the generated MonoMethod.
7176
7177 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
7178         * verify.c: added support for type checking ldind_* opcodes.
7179
7180 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
7181
7182         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
7183         which is used to distinguish the fully open instantiation of a TypeBuilder
7184         with the rest. This temporary hack is required to restore the property that
7185         the fully open instantiation is the same type of the generic type definition.
7186
7187         * class-internals.h (mono_generic_class_is_generic_type_definition):
7188         new function as part of the internal API.
7189
7190         * class.c (inflate_generic_type): return NULL when the generic inst is
7191         fully open. The fully open generic type is now the same as the generic type
7192         definition for non TypeBuilder types.
7193
7194         * class.c (mono_generic_class_get_class): removed assert since it is
7195         no longer valid, gklass->cached_class can point to the generic type definition.
7196
7197         * class.c (mono_generic_class_is_generic_type_definition): new.
7198
7199         * metadata.c (mono_generic_class_hash): added is_tb_open field
7200         to the hash calculation.
7201
7202         * metadata.c (free_generic_class): if the generic class is associated
7203         with the generic type definition, its field will come from the mempool and
7204         must not be freed.
7205
7206         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
7207         new, this function identifies the corner case of a TypeBuilder fully open
7208         instantiation.
7209
7210         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
7211         for lookup. Set gclass->cached_class to be the container class in case of
7212         the fully open instantiation of non TypeBuilder types.
7213
7214         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
7215         to compare generic classes.
7216
7217         * reflection.c (method_encode_methodspec): remove assert that
7218         no longer is valid.
7219
7220         * reflection.c (mono_reflection_generic_class_initialize): add
7221         an aditional assert to ensure the proper type is used.
7222
7223 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
7224
7225         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
7226         to enjoy it.
7227
7228 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
7229
7230         * verify.c (push_arg): Fixed support for ldarga
7231         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
7232         MonoType used as first arg in case of instance calls.
7233
7234 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
7235
7236         * verify.c: Support for verifying VAR and MVAR types, 
7237
7238 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
7239
7240         * icall.c (ves_icall_get_property_info): Set the reflected type of the
7241         accessors correctly.
7242
7243 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
7244
7245         * threads.c: support OSX and other systems in
7246         mono_thread_get_stack_bounds (bug #328026).
7247
7248 2007-09-25  Martin Baulig  <martin@ximian.com>
7249
7250         * mono-debug.h
7251         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
7252
7253 2007-09-24  Martin Baulig  <martin@ximian.com>
7254
7255         * mono-debug.h
7256         (MonoDebugClassEntry): Moved the definition of this struct into
7257         mono-debug.c to make it private.
7258
7259         * mono-debug.c
7260         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
7261         type table per symbol file, we don't need to store the symfile id
7262         any longer.
7263
7264 2007-09-24  Martin Baulig  <martin@ximian.com>
7265
7266         Create one type table per symbol file, since a `MonoClass *' gets
7267         invalid when its image is unloaded.
7268
7269         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
7270         (MonoDebugHandle): Added `type_table'.
7271
7272 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
7273
7274         * mempool.c, mempool.h: added mono_mempool_new_size () API
7275         to be able to specify a smaller initial size for the pool.
7276         Adjusted the code to slowly increase pool size before using
7277         the previous default size.
7278         * image.c: use a small initial size for image mempools.
7279
7280 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
7281
7282         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
7283         Fixes ##320990.
7284
7285         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
7286         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
7287
7288 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
7289
7290         * metadata.c (mono_type_create_from_typespec): Remove an invalid
7291         free. Fixes #327438.
7292
7293 2007-09-21  Raja R Harinath  <harinath@gmail.com>
7294
7295         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
7296         generic instantiations, etc.
7297         <MONO_TYPE_ARRAY>: Likewise.
7298
7299 2007-09-21  Martin Baulig  <martin@ximian.com>
7300
7301         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
7302         these structs were never defined.
7303         (MonoDebugHandle): Removed the `_priv' field, it was never used.
7304
7305 2007-09-21  Martin Baulig  <martin@ximian.com>
7306
7307         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
7308
7309 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
7310
7311         * image.c: removed the guid hash tables: we can get the same info
7312         without the additional memory usage hit (partially fixes also bug #327052).
7313
7314 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
7315
7316         * profiler.h, profiler-private.h, profiler.c: add a new profiler
7317         event to handle unloading methods. After the event is called, the
7318         corresponding MonoMethod* must be considered invalid.
7319         * loader.c (mono_free_method): call the new mono_profiler_method_free
7320         event.
7321
7322 2007-09-20  Mark Probst  <mark.probst@gmail.com>
7323
7324         * domain-internals.h: New flag in MonoJitInfo which marks shared
7325         generic methods.  New hash table (shared_generics_hash) in
7326         MonoDomain to keep track of shared generic methods.  Prototypes
7327         for functions to register and lookup shared generic methods.
7328
7329         * domain.c: Support for registering and looking up shared generic
7330         methods via a hash table (shared_generics_hash) in MonoDomain.
7331
7332         * class-internals.h: New exception to signal failure of shared
7333         compilation of a generic method.  New counters for generics
7334         sharing in MonoStats.
7335
7336 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
7337
7338         * image.c, metadata-internals.h: don't keep a file descriptor open
7339         for loaded assemblies (bug#325988).
7340
7341 2007-09-19  Raja R Harinath  <rharinath@novell.com>
7342
7343         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
7344         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
7345         use the corresponding datatypes.
7346         (type_in_image): Update to changes.
7347         (CleanForImageUserData): Simplify.
7348         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
7349         Avoid quadratic behaviour in handling the "stolen" list by
7350         separating the filter predicate out, and by prepending the stolen
7351         items rather than appending them.
7352         (steal_ginst_in_image): Likewise.
7353         (mono_metadata_clean_for_image): Update to changes.
7354
7355 2007-09-19  Martin Baulig  <martin@ximian.com>
7356
7357         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
7358
7359 2007-09-19  Martin Baulig  <martin@ximian.com>
7360
7361         * mono-debug.c (mono_debug_cleanup): Don't call
7362         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
7363
7364 2007-09-19  Raja R Harinath  <harinath@gmail.com>
7365
7366         Fix crash on 'make run-test' in mcs/errors
7367         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
7368         Avoid more potential allocations in mono_class_from_mono_type.
7369         (ginst_in_image): Update to changes.
7370         (gclass_in_image): Rearrange slightly.
7371
7372 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
7373
7374         * class.c (mono_class_init): Move the code that sets up class->methods to 
7375         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
7376
7377         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
7378         canonical instance of an inflated generic signature.
7379         (mono_type_create_from_typespec): Remove an invalid free.
7380
7381         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
7382
7383 2007-09-18  Marek Habersack  <mhabersack@novell.com>
7384
7385         * domain-internals.h: added a declaration of the
7386         mono_assembly_load_full_nosearch internal function.
7387
7388         * assembly.c (mono_assembly_load_with_partial_name): use
7389         mono_try_assembly_resolve return value properly.
7390         (mono_assembly_load_full_nosearch): copied the function body from
7391         mono_assembly_load_full, without the code to invoke assembly
7392         search hooks.
7393         (mono_assembly_load_full): calls the above new function and if the
7394         assembly is not resolved, invokes the search hooks.
7395
7396         * appdomain.c (mono_runtime_init): restore the global postload
7397         assembly search handlers.
7398
7399 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
7400
7401         * class.c (mono_class_init): Make sure class->methods and class->properties
7402         are never NULL in the generics case.
7403
7404         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
7405
7406 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
7407
7408         * metadata.c (free_generic_class): Disable some code to fix the build.
7409
7410         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
7411
7412         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
7413         from the image mempool.
7414
7415         * metadata.c (free_generic_class): Free more data from the inflated class.
7416
7417         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
7418
7419         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
7420         mempool.
7421         (mono_type_create_from_typespec): Ditto.
7422
7423         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
7424         MonoImage to the caller.
7425         (mono_init_internal): Save the opened image in a global variable.
7426         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
7427
7428         * reflection.c (resolve_object): Fix a leak.
7429
7430         * metadata.c: Fix the freeing of data in the generics caches.
7431         
7432         * metadata.c (free_generic_inst): Comment this out to fix the build.
7433         (free_generic_class): Ditto.
7434
7435         * metadata.c: Free cached generic methods, instantinations and classes when
7436         they are removed from the caches.
7437         (mono_metadata_free_type): Free the type itself.
7438
7439         * class.c: Free the result of mono_class_inflate_generic_type () in a few
7440         places.
7441
7442 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
7443
7444         * boehm-gc.c: restrict managed allocs to __thread supporting
7445         architectures.
7446
7447 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
7448
7449         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
7450         (mono_generic_class_get_class): Fix a leak.
7451
7452         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
7453         mono_metadata_free_type ().
7454         (mono_metadata_inflate_generic_inst): Fix a leak.
7455
7456 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
7457
7458         * mono-debug.c (free_header_data): Fix a leak missed earlier.
7459
7460         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
7461         mempool.
7462
7463         * mono-debug.c (mono_debug_close_image): Fix call to 
7464         g_hash_table_remove ().
7465
7466 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
7467
7468         * icall-def.h: redirect all the string ctor to the managed
7469         CreateString () methods.
7470         * string-icalls.c, string-icalls.h: removed dead code for string
7471         ctors and icalls.
7472
7473 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
7474
7475         * mono-debug.c: Fix memory leaks.
7476
7477 2007-09-14  Jonathan Chambers <joncham@gmail.com>
7478
7479         * threads-types.h: Implement mono_hazard_pointer_set and 
7480         mono_hazard_pointer_clear macros using do/while(0) to fix
7481         compilation with MSVC.
7482         
7483         Code is contributed under MIT/X11 license.
7484
7485 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
7486
7487         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
7488         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
7489
7490 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
7491
7492         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
7493         icalls.
7494
7495 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
7496
7497         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
7498         managed-code allocated as well.
7499
7500 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
7501
7502         * class.c (mono_class_is_assignable_from): Add support for generic variance.
7503
7504 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
7505
7506         * boehm-gc.c: fixed the build after the AOT changes.
7507
7508 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
7509
7510         * wrapper-types.h: Add an ALLOC wrapper type.
7511
7512         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
7513         reference managed allocator methods.
7514
7515 2007-09-12  Marek Safar  <marek.safar@gmail.com>
7516
7517         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
7518         of Type array and not MonoType, a fix suggested by Hari.
7519         
7520 2007-09-12  Jonathan Chambers <joncham@gmail.com>
7521
7522         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
7523         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
7524         
7525         Code is contributed under MIT/X11 license.
7526
7527 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
7528
7529         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
7530
7531 2007-09-12  Marek Habersack  <mhabersack@novell.com>
7532
7533         * image.c (do_mono_image_open): if assembly file fails to open and
7534         MONO_IOMAP is in effect, try to find the path in a
7535         case-insensitive way.
7536
7537         * appdomain.c (mono_runtime_init): do not install postload hooks -
7538         tests show that MS.NET doesn't use anything of that sort to
7539         trigger the AppDomain.AssemblyResolve event.
7540         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
7541         made non-static.
7542         (mono_runtime_init): init portability helpers here.
7543
7544         * assembly.c (mono_assembly_load_with_partial_name): if other   
7545         attempts fail, trigger the AppDomain.AssemblyResolve event handler
7546         to resolve the assembly.
7547
7548         * domain-internals.h: added mono_try_assembly_resolve and marked
7549         it as internal.
7550
7551 2007-09-11  Jb Evain  <jbevain@novell.com>
7552
7553         * object-internals.h (MonoReflectionDynamicMethod): add
7554         a `MonoReflectionType *owner` field. The owner is used
7555         * reflection.c:
7556         (mono_reflection_create_dynamic_method): use the owner of the dynamic
7557         method as the class declaring the dynamic method.
7558         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
7559         dynamic method to the declaring type of the methodbuilder.
7560
7561 2007-09-11  Mark Probst  <mark.probst@gmail.com>
7562
7563         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
7564         rules for calling methods via reflection.
7565
7566 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
7567
7568         * reflection.c (resolve_object): Add support for MonoGenericClass. 
7569         Inflate MonoType's.
7570
7571 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
7572
7573         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
7574         provide a managed method that does fast allocations without needing
7575         a managed->unmanaged transition. Boehm GC implementation currently
7576         enabled for ptrfree objects on sane architectures.
7577
7578 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
7579
7580         * marshal.c, marshal.h: exported a couple of useful functions and
7581         added mono_mb_get_label () to easily handle backward branches.
7582
7583 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
7584
7585         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
7586
7587 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
7588
7589         * loader.c (find_method): Fixed the regression introduced while
7590         fixing bug #81466.
7591
7592 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
7593
7594         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
7595         well.
7596         
7597         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
7598         icall.c reflection.c: Pass a MonoGenericContext argument to 
7599         mono_lookup_dynamic_token ().
7600
7601         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
7602         #82744.
7603         
7604 2007-09-09  Robert Jordan  <robertj@gmx.net>
7605
7606         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
7607         for generic methods.
7608
7609         * object.c (mono_object_get_virtual_method): Handle generic methods.
7610         Fixes bug #78882.
7611
7612         Code is contributed under MIT/X11 license.
7613
7614 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
7615
7616         * image.c: fix locking in mono_image_load_file_for_image ().
7617
7618 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
7619
7620         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
7621         used only as a cache: added an icall to fill it.
7622
7623 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
7624
7625         * reflection.h: exposed mono_reflection_free_type_info
7626         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
7627         since mono_reflection_bind_generic_parameters makes a copy of it.
7628         * reflection.c (free_type_info): subinfos should be freed.
7629         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
7630         made non static.
7631         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
7632         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
7633         this fixes #82695 and #81726.
7634    
7635
7636 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
7637
7638         * process.h, process.c:  added support for user profile/info in
7639           ProcessStartInfo. For now only Windows works.
7640
7641 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
7642
7643         * metadata.c: consider the generic arguments when comparing
7644         signatures (bug #82614).
7645
7646 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
7647
7648         * cil-coff.h, image.c: updated assembly loader to cope with the
7649         PE32+ 64 bit file format.
7650
7651 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
7652
7653         * assembly.c, class.c, domain.c, loader.c: remove useless
7654         inclusion of cil-coff.h.
7655
7656 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
7657
7658         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
7659         if interface is marked with CoClassAttribute. 
7660    
7661         Code is contributed under MIT/X11 license.
7662
7663 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
7664
7665         * sgen-gc.c: ensure no object from the to space is copied again or finalized
7666         if it's seen twice in major collections.
7667
7668 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
7669
7670         * sgen-gc.c: big objects are not copied to the gray area, but they
7671         need to be considered for scanning, too, if they are brought alive
7672         by an object ready for finalizations or a survived one.
7673
7674 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
7675
7676         * sgen-gc.c: properly account the number of disappearing links when
7677         they are nullified.
7678
7679 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
7680
7681         * sgen-gc.c: share the code to scan the registered roots between the
7682         different types of collections.
7683
7684 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
7685
7686         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
7687
7688 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
7689
7690         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
7691         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
7692
7693 2007-08-28  Mark Probst  <mark.probst@gmail.com>
7694
7695         * security-manager.c (mono_security_manager_get_methods):
7696         LinkDemandSecurityException now has 2 arguments instead of 3.
7697
7698 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
7699
7700         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
7701         platforms which need it.
7702
7703 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
7704
7705         * sgen-gc.c: unregister thread data structures with a pthread_key_t
7706         dtor.
7707
7708 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
7709
7710         * threads.c: free the thread static data on thread exit.
7711
7712 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
7713
7714         * class.c: walk the hierarchy to find the generic definition for
7715         a class (fixes runtime part of bug #82498).
7716
7717 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
7718
7719         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
7720         ...
7721
7722         * image.c (mono_image_close): Here. Hopefully fixes #82510.
7723
7724 2007-08-24  Mark Probst  <mark.probst@gmail.com>
7725
7726         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
7727
7728 2007-08-24  Robert Jordan  <robertj@gmx.net>
7729
7730         * appdomain.c: don't perform the ':'->';' substitution on Win32.
7731
7732 2007-08-24  Jb Evain  <jbevain@novell.com>
7733
7734         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
7735         for byref types.
7736
7737 2007-08-24  Mark Probst  <mark.probst@gmail.com>
7738
7739         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
7740         #82286.
7741
7742 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
7743
7744         * assembly.c: Fix a warning.
7745         
7746 2007-08-23  Marek Habersack  <mhabersack@novell.com>
7747
7748         * appdomain.c: parse the <runtime> section looking for the probing
7749         element with the 'privatePath' attribute, which sets additional
7750         directories in which the runtime should look for assemblies.
7751
7752 2007-08-23  Robert Jordan  <robertj@gmx.net>
7753
7754         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
7755         Fixes #82499.
7756
7757 2007-08-23  Martin Baulig  <martin@ximian.com>
7758
7759         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
7760         _mono_debug_init_corlib() and remove it from the header file.
7761
7762 2007-08-23  Martin Baulig  <martin@ximian.com>
7763
7764         * mono-debug-debugger.c
7765         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
7766         don't notify the debugger about it.
7767
7768         * mono-debug-debugger.h
7769         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
7770
7771 2007-08-23  Robert Jordan  <robertj@gmx.net>
7772
7773         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
7774         Code is contributed under MIT/X11 license.
7775
7776 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
7777
7778         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
7779
7780 2007-08-22  Martin Baulig  <martin@ximian.com>
7781
7782         * mono-debug.c: Store debugging info on a per-domain basis and
7783         free it on domain unload.  Add support for unloading symbol files.
7784
7785         * mono-debug.h
7786         (MonoDebugList): New typedef.
7787         (MonoSymbolTable):
7788         - add `data_tables and `type_table'.
7789         - replace 'symbol_files' and `num_symbol_files' with a
7790           `MonoDebugList *'.
7791         (mono_debug_data_table): Removed.
7792         (mono_debug_list_add): New public function.
7793         (mono_debug_list_remove): New public function.
7794         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
7795         (mono_debug_init_2_memory): Renamed into
7796         mono_debug_open_image_from_memory().
7797         (mono_debug_close_image): New public function.
7798         (mono_debug_domain_create): Likewise.
7799         (mono_debug_domain_unload): Likewise.
7800         (MONO_DEBUGGER_VERSION): Bump to 60.
7801
7802         * mono-debug-debugger.h
7803         (MonoDebuggerEvent):
7804         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
7805         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
7806         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
7807         - rename `THREAD_CREATED' and `THREAD_EXITED' into
7808           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
7809         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
7810           meaning.
7811         (mono_debugger_add_symbol_file): Removed.
7812         (mono_debugger_add_type): Removed.
7813         (mono_debugger_lookup_type): Removed.
7814         (mono_debugger_lookup_assembly): Removed.
7815
7816         * domain.c
7817         (mono_domain_create): Call mono_debug_domain_create().
7818         (mono_init_internal): Call mono_debug_init_corlib().
7819
7820         * assembly.c
7821         (mono_assembly_close): Call mono_debug_close_image().
7822
7823 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
7824
7825         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
7826         mmap call.
7827
7828 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
7829
7830         * sgen-gc.c: ensure section->pin_queue_end is initialized
7831         correctly when non pinning objects in the section have been found.
7832
7833 2007-08-22  Marek Habersack  <mhabersack@novell.com>
7834
7835         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
7836         containing a list of directories separated by ':'. MSDN docs say
7837         the directories should be separated with ';'. Part of a bugfix for
7838         bug #81446
7839
7840 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
7841
7842         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
7843         it should MonoType and not MonoClass.
7844
7845 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
7846
7847         * culture-info-table.h : regenerated.
7848
7849 2007-08-20  William Holmes  <billholmes54@gmail.com>
7850
7851         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
7852          to call ReplaceFile Kernel32 on windows or in io-layer.
7853         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
7854         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
7855          as an internal call.
7856
7857         Code is contributed under MIT/X11 license.
7858
7859 2007-08-20  Jb Evain  <jbevain@novell.com>
7860
7861         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
7862         and MONO_EXCEPTION_FIELD_ACCESS.
7863
7864         * debug-helpers.[c|h]: new mono_field_full_name function.
7865
7866 2007-08-20  Mark Probst  <mark.probst@gmail.com>
7867
7868         * class.c: Removed class_security_level() and moved it to
7869         security-core-clr.c.
7870
7871         * security-core-clr.c, security-core-clr.h: class_security_level()
7872         is now public and renamed to mono_security_core_clr_class_level().
7873         It also looks for security attributes in the classes a class is
7874         nested in.
7875
7876 2007-08-20  Mark Probst  <mark.probst@gmail.com>
7877
7878         * security-core-clr.c, security-core-clr.h: CoreCLR security
7879         utility functions.
7880
7881         * Makefile.am: Added security-core-clr.[ch].
7882
7883         * security-manager.c, security-manager.h: Functions and enum for
7884         setting and getting the security mode.
7885
7886         * class.c: CoreCLR security checks.
7887
7888 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
7889
7890         * icall-def.h, process.c, process.h: implemented icall to get
7891         user/system processor times.
7892
7893 2007-08-17  Mark Probst  <mark.probst@gmail.com>
7894
7895         * domain.c, threads.c, class-internals.h, domain-internals.h: New
7896         reader-lock-free jit_info_table.
7897
7898 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
7899
7900         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
7901
7902         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
7903
7904         * object-internals.h (MonoException): Add missing _data member.
7905
7906 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
7907
7908         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
7909         checking that only methods with matching qname or fqname are picked
7910         from implemented interfaces.
7911
7912 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
7913
7914         * verify.c (do_newarr):added, do type verification of
7915         newarr ops, push the right value on the eval stack.
7916         * verify.c (mono_method_verify): use do_newarr
7917
7918
7919 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
7920
7921         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
7922         factored the common code into get_boxable_mono_type, which
7923         is now using mono_type_get_full, this fixed byref related tests.
7924
7925 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
7926
7927         * class.c: added mono_type_get_full, this function has the same
7928         behavior of mono_class_get_full but the returned MonoType has
7929         all metadata of the associated token in case of a typespec token.
7930         * class.c: added mono_type_retrieve_from_typespec, used by 
7931         mono_type_get_full to retrieve the token type.
7932         * class.c (mono_class_create_from_typespec): changed to use
7933         mono_type_retrieve_from_typespec.
7934         * class.c (mono_ldtoken): changed to use mono_type_get_full
7935         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
7936         * class-internals.h: exported mono_type_get_full for internal use.
7937
7938 2007-08-16  Jb Evain  <jbevain@novell.com>
7939
7940         * domain.c (supported_runtimes): add entry for
7941         the 'moonlight' runtime version.
7942
7943 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7944
7945         * verify.c (mono_method_verify): small typo sliped in.  
7946
7947 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7948
7949         * verify.c (do_unbox_value): added, do type verification of
7950         unboxing ops
7951         * verify.c (mono_method_verify): use do_unbox_value
7952
7953
7954 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7955
7956         * verify.c (dump_stack_value): fixed typo, was printing string
7957         instead of object on stack.
7958         * verify.c (do_box_value): moved the byref check up as it leads
7959         to invalid code and should be done earlier.
7960         * verify.c: improved error messages for and ldobj
7961
7962 2007-08-15  William Holmes  <billholmes54@gmail.com>
7963
7964         * marshal.c (emit_marshal_custom): Omit the call to 
7965           marshal_native_to_managed when calling native to managed 
7966           and the argument is specified as an out argument.
7967
7968         Code is contributed under MIT/X11 license.
7969
7970 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7971
7972         * verify.c: fixed the type checks for generics, function pointers and vectors.
7973         Added type verification for ldobj and ldtoken. The verifier
7974         would segfault if header or signature of a method contained references
7975         to non-existant types.
7976
7977 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
7978
7979         * marshal.c (cominterop_get_ccw): Patch from
7980         Bill Holmes to no walk up interface hierarchy. 
7981         All parent methods should be present in the interface for COM.
7982    
7983         Code is contributed under MIT/X11 license.
7984
7985 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
7986
7987         * marshal.c (emit_marshal_com_interface): Patch from
7988         Bill Holmes to handle COM Interfaces as return values
7989         for native->managed calls.
7990    
7991         Code is contributed under MIT/X11 license.
7992
7993 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
7994
7995         * marshal.c (cominterop_get_idispatch_for_object): Implement
7996         for runtime callable wrappers.
7997    
7998         Code is contributed under MIT/X11 license.
7999
8000 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
8001
8002         * pedump.c (main): changed from mono_init to mono_init_from_assembly
8003         so 2.0 types are accessible
8004
8005
8006 2007-08-13  Miguel de Icaza  <miguel@novell.com>
8007
8008         * domain.c (mono_init_internal): Call mono_assembly_load_friends
8009         once we load mscorlib.   Due to the order in which we initialize,
8010         the mono_assembly_load_full routine that loads mscorlib did not
8011         load friends.   We now load it once we load the
8012         mono_defaults.internals_visible_class class. 
8013
8014         * assembly.c: Expose the mono_load_friend_assemblies method.
8015
8016 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
8017
8018         * verify.c: improved the handling of boxing, better
8019         type checking for unary ops and conversion. Fix bug
8020         regarding managed pointer compatibility checking
8021
8022 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
8023
8024         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
8025
8026         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
8027
8028 2007-08-09  Raja R Harinath  <rharinath@novell.com>
8029
8030         * reflection.c (dup_type): Remove.
8031         * class.c (dup_type): Remove.
8032         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
8033         instead of the dodgy 'dup_type'.
8034         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
8035         handle the case where 'dup_type' needed the second argument.
8036
8037 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
8038
8039         * domain.c: Fix a warning.
8040
8041 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
8042
8043         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
8044         checking that methods with the same fqname are not overridden
8045         with a method from an ancestor.
8046
8047 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
8048
8049         * threads.c (free_thread_static_data_helper): Avoid a crash if
8050         thread->static_data is not yet set.
8051
8052 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
8053
8054         * marshal.c: Use correct image when emitting
8055         native wrapper for COM calls.
8056    
8057         Code is contributed under MIT/X11 license.
8058
8059 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
8060
8061         * icall-def.h, security.c, security.h :
8062           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
8063
8064 2007-08-07  Martin Baulig  <martin@ximian.com>
8065
8066         * mono-debug-debugger.h
8067         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
8068
8069         * domain.c (mono_domain_free): Call
8070         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
8071
8072 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
8073
8074         * verify.c (check_underflow, check_overflow): error message now returns IL offset
8075         * verify.c (in_same_block): code should test if either offset is inside the clauses
8076         * verify.c (mono_method_verify): push the exception into the eval stack of exception
8077         and filter blocks
8078
8079 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
8080
8081         * image.c (mono_image_close): Fix a leak.
8082
8083         * object.c (mono_runtime_invoke_array): Avoid using alloca.
8084
8085         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
8086
8087 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
8088
8089         * domain.c, threads.c, threads-types.h: fix memory retention issue
8090         with thread static variables not being cleared on domain unload.
8091         Reuse thread static slots after domain unload.
8092
8093 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
8094
8095         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
8096         nullable type.
8097
8098         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
8099         now done in mono_runtime_invoke_array.
8100
8101         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
8102         receiver is a nullable type.
8103
8104         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
8105         generic parameter.
8106
8107 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
8108
8109         * marshal.c: Implement COM Objects as return type for 
8110         managed->unmanaged calls. Added Release calls for COM Object
8111         out/return values in managed->unmanaged calls.
8112
8113         Code is contributed under MIT/X11 license.
8114
8115 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
8116
8117         * threads.h, threads-type.h: move the hazard pointer declarations
8118         to the private header.
8119
8120 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
8121
8122         * file-io.c, appdomain.c: memory leak fixes.
8123
8124 2007-08-02  Dick Porter  <dick@ximian.com>
8125
8126         * socket-io.c
8127         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
8128         SO_REUSEADDR setting into io-layer/sockets.c.
8129
8130 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
8131
8132         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
8133         from Object when called on a generic parameter. Fixes #82211.
8134
8135 2007-08-01  Dick Porter  <dick@ximian.com>
8136
8137         * file-io.c (convert_share): Test FileShare values bit-by-bit.
8138         Fixes bug 79250 yet again.
8139
8140 2007-07-30  Martin Baulig  <martin@ximian.com>
8141
8142         Merged the `debugger-dublin' branch.
8143
8144         * mono-debug.h
8145         (MonoDebugDataTable): New typedef.
8146         (MonoDebugMethodAddressList): New typedef.
8147         (MonoDebugWrapperData): Removed.
8148         (MonoDebugSymbolTable): Removed `current_data_table',
8149         `current_data_table_size', `current_data_table_offset'.
8150         (MonoDebugDataItemType): Moved into mono-debug.c.
8151         (MonoDebugMethodJitInfo): Remove `address'.
8152         (mono_debug_data_table): New global variable.
8153         (mono_debug_lookup_method_addresses): New public function.
8154         (mono_debug_find_method): Take a `MonoMethod *', not a
8155         `MonoDebugMethodInfo *'.
8156
8157         * mono-debug.c: Drop support for the old symbol tables.
8158
8159 2007-06-28  Martin Baulig  <martin@ximian.com>
8160
8161         * mono-debug.c (mono_debug_debugger_version): New public variable.
8162
8163 2007-07-31  William Holmes  <billholmes54@gmail.com>
8164
8165         * metadata.c Changed mono_type_create_from_typespec to not insert
8166           the type into the hash map until after
8167           do_mono_metadata_parse_type has completed.
8168         Fixes Bug #82194
8169         Code is contributed under MIT/X11 license.
8170
8171 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
8172
8173         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
8174         generic parameter. Fixes #82211.
8175
8176 2007-07-27  Jb Evain  <jbevain@novell.com>
8177
8178         * pedump.c (dump_metadata, dump_metadata_header): dump
8179         versions contained in the metadata header.
8180
8181 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
8182
8183         * threads.c: register small_id_table with the GC.
8184
8185 2007-07-27  Mark Probst  <mark.probst@gmail.com>
8186
8187         * threads.c, threads.h, class-internals.h, object-internals.h:
8188         Hazard pointers, to be used by lock-free parallel algorithms.
8189
8190 2007-07-26  Dick Porter  <dick@ximian.com>
8191
8192         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
8193         routine on non-windows platforms, as I've not managed to think of
8194         a non-kludgy way of doing this.  Finishes off bug 78739.
8195
8196 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
8197
8198         * object.c: properly setup interface_bitmap in proxy vtables.
8199
8200 2007-07-25  Marek Habersack  <mhabersack@novell.com>
8201
8202         * appdomain.c (get_shadow_assembly_location): do not use TickCount
8203         to create unique shadow copy target directories, use the domain's
8204         serial number instead. Each domain gets a unique target directory
8205         that way.
8206
8207         * domain.c (mono_domain_create): added code to increment domain
8208         shadow copy serial number and cache the value in the current
8209         domain structure.
8210
8211         * domain-internals.h (struct _MonoDomain): added a new field -
8212         shadow_serial to hold the serial number used in generation of
8213         shadow-copy directories. This is to make sure that the directory
8214         name is unique for each and every domain created. We avoid a race
8215         condition with overriding assemblies already in use by other app
8216         domains.
8217
8218 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
8219
8220         * class.c (mono_bounded_array_class_get): fixed memory leak when 
8221         binding generic parameters.
8222
8223 2007-07-24  Raja R Harinath  <rharinath@novell.com>
8224
8225         * metadata.c (do_mono_metadata_parse_generic_class): Use
8226         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
8227         error.
8228
8229 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
8230
8231         * loader.c, class-internals.h, reflection.c: removed the per-method
8232         generics hashtable: we use the global one through the call of
8233         mono_class_inflate_generic_method ().
8234
8235 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
8236
8237         * class.c, metadata.c, class-internals.h: introduce yet another
8238         generics global cache for inflated methods (fixes 98% of the perf
8239         issue in bug #81806).
8240
8241 2007-07-23  Raja R Harinath  <rharinath@novell.com>
8242
8243         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
8244         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
8245         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
8246         return a MonoGenericInst containing (a copy) of those types.
8247         (mono_metadata_inflate_generic_inst): Update to changes.
8248         (mono_metadata_parse_generic_inst): Likewise.
8249         (mono_get_shared_generic_inst): Likewise.
8250         * reflection.c (mono_class_bind_generic_parameters): Likewise.
8251         (mono_reflection_bind_generic_method_parameters): Likewise.
8252         * metadata-internals.h: Likewise.
8253         * icall.c (free_generic_context): Kill.
8254         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
8255
8256         * reflection.c (reflection_methodbuilder_to_mono_method): Use
8257         mono_metadata_type_dup.
8258         * marshal.c (mono_mb_create_method): Likewise.
8259
8260         * metadata.c (mono_metadata_type_dup): Rename from
8261         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
8262         MonoImage.  Handle a few more cases, esp. when no mempool is given.
8263         * marshal.c, metadata-internals.h: Update to changes.
8264
8265 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
8266
8267         * class.c: fixed a small leak for array classes and removed warning.
8268
8269 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
8270
8271         * loader.c (mono_method_get_param_token): Make this work on generic methods.
8272         Return 0x8000000 for return parameters. Fixes #82161.
8273
8274 2007-07-21  Marek Habersack  <grendello@gmail.com>
8275
8276         * appdomain.c (get_shadow_assembly_location): append the current
8277         ticks value to the path. Avoids overwriting the same assemblies by
8278         several threads at the same time.
8279
8280 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
8281         and Raja R Harinath  <rharinath@novell.com>
8282
8283         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
8284         Simplify slightly.
8285         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
8286         property for testing if a method is a generic method definition.
8287
8288 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
8289
8290         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
8291
8292 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8293
8294         * verify.c: used function from private branch, reverted to the one in class.h 
8295
8296 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8297
8298         * verify.c: a typo slipped in and the code wont compile
8299
8300 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8301
8302         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
8303         disabled box instruction as it is doing the wrong thing
8304         improved stack dump messages, now it is easier to debug type related issues
8305
8306
8307 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
8308
8309         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
8310
8311 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8312
8313         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
8314         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
8315         grouped with class and valuetype. This change will simply 
8316         the code as it should be handled just like unmanaged pointers.
8317
8318 2007-07-19  Mark Probst  <mark.probst@gmail.com>
8319
8320         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
8321
8322 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
8323
8324         * verify.c: several stack merge issues fixed, reference comparisons now
8325         check the type size. strict type check now works correctly.
8326         added more uses of IS_MANAGED_POINTER macro.
8327         fixed issues pointed by running the test suite against .net.
8328         
8329
8330 2007-07-19  Mark Probst  <mark.probst@gmail.com>
8331
8332         * class.c, loader.c, class-internals.h: Removed the
8333         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
8334         defines.
8335
8336         * icall.c: Better error checking in some internal reflection
8337         methods.
8338
8339 2007-07-18  William Holmes  <billholmes54@gmail.com>
8340
8341         * filewatcher.c : removed unused variable 'filename' in 
8342           ves_icall_System_IO_FSW_SupportsFSW
8343
8344 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
8345
8346         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
8347         obsolete, removed.
8348
8349 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
8350
8351         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
8352         
8353         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
8354
8355 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
8356
8357         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
8358         Implement generics support.
8359         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
8360
8361         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
8362         type_args and method_args arguments.
8363         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
8364         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
8365         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
8366
8367 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
8368
8369         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
8370           It adds a rootimage parameter to mono_reflection_get_type_internal,
8371           adds new function mono_reflection_get_type_with_rootimage and use
8372           the rootimage to resolve the types instead of the current image
8373
8374 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
8375
8376         * culture-info-table.h: Forgot to update after r78304.
8377
8378 2007-07-13  Raja R Harinath  <rharinath@novell.com>
8379
8380         * class.c (mono_class_is_open_constructed_type)
8381         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
8382
8383 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
8384
8385         * class.c (mono_bounded_array_class_get):  method fails if used with
8386         an incomplete TypeBuilder enum (no basetype field), fixed it by 
8387         avoiding calculating the size for such array as it cannot be instantiated.
8388         Fix bug #82015
8389
8390 2007-07-12  Raja R Harinath  <rharinath@novell.com>
8391
8392         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
8393         field.
8394         * metadata.c, reflection.c: Update to changes.
8395
8396 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
8397
8398         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
8399         mono_class_is_valid_enum, they are used to valide a enum when loading.
8400         * reflection.c: used new functions to throw TypeLoadException when and
8401         invalid enum is build with TypeBuilder. Fixes #82018
8402   
8403 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
8404
8405         * object.c: forgot commit of mono_class_setup_methods () to access
8406         iface->methods.
8407         * object-internals.h: added a few more handy fields to
8408         MonoIMTCheckItem.
8409
8410 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
8411
8412         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
8413         iface->methods.
8414
8415 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
8416
8417         * class-internals.h, object-internals.h, object.c: IMT-based
8418         interface invocation core from Massimiliano Mantione
8419         (massi@ximian.com) with a reworked arch-specific interface,
8420         bsearch implementation and a few bugfixes and memory savings by me.
8421
8422 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
8423
8424         * class.c (mono_class_create_from_typedef): mono would segfault if 
8425         an enum did not have a __value field. It now throws a TypeLoadException
8426         for such cases. Fix bug #82022
8427
8428 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
8429
8430         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
8431
8432 2007-07-09  Mark Probst  <mark.probst@gmail.com>
8433
8434         * class.c (mono_class_init): If a class is already inited but has
8435         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
8436
8437 2007-07-09  Mark Probst  <mark.probst@gmail.com>
8438
8439         * class.c: Properly handle the case of an unimplemented interface
8440         method.  Fixes: 81673.
8441
8442 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
8443
8444         * class-internals.h, object.c: cleanup patch from massi: use
8445         MonoVTable->interface_bitmap since the vtable interfaces offset array
8446         is going away.
8447
8448 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
8449
8450         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
8451         GetMDStreamVersion icall instead.
8452
8453 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
8454
8455         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
8456         not use mono_dl_build_path() with a full library name: makes
8457         fallbacks to libgaim and libfam work.
8458
8459 2007-07-06  William Holmes  <billholmes54@gmail.com>
8460
8461         * assembly.c: Added a continue statement in probe_for_partial_name when
8462          parse_assembly_directory_name fails.  Fixes : 82002
8463
8464 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
8465
8466         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
8467         and added a verification  for TYPEDBYREF.
8468         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
8469         make native int interchangeable with int32 and some small cleanup and formating.
8470         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
8471         handle byref of byref.
8472         * verify.c (push_local): handle byref of byref.
8473         * verify.c (do_binop): invalid mix of values is unverifiable
8474         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
8475         added visibility checks
8476         * verify.c (field related method): added visibility checks
8477         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
8478
8479 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
8480
8481         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
8482         string.
8483
8484 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
8485
8486         * profiler.c (mono_profiler_load): Fix an off-by-one error.
8487
8488         * marshal.c (emit_marshal_string): When returning a string from managed code,
8489         allways make a copy even for unicode strings. Fixes #81990.
8490
8491 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
8492
8493         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
8494         of byref generic inst types (bug #81997).
8495
8496 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
8497
8498         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
8499         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
8500
8501 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
8502
8503         * marshal.c (emit_marshal_string): Add support for unicode strings in
8504         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
8505
8506 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
8507
8508         * verify.c: field load/store are now verified, missing only access checks now
8509
8510 2007-06-28  Martin Baulig  <martin@ximian.com>
8511
8512         * mono-debug.c (mono_debug_debugger_version): New public variable.
8513
8514 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
8515
8516         * locales.c: When constructing DateTimeFormat or NumberFormat for
8517         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
8518         MonoCultureInfo contructed from the current locale is always
8519         read-only and has UseUserOverride set to true. All MonoCultureInfo
8520         instances returned for GetCultures have both IsReadOnly and
8521         UseUserOverride set to true. Fixes part of bug #81930.
8522
8523 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
8524
8525        * icall-def.h: Update System.__ComObject icalls
8526        * marshal.c: Avoid managed transition (and object creation)
8527        when looking up COM interface in RCW.
8528        * marshal.h: Ditto.
8529        
8530        Code is contributed under MIT/X11 license.
8531
8532 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
8533
8534         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
8535         to avoid crashes during assembly unloading.
8536
8537 2007-06-22  Raja R Harinath  <rharinath@novell.com>
8538
8539         Fix MethodInfo.IsGenericMethodDefinition
8540         * reflection.c (mono_reflection_bind_generic_method_parameters):
8541         Rearrange code to ensure we always uses a generic method definition.
8542         * class.c (mono_class_inflate_generic_method_full): Set
8543         'generic_container' field only for generic method definitions.
8544         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
8545         Use presense of 'generic_container' field as indication of being a
8546         generic method definition.
8547
8548 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
8549
8550         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8551
8552         * object-internals.h: Reflect changes in the layout of the managed Delegate
8553         class.
8554         
8555         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
8556         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
8557         runtime memory used by the dynamic method. Fixes #77146.
8558
8559 2007-06-21  Dick Porter  <dick@ximian.com>
8560
8561         * file-io.h: 
8562         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
8563         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
8564         81767.
8565
8566 2007-06-21  Raja R Harinath  <rharinath@novell.com>
8567
8568         * reflection.c (method_encode_methodspec): Add a tripwire.
8569         * class.c (inflate_generic_type): The fully open generic type is
8570         not the same as the generic type definition.
8571
8572 2007-06-21  Martin Baulig  <martin@ximian.com>
8573
8574         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
8575
8576         * mono-debug-debugger.h
8577         (MonoDebuggerBreakpointInfo): Removed.
8578         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
8579         (mono_debugger_remove_breakpoint): Likewise.
8580         (mono_debugger_breakpoint_callback): Likewise.
8581         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
8582
8583 2007-06-21  Raja R Harinath  <rharinath@novell.com>
8584
8585         * metadata.c (mono_metadata_lookup_generic_class): The fully open
8586         generic type is not the same as the generic type definition.
8587         * class.c (mono_generic_class_get_class): Likewise.
8588
8589 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
8590
8591         * icall.c: The second argument to 
8592         System.Reflection.MethodBase.GetMethodFromHandleInternalType
8593         is a MonoType not a MonoClass.
8594
8595 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
8596
8597         * verify.c: support for function pointers in the verifier
8598
8599 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
8600
8601         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
8602
8603 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
8604
8605         * assembly.c: removed Mono.Data.SqliteClient from the list of
8606         forward-compatible assemblies as it breaks the ABI (bug #81899).
8607
8608 2007-06-19  Raja R Harinath  <rharinath@novell.com>
8609
8610         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
8611         lookup/update with the loader lock.
8612         * reflection.c (mono_class_bind_generic_parameters): No need to
8613         protect mono_metadata_lookup_* with the loader lock.
8614         * class.c (inflate_generic_type): Likewise.
8615         
8616         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
8617         on a generic instantiated type.
8618
8619 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
8620
8621         *verify.c: produce meanfull error messages on verification error
8622         *verify.c: fixed some cases of verification errors reported as validation errors
8623         *pedump.c: fixed the error name array, now it shows validation errors properly
8624         *verify.h: fixed the contant that should be used for verification errors
8625
8626 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
8627
8628         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
8629         for bug #77596, 81858 and 80743 (generics data structures on domain
8630         unload).
8631
8632 2007-06-15  Raja R Harinath  <rharinath@novell.com>
8633
8634         Avoid allocating 'MonoGenericContext' on the heap.
8635         * class-internals (_MonoMethodInflated::context): Make field
8636         inline, not a pointer.
8637         * loader.c (method_from_methodspec): Allocate 'new_context' on the
8638         stack.  Use the context embedded within the inflated method as the
8639         hash key, rather than 'new_context'.
8640         * class.c (inflate_generic_context): Simplify.  Return a struct
8641         rather than allocating on the heap.
8642         (mono_class_inflate_generic_method_full): Update to changes.  Now,
8643         doesn't salt away a copy of the context -- simplifying the
8644         lifetime rules of a 'MonoGenericContext *'.
8645         (mono_method_get_context): Return pointer to embedded context.
8646         (setup_generic_array_ifaces): Allocate temporary context on stack.
8647         * reflection.c (inflate_mono_method): Likewise.
8648         (mono_reflection_bind_generic_method_parameters): Likewise.
8649         Use the context embedded within the inflated method as the hash key.
8650
8651         Avoid a source of allocation of 'MonoGenericContext'.
8652         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
8653         and 'cached_context' fields into embedded 'MonoGenericContext' field.
8654         * class.c: Update to changes.
8655         (mono_generic_class_get_context): Simplify drastically.  Now just
8656         returns a pointer to the field.
8657         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
8658         argument as a const pointer.
8659         (mono_metadata_generic_context_equal): Likewise.
8660         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
8661         Update to changes.
8662
8663 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
8664
8665         * verify.c improved the handling of brtrue/brfalse, factored out common code
8666
8667 2007-06-14  Raja R Harinath  <rharinath@novell.com>
8668
8669         Kill MonoGenericMethod.
8670         * class-internals.h (MonoGenericContext::method_inst): Rename from
8671         'gmethod' and convert to a MonoGenericInst.
8672         (MonoGenericMethod): Remove.
8673         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
8674         * loader.c (method_from_methodspec): Update to changes.  Use a
8675         MonoGenericContext as the key to the hashtable.
8676         * metadata.c (mono_metadata_generic_context_equal): Rename from 
8677         'mono_metadata_generic_method_equal' and take MonoGenericContext.
8678         (mono_metadata_generic_context_hash): Likewise from
8679         'mono_metadata_generic_method_hash'.  Change hash function.
8680         (mono_metadata_load_generic_params): Update to changes.
8681         (mono_get_shared_generic_method): Remove.
8682         * metadata-internals.h (mono_get_shared_generic_method): Remove.
8683         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
8684         (inflate_generic_context): Likewise.
8685         (mono_class_inflate_generic_method_full): Likewise.
8686         (setup_generic_array_ifaces): Likewise.
8687         (mono_class_create_from_typespec): Likewise.
8688         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
8689         (method_encode_methodspec): Update callsite.
8690         (reflection_methodbuilder_to_mono_method): Update to changes.
8691         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
8692         MonoGenericContext as the key to the hashtable.
8693         (inflate_mono_method): Update to changes.
8694
8695         * class-internals.h (MonoGenericMethod::container): Remove.
8696         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
8697
8698 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
8699
8700         * profiler-private.h, profiler.c, profiler.h: added API to profile
8701         exception events.
8702
8703 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
8704
8705         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
8706
8707 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
8708
8709         * verify.c: method invocation is now validated, now we verify parameter types on stack.
8710         Fixed overflow and underflow not aborting the verification process.
8711
8712 2007-06-13  Mark Probst  <mark.probst@gmail.com>
8713
8714         * class-internals.h (MonoStats): Added stats entries for dynamic
8715         code allocations.
8716
8717 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
8718
8719         * loader.c (mono_free_method): Free header->locals and header->clauses.
8720
8721         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
8722         dynamic case.
8723
8724         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
8725
8726         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
8727
8728 2007-06-12  Raja R Harinath  <rharinath@novell.com>
8729
8730         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
8731         the tables.
8732
8733 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
8734
8735         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
8736
8737 2007-06-11  Raja R Harinath  <harinath@gmail.com>
8738
8739         MonoGenericMethod on a diet
8740         * class-internals.h (_MonoMethodInflated::reflection_info): Move
8741         here ...
8742         (_MonoGenericMethod::reflection_info): ... from here.
8743         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
8744         Update to changes.
8745         * reflection.c (inflate_mono_method): Likewise.
8746         (mono_reflection_bind_generic_method_parameters): Likewise.
8747
8748 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
8749
8750         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
8751         *verify.c: factored long ldarg forms to share code with short forms
8752
8753 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
8754
8755         *verify.c: fixed code formating factored some duplicate code
8756         into a new function
8757
8758         *verify.h: fixed binary incompatibility introduced earlier
8759
8760         *pedump.c: fixed formating
8761
8762 2007-06-11  Raja R Harinath  <harinath@gmail.com>
8763
8764         Fix assertion when disassembling Mono.C5.dll
8765         * loader.c (method_from_methodspec): Avoid inflating a method
8766         twice with the same context.  If the methodref is inflated, use
8767         the declaring method instead.
8768
8769         * class.c (mono_class_from_generic_parameter): Fix case similar to
8770         bug #81830 handled below, but for method containers.
8771
8772 2007-06-10  Raja R Harinath  <harinath@gmail.com>
8773
8774         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
8775         get_shared_generic_class.  Directly inflate the instance.
8776         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
8777         (inflate_generic_class): Delete.
8778         (get_shared_generic_class): Delete.  Move setting of
8779         'cached_class' and 'cached_context' ...
8780         * metadata.c (mono_metadata_lookup_generic_class): ... here.
8781
8782         * metadata.c (mono_metadata_lookup_generic_class): Change
8783         signature to take the components of a MonoGenericClass rather than
8784         an allocated MonoGenericClass.  Change semantics to be intern-like.
8785         * reflection.c (mono_class_bind_generic_parameters): Update to
8786         changes.  Make locking region tighter.
8787         * class.c (inflate_generic_class): Update to changes.
8788         (get_shared_generic_class): Likewise.
8789         * metadata-internals.h: Likewise.
8790
8791         * reflection.c (mono_class_bind_generic_parameters): Take and
8792         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
8793         (mono_reflection_bind_generic_parameters): Use
8794         'mono_class_bind_generic_parameters' rather than duplicate the code.
8795         * class.c (mono_bounded_array_class_get): Update to changes.
8796         * object-internals.h: Likewise.
8797
8798         * reflection.c (mono_class_bind_generic_parameters): Only support
8799         parameterizing generic type definitions.  Remove support for other
8800         open types.
8801
8802 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
8803
8804         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
8805
8806         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
8807         in the dynamic case.
8808
8809 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
8810
8811         * threads.c: When cleaning up thread, reset the Background bit.
8812         Fixes bug #81720.
8813
8814 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
8815
8816        * metadata.c: Move variable declarations to top of scope.
8817        * verify.c: Move variable declarations to top of scope.
8818
8819        Code is contributed under MIT/X11 license.
8820
8821 2007-06-08  Raja R Harinath  <rharinath@novell.com>
8822
8823         * reflection.c (mono_class_bind_generic_parameters): Replace
8824         open-coded loop with mono_metadata_inflate_generic_inst.
8825
8826         * class.c (get_shared_generic_class): Don't call
8827         mono_get_shared_generic_inst.  Use the container's own
8828         'class_inst'.
8829
8830         * metadata.c (mono_metadata_load_generic_params): Move
8831         initialization of 'context' field here from ...
8832         * class.c (mono_class_create_from_typedef): ... here, and ...
8833         * loader.c (mono_get_method_from_token): ... here.
8834
8835         * class.c (get_shared_generic_class): Rename from
8836         mono_get_shared_generic_class and make static.
8837         (mono_get_shared_generic_inst): Move to metadata.c.
8838         * loader.c (mono_get_shared_generic_method): Likewise.
8839         * class-internals.h, metadata-internals.h: Update to changes.
8840
8841         Fix #81830
8842         * class.c (mono_class_from_generic_parameter): Don't assume a
8843         generic container owner exists.  Generic containers from monodis
8844         don't have any.
8845
8846 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
8847
8848         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
8849         * verify.h: new typedefs to returns the non-verifiable status
8850         * verify.c: initial implementation of generics, stack merging and object compatibility check
8851
8852 2007-06-06  Mark Probst  <mark.probst@gmail.com>
8853
8854         * class.c, image.c, class-internals.h (MonoImage): class_cache is
8855         a MonoInternalHashTable again (fixed bug in internal hash table
8856         code).
8857
8858 2007-06-06  Mark Probst  <mark.probst@gmail.com>
8859
8860         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
8861         MonoInternalHashTable again (fixed bug in internal hash table
8862         code).
8863
8864 2007-06-06  Mark Probst  <mark.probst@gmail.com>
8865
8866         * class.c, image.c, class-internals.h, domain.c,
8867         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
8868         changes.  Have to figure out what makes them break the SWF
8869         regression.
8870
8871 2007-06-04  Mark Probst  <mark.probst@gmail.com>
8872
8873         * class.c, image.c, class-internals.h (MonoImage): class_cache is
8874         a MonoInternalHashTable now.
8875
8876 2007-06-04  Mark Probst  <mark.probst@gmail.com>
8877
8878         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
8879         MonoInternalHashTable now.
8880
8881 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
8882
8883         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
8884         invoke_impl code.
8885
8886         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
8887
8888         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
8889         dependent trampoline.
8890
8891         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
8892
8893         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
8894
8895 2007-05-29  Robert Jordan  <robertj@gmx.net>
8896
8897         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
8898
8899 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
8900
8901         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
8902
8903 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
8904
8905        * marshal.c: Fix interface lookup loops for
8906        cominterop_get_com_slot_for_method and 
8907        cominterop_get_method_interface. Only need to lookup
8908        if type is a class, else use interface type method is on.
8909
8910        Code is contributed under MIT/X11 license.
8911
8912 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
8913
8914         * reflection.c: HasSecurity can be present even if no specially 
8915         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
8916         SecurityAttribute). Fix CAS regression tests on buildbot.
8917
8918 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
8919
8920        * appdomain.c: Add configure checks for header files.
8921        * image.c: Add configure checks for header files.
8922        * file-io.c: Add configure checks for header files.
8923        * debug-mono-symfile.c: Add configure checks for header files.
8924        * threadpool.c: Add configure checks for header files.
8925        * console-io.c: Add configure checks for header files.
8926        * profiler.c: Add configure checks for header files.
8927        * rawbuffer.c: Add configure checks for header files.
8928        * icall.c: Add configure checks for header files.
8929        * rand.c: Add configure checks for header files.
8930        * socket-io.c: Add configure checks for header files.
8931
8932        Code is contributed under MIT/X11 license.
8933
8934 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
8935
8936         * reflection.c (mono_custom_attrs_from_builders): Remove the 
8937         assertion as it breaks the build.
8938         
8939         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
8940
8941         * reflection.c (lookup_custom_attr): Make a copy here too.
8942
8943         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
8944         dynamic images.
8945
8946         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
8947         images.
8948
8949         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
8950         info.
8951
8952 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
8953
8954         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
8955         (load_cattr_value): Ditto.
8956
8957 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
8958
8959         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
8960
8961 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
8962
8963         * threads.c: In "start_wrapper", set apartment_state to MTA if
8964         apartment_state is Unknown and we're running on 2.0 profile or
8965         higher.
8966         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
8967         to main method, then set apartment_state to Unknown on 1.0 profile,
8968         and MTA on 2.0 profile.
8969
8970 2007-05-16  Jb Evain  <jb@nurv.fr>
8971
8972         * class-internals.h (MonoDefaults): Add an attribute_class and
8973           customattribute_data_class.
8974         * domain.c (mono_init_internal): Populate them.
8975         * reflection.c: Use them to remove duplicates. Make a vew
8976         MonoClass variables `static'.
8977
8978 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
8979
8980         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
8981         step in implementing IMT, so that all isinst checks now can go
8982         through the bitmap.
8983         This was needed because vtables for TransparentProxy need to look
8984         like the vtable of the "target" class, so they need to point to
8985         its interface bitmap directly.
8986
8987         * object.c: inside "mono_class_create_runtime_vtable" and
8988         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
8989
8990 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
8991
8992         * object-internals.h
8993           culture-info.h : added territory field in MonoCulture and
8994           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
8995         * locales.c : fill territory field above too.
8996         * culture-info-table.h : regenerated.
8997
8998 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
8999
9000         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
9001         Fixes #81599.
9002
9003 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
9004
9005         * object.c: Always initialize apartment, even if 
9006         there is no custom attributes on entry point.
9007         
9008         Code is contributed under MIT/X11 license.
9009
9010 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
9011
9012         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
9013         * metadata.c: If no encoding is set, check for unicode
9014         on class.
9015         
9016         Code is contributed under MIT/X11 license.
9017
9018 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
9019
9020         * threads.c: Handle if mono_thread_current returns NULL 
9021         
9022         Code is contributed under MIT/X11 license.
9023
9024 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
9025
9026         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
9027         in start_wrapper. Added mono_thread_init_apartment_state and
9028         mono_thread_cleanup_apartment_state.
9029         * object.c: Initialize thread apartment state on main thread
9030         by checking for STAThreadAttribute on entry point.
9031         * object-internals.h: Add apartment_state field to MonoThread.
9032         * threads-types.h: Add unmanaged definition of 
9033         System.Threading.ApartmentState, MonoThreadApartmentState.
9034         
9035         Code is contributed under MIT/X11 license.
9036         
9037 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
9038
9039         * class.c: Fix windows build.
9040         * class-internals.h: Fix windows build.
9041         
9042         Code is contributed under MIT/X11 license.
9043
9044 2007-05-08  Robert Jordan  <robertj@gmx.net>
9045
9046         * process.c (CreateProcess_internal):
9047         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
9048         .CreateNoWindow was specified. Fixes #81496.
9049
9050 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
9051
9052         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
9053         step in implementing IMT, replaced it with two compact arrays
9054         (interfaces_packed and interface_offsets_packed) and a bitmap that
9055         is used for isinst checks (interface_bitmap).
9056
9057         * class.c: (compare_interface_ids): compare function to pass to
9058         bsearch when looking for an interface with a given id.
9059         (mono_class_interface_offset): reimplemented using bsearch on
9060         interfaces_packed, getting the offset from interface_offsets_packed.
9061         (print_implemented_interfaces): utility debugging function.
9062         (setup_interface_offsets): reworked to initialize interfaces_packed,
9063         interface_offsets_packed and interface_bitmap.
9064
9065         * object.c: replaced all accesses to "MonoClass.interface_offsets"
9066         with uses of interfaces_packed and interface_offsets_packed.
9067
9068 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
9069
9070         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
9071         mono_class_interface_offset prototype to wrap all accesses to
9072         "MonoClass.interface_offsets".
9073
9074         * class.c: Implemented mono_class_interface_offset, and wrapped all
9075         accesses to "MonoClass.interface_offsets".
9076
9077         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
9078         "MonoClass.interface_offsets".
9079
9080 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
9081
9082         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
9083         GetMethodFromHandle overloads (bug #78637).
9084
9085 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
9086
9087         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
9088         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
9089
9090 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
9091
9092         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
9093         #81498.
9094
9095         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
9096         gracefully.
9097         (mono_custom_attrs_from_index): Ditto.
9098
9099         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
9100         Fixes #81501.
9101
9102 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
9103
9104         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
9105         is now allocated from a mempool.
9106
9107 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
9108
9109         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
9110         caller holds threads_lock, leading to deadlocks. Fixes #81476.
9111
9112 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
9113
9114         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
9115         mono_loader_clear_error () too late. Fixes #81463.
9116
9117 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
9118
9119         * culture-info-table.h : regenerated.
9120
9121 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
9122
9123         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
9124         is missing.
9125
9126 2007-04-25  Dick Porter  <dick@ximian.com>
9127
9128         * Makefile.am: Put the mingw enforced-optimisation back into the
9129         PLATFORM_WIN32 section.
9130
9131 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
9132
9133         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
9134         patch.
9135
9136         * image.c (mono_image_load_module): New API function to load a module reference.
9137
9138         * image.c (load_modules): Load modules lazily. Fixes #80812.
9139
9140         * class.c (mono_class_from_typeref): Use mono_image_load_module.
9141         
9142         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
9143
9144         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
9145         to mono_image_load_module_dynamic.
9146
9147 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
9148
9149         * marshal.c: Fix calling convention for CCW on non-windows
9150         platforms. STDCALL on windows, CDECL everywhere else to work 
9151         with XPCOM and MainWin COM.
9152         
9153         Code is contributed under MIT/X11 license.
9154
9155 2007-04-23  Martin Baulig  <martin@ximian.com>
9156
9157         Fix #80969.
9158
9159         * loader.c
9160         (method_from_memberref): Added `gboolean *used_context' argument.
9161         (mono_get_method_from_token): Likewise.
9162         (mono_get_method_full): Don't insert the method in the cache when
9163         `used_context' is true.
9164
9165 2007-04-23  Raja R Harinath  <rharinath@novell.com>
9166
9167         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
9168
9169         * reflection.c (mono_reflection_bind_generic_parameters): Don't
9170         create new MonoTypes for returned types.
9171         * class.c (mono_generic_class_get_class): Export mono-internal.
9172         * class-internals.h: Update to changes.
9173
9174 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
9175
9176         * threadpool.c, threadpool.h, icall-def.h: patch from
9177         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
9178
9179 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
9180
9181         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
9182         
9183         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
9184
9185         * threads.c (mono_thread_get_stack_bounds): New helper function.
9186
9187         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
9188         Correctly compute stack bounds when attaching. Fixes #81394.
9189
9190 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
9191
9192         * reflection.c: fix handling of doubles in custom attributes
9193         for the arm-fpa format (bug #81368).
9194
9195 2007-04-18  Raja R Harinath  <rharinath@novell.com>
9196
9197         * reflection.c (assembly_add_win32_resources): Mildly relax an
9198         bounds check to let the end pointer point just past the end of the
9199         allocated buffer.  (may fix #81384)
9200
9201 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
9202
9203         * culture-info-table.h : regenerated.
9204
9205 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
9206
9207         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
9208         the thread is aborted early.
9209
9210 2007-04-05  Dick Porter  <dick@ximian.com>
9211
9212         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
9213         FindFirstFile()/FindNextFile() to find entries.  This lets the
9214         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
9215         81038.
9216
9217         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
9218         the parameters of
9219         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
9220
9221 2007-04-04  Martin Baulig  <martin@ximian.com>
9222
9223         * debug-helpers.c
9224         (mono_method_desc_full_match): Add support for nested classes.
9225
9226 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
9227
9228         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
9229
9230 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
9231
9232         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
9233         waiting for too many threads.
9234
9235 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
9236
9237         * environment.c: Fix return value check on uname so we can get the 
9238         executing version on Solaris operating systems.
9239
9240 2007-03-28  Jb Evain  <jbevain@gmail.com>
9241
9242         * class.c (mono_type_get_name_recurse): Complete the
9243         fix for the creation of assembly qualified names for
9244         pointer types. Fixes #81208.
9245
9246 2007-03-27  Dick Porter  <dick@ximian.com>
9247
9248         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
9249         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
9250         changed.
9251
9252         * threads.c
9253         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
9254         the value of ReleaseMutex().
9255
9256 2007-03-27  Dick Porter  <dick@ximian.com>
9257
9258         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
9259         in little-endian order, not network endian, so must be converted
9260         to host endian here.  Fixes bug 80593.
9261
9262 2007-03-22  Jb Evain  <jbevain@gmail.com>
9263
9264         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
9265         qualified names for pointer types. Fixes #81208.
9266
9267 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
9268
9269         * marshal.c: Add support for PreserveSigAttribute. 
9270         
9271         Code is contributed under MIT/X11 license.
9272
9273 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
9274
9275         * process.c: Fix endianness issues. Fixes #81126.
9276
9277         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
9278         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
9279
9280         * image.c (mono_image_lookup_resource): Make this work on big-endian
9281         machines.Change API contract so the caller needs to free the return value.
9282         
9283         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
9284         API change.
9285         
9286 2007-03-14  Martin Baulig  <martin@ximian.com>
9287
9288         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
9289         mono_type_get_desc() as well.
9290
9291 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
9292
9293         * icall.c:  Fix environ access in VS.  
9294         
9295 2007-03-13  Alp Toker  <alp@atoker.com>
9296
9297         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
9298         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
9299         #63841.
9300
9301 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
9302
9303         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
9304         circular references among dynamic methods. Fixes #81091.
9305
9306         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
9307
9308 2007-03-09  Martin Baulig  <martin@ximian.com>
9309
9310         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
9311
9312 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
9313
9314         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
9315         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
9316         
9317         Code is contributed under MIT/X11 license.
9318         
9319 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
9320
9321         * loader.c: Reapply patch for bug #79424.
9322
9323 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
9324
9325         * metadata.c (mono_type_to_unmanaged): Only convert object to
9326         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
9327
9328 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
9329
9330         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
9331         (and incorrectly set) is_reference field from MonoGenericInst.
9332
9333 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
9334
9335         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
9336         a little earlier.
9337
9338         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
9339
9340         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
9341
9342 2007-03-05  Miguel de Icaza  <miguel@novell.com>
9343
9344         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
9345         FileOptions.1 value to mean "temporary", map that to
9346         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
9347
9348         Fixes 80688
9349
9350 2007-03-03  Marek Habersack  <mhabersack@novell.com>
9351
9352         * appdomain.c: implement MS .Net style shadow copying. Copies of
9353         the assemblies are made in a subdirectory of the dynamic base
9354         directory, the assembly names are preserved.
9355         Copy .mdb and .config files along with the assemblies being shadowed.
9356
9357 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
9358
9359         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
9360         (emit_marshal_handleref): Ditto.
9361
9362         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
9363         on Visual C++. Fixes #80671.
9364
9365 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
9366
9367         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
9368         for clone operations.
9369
9370 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
9371
9372         * marshal.c: Fix warnings.
9373
9374 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
9375
9376         * loader.c: allow case-insensitive matching of the dll name
9377         in dllmap handling when prefixed with "i:".
9378
9379 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
9380
9381         * threads.c: Fix #ifdef for dummy_apc function for VS.
9382
9383 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
9384
9385         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
9386
9387 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
9388         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
9389         giving precedence to the methods with a fully qualified name
9390         (InterfaceName.MethodName) when building the interface sections
9391         of the vtable.
9392
9393 2007-02-16  Dick Porter  <dick@ximian.com>
9394
9395         * threadpool.c (append_job): Fix fast-path array handling, so it's
9396         less likely the array will grow exponentially when the load is
9397         heavy.
9398
9399 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
9400
9401         * metadata-internals.h, loader.c: fix dllmap lookup order
9402         for non-function maps, too, and prepare for fallback code.
9403
9404 2007-02-12  Robert Jordan  <robertj@gmx.net>
9405
9406         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
9407         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
9408         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
9409         GlobalFree. Fixes a part of bug #77075.
9410
9411 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
9412
9413         * loader.c: implemented typedef parent in field memberref.
9414
9415 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
9416
9417         * marshal.c: Fix warnings and remember to call Release on
9418         IUnknown of RCW.
9419         
9420         Code is contributed under MIT/X11 license.
9421
9422 2007-02-10  Miguel de Icaza  <miguel@novell.com>
9423
9424         * class-internals.h: Add MonoHandleRef definition, and
9425         handleref_class to mono_defaults. 
9426
9427         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
9428         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
9429
9430         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
9431         (do nothing on this stage)
9432         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
9433         (emit_marshal_handleref): New method, used for argument handling
9434         of HandleRefs. 
9435
9436 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
9437
9438         * class.c (mono_class_setup_parent): Lazily init com types.
9439         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
9440         init com types.
9441         * object.c (mono_remote_class_vtable): Lazily init com types.
9442         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
9443         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
9444         * domain-internals.h: Expose mono_init_com_types.
9445         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
9446         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
9447         Add support for COM Callable Wrapper marshalling.
9448         * marshal.h: Add icall definitions.
9449         * gc.c: Handle freeing of CCWs in finalizer code.
9450         
9451         Code is contributed under MIT/X11 license.
9452
9453 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
9454
9455         * reflection.c: changed all the signature encoding code to use
9456         a variable-sized buffer.
9457
9458 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
9459
9460         * marshal.c: locking fixes: never take the loader lock
9461         or other runtime locks when holding the marshal lock
9462         (fixes bug#80664).
9463
9464 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
9465
9466         * marshal.c: make the delegate function pointer mapping
9467         work for the moving GC.
9468
9469 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
9470
9471         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
9472         for bug #80618.
9473
9474 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
9475
9476         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
9477         gmodule.
9478
9479 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
9480
9481         * threadpool.c: made the code moving-GC safe.
9482
9483 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
9484
9485         * assembly.c, boehm-gc.c, class-internals.h, class.c,
9486         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
9487         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
9488         warning cleanup.
9489         * reflection.c: warning cleanup, some threading and moving GC fixes.
9490
9491 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
9492
9493         * class.c, loader.c: create the needed Set/Get/Address array methods
9494         as well as the .ctors in mono_class_init (), fixes bug #80567.
9495
9496 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
9497
9498         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
9499         we doesn't decrease its alignment. Should fix the sparc build.
9500
9501 2007-01-24  Dick Porter  <dick@ximian.com>
9502
9503         * socket-io.c
9504         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
9505         Create the returned object if we need to ignore an unsupported
9506         socket option.  Fixes a segfault reported by Atsushi.
9507
9508 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
9509
9510         * class.c, object.c: restrict GC-tracked fields to
9511         UIntPtr fields used inside corlib, so we provide better
9512         type info to the GC and also allow broken packing as in
9513         bug #80580.
9514
9515 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
9516
9517         * sgen-gc.c: removed duplicated function.
9518
9519 2007-01-19  Miguel de Icaza  <miguel@novell.com>
9520
9521         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
9522         value that means that the value is not supported, but that we
9523         should not return a failure, but instead report this as a
9524         successful operation.
9525
9526 2007-01-19  Raja R Harinath  <rharinath@novell.com>
9527
9528         Fix tests/bug79956.2.il
9529         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
9530         (mono_generic_class_get_class): If the generic definition in an
9531         enum, copy over other fields related to it.
9532
9533 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
9534
9535         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
9536         genericinst enums (bug #79215).
9537
9538 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
9539         * class.c: Fix bug 80307.
9540
9541 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
9542
9543         * image.c: if the file table is not present, try to load
9544         all the modules, since we don't have info about them
9545         having or not metadata (bug #80517).
9546         * assembly.c: allow mono_assembly_load_references () to
9547         work for netmodules.
9548
9549 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
9550
9551         * image.c, metadata-internals.h, object.c: execute module
9552         cctors when running on the 2 runtime if present (bug #80487).
9553
9554 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
9555
9556         * icall.c: optimized InitializeArray() on bigendian.
9557
9558 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
9559
9560         * icall.c: fix for the broken ARM FPA double format.
9561
9562 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
9563
9564         * icall.c: handle endian issues for r4 and r8 types, too, in
9565         the InitializeArray() icall.
9566
9567 2007-01-15  Miguel de Icaza  <miguel@novell.com>
9568
9569         * loader.c (mono_loader_error_prepare_exception): Clear the error
9570         once we have extracted the information from it, do this before we
9571         call into the JIT's class loading mechanisms.
9572
9573         * object.c (mono_class_create_runtime_vtable): Do not clear the
9574         loader error before calling mono_class_get_exception_for_failure
9575         as the loader error is needed inside
9576         mono_class_get_exception_for_failure to throw the error (thinko).
9577
9578         Fixes #80521
9579         
9580 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
9581
9582         * reflection.c: align fields rva data so it's faster to load at
9583         runtime.
9584
9585 2007-01-12  Raja R Harinath  <rharinath@novell.com>
9586
9587         Prepare to simplify GenericMethod handling.
9588         * class-internals.h (mono_method_get_context): New accessor function.
9589         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
9590         rather than directly accessing '->context' field.
9591
9592         * class-internals.h (_MonoGenericParam.method): Move ...
9593         (_MonoGenericContainer): ... here.  Add into union with klass field.
9594         * class.c, icall.c, loader.c, metadata.c, reflection.c:
9595         Update to changes.
9596
9597 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
9598
9599         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
9600         the wrapper type enum and reduce relocations.
9601
9602 2007-01-12  Raja R Harinath  <rharinath@novell.com>
9603
9604         * reflection.c (inflate_mono_method): Reuse method instantiation
9605         from the generic method, if available.
9606
9607 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
9608
9609         * marshal.c (emit_marshal_variant): Fix conv_arg
9610         type in last commit, based on whether parameter is byref.
9611         
9612 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
9613
9614         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
9615         marshalling.
9616         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
9617         MONO_TYPE_OBJECT back for VARIANT support.
9618
9619 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
9620
9621         * marshal.c, marshal.h, icall-def.h: Implement 
9622         Marshal.ReAllocCoTaskMem.
9623
9624 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
9625
9626         * marshal.c: memory retention fixes: use the proper
9627         image cache for runtime_invoke method lookups.
9628
9629 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
9630
9631         * mempool.c: added code to help debug mempool allocations.
9632
9633 2007-01-11  Dick Porter  <dick@ximian.com>
9634
9635         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
9636         support (experimenting with faking it with IP_MTU_DISCOVER for
9637         systems that don't have IP_DONTFRAGMENT.)
9638         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
9639         icall.
9640
9641         * icall-def.h: new System.Net.Sockets.Disconnect icall.
9642
9643         * socket-io.h: Add new fields to MonoSocketAsyncResult
9644         corresponding to the new ones in Socket.cs.
9645
9646 2007-01-11  Raja R Harinath  <rharinath@novell.com>
9647
9648         Fix IronPython regression mentioned in #80249
9649         * metadata.c (do_mono_metadata_parse_generic_class): Clear
9650         'cached_context' field, since it may have been initialized as a
9651         side-effect of metadata parsing.
9652
9653         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
9654         (_MonoGenericClass.cached_class): Move here and rename from lone
9655         remaining field of ...
9656         (_MonoInflatedGenericClass): ... this.  Remove.
9657         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
9658         to changes.
9659
9660         Fix mcs/tests/test-128.cs regression.
9661         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
9662         2007-01-10 change below.
9663         [MONO_TYPE_OBJECT]: Recurse into array case.
9664
9665 2007-01-11  Raja R Harinath  <harinath@gmail.com>
9666
9667         * class-internals.h (mono_get_inflated_generic_class): Remove.
9668         * class.c (mono_get_inflated_generic_class): Remove.
9669         (mono_generic_class_get_class): Rename from
9670         mono_class_create_generic.
9671         (mono_class_from_mono_type) [GENERICINST]: Use it.
9672         * reflection.c, metadata.c: Update to changes.  Use
9673         'mono_class_from_mono_type'.
9674
9675 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
9676
9677         * reflection.c: use passed type when encoding an array element
9678         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
9679
9680 2007-01-09  Robert Jordan  <robertj@gmx.net>
9681
9682         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
9683         result arguments (someDelegate.EndInvoke (unrelatedAres)).
9684         Fixes bug #80392.
9685
9686 2007-01-09  Raja R Harinath  <rharinath@novell.com>
9687
9688         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
9689
9690         * object.c (set_value): Avoid aliasing between type->data.klass
9691         and type->data.generic_class.
9692
9693         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
9694
9695 2007-01-08  Raja R Harinath  <rharinath@novell.com>
9696
9697         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
9698         between type->data.klass and type->data.generic_class.
9699
9700 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
9701
9702         * marshal.c: In MS.NET, StringBuilder objects are not copied by
9703         value in out parameters.
9704
9705 2007-01-08  Raja R Harinath  <rharinath@novell.com>
9706
9707         Simplify invariant for MonoGenericClass::klass field.
9708         * class.c (mono_class_create_generic): Verify 'klass' is null.
9709         * metadata.c (do_mono_metadata_parse_generic_class): Don't
9710         initialize 'klass' field.
9711
9712 2007-01-05  Raja R Harinath  <rharinath@novell.com>
9713
9714         Ongoing work to avoid redundant data and simplify invariants.
9715         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
9716         'generic_class', and change type to a GenericInst.
9717         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
9718         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
9719
9720 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
9721
9722         * class.c : skip io-layer under PLATFORM_WIN32.
9723
9724 2007-01-03  Tor Lillqvist  <tml@novell.com>
9725
9726         Fix #80305: In a bundled executable, look in the bundled exe
9727         assembly to determine the runtime version. Add the possibility to
9728         bundle also the machine.config file.
9729         
9730         * assembly.c (mono_assembly_open_from_bundle): Make
9731         non-static. Allow being called even if we have no bundled
9732         assemblies, and return NULL right away in that case.
9733
9734         * domain-internals.h: Declare mono_assembly_open_from_bundle()
9735         here.
9736
9737         * domain.c (app_config_parse): Take an assembly exe file name as
9738         parameter instead of a config file name. Check for a bundled
9739         config file for that assembly by calling
9740         mono_config_string_for_assembly_file() (see below) before looking
9741         for one in the file system.
9742         (get_runtimes_from_exe): Corrsponding change to call of
9743         app_config_parse().
9744         (get_runtimes_from_exe): Check for bundled assembly exe file first
9745         by calling mono_assembly_open_from_bundle(). If no bundled
9746         assembly exe file is found, call mono_image_open() as before to
9747         look it up in the file system.
9748
9749         * mono-config.c: Add variable bundled_machinec_onfig.
9750         (mono_config_string_for_assembly_file): New function.
9751         (mono_config_for_assembly): Move code snippet that looks for a
9752         bundled assembly .config file into the above new function. Call
9753         it.
9754         (mono_register_machine_config, mono_get_machine_config): New
9755         functions to set and retrieve
9756
9757         * assembly.h: Declare mono_register_machine_config().
9758
9759         * mono-config.h: Declare mono_get_machine_config() and
9760         mono_config_string_for_assembly_file().
9761
9762         * icall.c: No declaration of environ necessary on Win32. It is
9763         declared (as a macro expanding to a function call) in stdlib.h.
9764         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
9765         New internal mono function. Returns the value of
9766         mono_get_machine_config() as a Mono string.
9767
9768         * icall-def.h: Add get_bundled_machine_config().
9769
9770 2007-01-04  Raja R Harinath  <rharinath@novell.com>
9771
9772         Remove redundant field
9773         * class-internals.h (_MonoGenericContext.container): Remove field.
9774         * loader.c (mono_method_get_signature_full): Don't parse a
9775         "container" for a signature parse when the signature is inflated
9776         immediately.
9777         (method_from_methodspec): Likewise, for a generic_inst.
9778         * class.c, metadata.c, reflection.c: Update to changes.
9779
9780 2006-01-04  Raja R Harinath  <rharinath@novell.com>
9781
9782         * class-internals.h (_MonoGenericClass): Rename 'context' field to
9783         'cached_context', and change semantics -- it starts off NULL, and
9784         is initialized on demand.
9785         * class.c (mono_generic_class_get_context): New accessor to
9786         replace 'context' field accesses.
9787         (mono_class_get_context): New helper.
9788         (*): Update to changes.
9789         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
9790
9791 2007-01-03  Miguel de Icaza  <miguel@novell.com>
9792
9793         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
9794         before the memcpy.   Fixes Marshal2 regression.
9795
9796 2007-01-02  Jb Evain  <jbevain@gmail.com>
9797
9798         * blob.h: add a MONO_TYPE_ENUM definition
9799         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
9800         fix the encoding of arrays of enums in custom attributes.
9801
9802         Fixes #79666.
9803
9804 2007-01-01  Miguel de Icaza  <miguel@novell.com>
9805
9806         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
9807         string is null terminated, but only cut the string short if it
9808         overflows the buffer.   
9809         
9810         (mono_string_to_byvalstr): Also fix this routine.   The code here
9811         was not properly terminating a string (it was only terminated
9812         because of the previous catch-all memset). 
9813
9814         I left the memset, because I do not know if applications expect
9815         the runtime to clear this region. 
9816
9817         Fixes #79944.
9818
9819         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
9820         Clear the error before returning to unmanaged code to prevent the
9821         runtime from being confused later on (fixes  80420).
9822         (ves_icall_type_from_name): Always call mono_loader_clear_error
9823         after parsing a type that could have failed.
9824         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
9825
9826         * loader.c (mono_loader_clear_error): Fix indentation.
9827
9828 2006-12-28  Martin Baulig  <martin@ximian.com>
9829
9830         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
9831
9832 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
9833
9834         * reflection.c: patch from Rolf Bjarne Kvinge to fix
9835         getting a token for an EnumBuilder.
9836
9837 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
9838
9839         * reflection.c: be more careful in case resource generation
9840         fails to create the data array.
9841
9842 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
9843
9844         * sgen-gc.c: write barrier for clone and fix unregister handles.
9845
9846 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
9847
9848         * reflection.c: some fixes needed in the generics code for the moving GC.
9849
9850 2006-12-22  Robert Jordan  <robertj@gmx.net>
9851
9852         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
9853         account. Fixes bug #80299.
9854
9855 2006-12-21  Raja R Harinath  <rharinath@novell.com>
9856
9857         Fix WaitHandle usage in delegates.
9858         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
9859         * object.c (mono_wait_handle_new): Use the property set method to
9860         initialize the handle.
9861         (mono_wait_handle_get_handle): New.
9862         * threadpool.c (mono_async_invoke): Use it.
9863         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
9864         Likewise.
9865         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
9866
9867 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
9868
9869         * marshal.c (emit_marshal): Call emit_marshal_variant and
9870         emit_marshal_com_interface when applicable.
9871         (emit_marshal_variant, emit_marshal_com_interface): Add
9872         methods for this case and remove if's from emit_marshal_object.
9873         
9874 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
9875
9876         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
9877
9878 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
9879
9880         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
9881         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
9882         and GlobalFree on Windows. Remove FIXME.
9883
9884 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
9885
9886         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
9887         implementation for managed objects.
9888
9889 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
9890
9891         * object.c: implemented code to be used for checking
9892         that no reference field overlaps with non-references.
9893
9894 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
9895
9896         * threadpool.c: fix queue code to be compatible with the
9897         moving GC.
9898
9899 2006-12-18  Miguel de Icaza  <miguel@novell.com>
9900
9901         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
9902         in structures by throwing ArgumentNullException.
9903
9904         (emit_marshal_safehandle): Also when they are null parameters.
9905
9906         (emit_marshal_safehandle): Add support for ref
9907         SafeHandles parameters
9908
9909 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
9910
9911         * profiler.c: updated to use the mono-dl API instead of
9912         gmodule.
9913
9914 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
9915
9916         * profiler.c: updated to use the mono-dl dynamic loading
9917         API instead of gmodule.
9918
9919 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
9920
9921         * profiler.c: use readlink, older versions of glib don't have
9922         g_file_read_link ().
9923
9924 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
9925
9926         * profiler.c: try to detect the path to mono if libc fails to provide
9927         a useful name (bug #80286).
9928
9929 2006-12-16  Raja R Harinath  <rharinath@novell.com>
9930
9931         Fix #80242
9932         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
9933         instance, use the generic type definition instead.
9934         (ves_icall_Type_GetNestedTypes): Likewise.
9935         * class.c (mono_class_create_generic): Always set the
9936         nested_classes of a generic instance to NULL, even if the generic
9937         type definition has nested types.
9938
9939 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
9940
9941         * marshal.c (mono_string_from_bstr): Revert previous Windows change
9942         and fix on Linux.
9943         
9944 2006-12-15  Miguel de Icaza  <miguel@novell.com>
9945
9946         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
9947         my arguments were in the wrong order.   I also fixed the Windows
9948         version which seems to have had the same issue.
9949
9950         (mono_free_bstr): On Unix, this is g_free.
9951         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
9952         conversions (for the tests in corlib to pass).
9953
9954 2006-12-14  Miguel de Icaza  <miguel@novell.com>
9955
9956         * marshal.c (emit_ptr_to_object_conv): For now, ignore
9957         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
9958         exception if a ref SafeHandle in a struct has changed).
9959         
9960         (emit_struct_conv): Do not perform layout checks for classes
9961         derived from SafeHandle, as those are specially handled. 
9962
9963         (emit_object_to_ptr_conv): Add support for
9964         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
9965
9966         (emit_marshal_safehandle): Implement conversion of return values
9967         of safehandles (MARSHAL_ACTION_CONV_RESULT).
9968         
9969         * threads.c: WaitHandle now is compiled with two different handles
9970         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
9971         for 2.0.
9972         
9973         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
9974         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
9975         these routines to cope with both kinds of fields.
9976
9977 2006-12-12  Miguel de Icaza  <miguel@novell.com>
9978
9979         * metadata.c (mono_type_to_unmanaged): Handle the case where
9980         type->data.klass is a SafeHandle, and in that case, return the
9981         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
9982         MONO_MARSHAL_CONV_SAFEHANDLE. 
9983
9984 2006-12-11  Miguel de Icaza  <miguel@novell.com>
9985
9986         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
9987         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
9988         calling emit_marshal_object.
9989
9990         (emit_marshal_safehandle): Implement marshalling of
9991         SafeHandle parameters (no ref support yet).
9992
9993         (MarshalAction): Document the defines as I implement
9994         them for SafeHandle.
9995
9996         (emit_marshal_object): indentation police.
9997
9998         * class-internals.h: Define MonoSafeHandle.
9999         Add safehandle_class to MonoDefaults type.
10000
10001         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
10002         list of classes to check for fields. 
10003
10004         * domain.c (mono_init_internal): Add SafeHandle to the list of
10005         mono_defaults loaded.
10006
10007 2006-12-15  Raja R Harinath  <rharinath@novell.com>
10008
10009         Fix #80253
10010         * reflection.c (mono_reflection_bind_generic_parameters): If the
10011         generic type definition is a type builder, ensure that it is fully
10012         initialized before instantiating it.  Kill some dead code.
10013
10014 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
10015
10016         * object.c: clear the loader_error () before loading
10017         more metadata stuff (bug #80258).
10018
10019 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
10020
10021         * icall.c, icall-defs.h: type modifiers icalls for
10022         parameters and properties.
10023
10024 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
10025
10026         * object.c, icall.c: fixed warnings.
10027
10028 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
10029
10030         * marshal.c: fixed a couple of leaks and coding style in a few places.
10031
10032 2006-12-08  Dick Porter  <dick@ximian.com>
10033
10034         * process.c: Cope with NULL ProcessStartInfo arguments on windows
10035         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
10036         80173.
10037
10038 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
10039
10040         * process.c: ProcessStartInfo may have only filename set and
10041         arguments can be NULL.
10042
10043 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
10044
10045         * icall.c: fix leak found by Robert Jordan.
10046
10047 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
10048
10049         * marshal.c, marshal.h: generate managed method to access an element
10050         of a multi-dimensional array.
10051
10052 2006-11-30  Paolo Molaro (lupus@ximian.com)
10053
10054         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
10055
10056 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
10057
10058         * icall.c: back out GetFields () fix until the serialization code is
10059         fixed to not depend on the incorrect behaviour.
10060
10061 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
10062
10063         * profiler.c: provide defaults if none are set.
10064
10065 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
10066
10067         * Makefile.am, attrdefs.h: new public header file with
10068         constants for attributes for use by embedders.
10069
10070 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
10071
10072         * icall.c: GetFields () fix for bug #80064.
10073
10074 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
10075
10076         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
10077         removed long unused icalls.
10078
10079 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
10080   
10081         * marshal.c: 
10082                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
10083                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
10084                 can be generated without a delegate class.
10085                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
10086         
10087         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
10088
10089 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10090
10091         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
10092         #80069.
10093
10094 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
10095
10096         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
10097         icall-def.h: added icalls needed by System.GC.
10098
10099 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
10100
10101         * loader.c: ensure the class in catch clauses is handled
10102         correctly for generics methods (fixes bug#79980).
10103
10104 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
10105
10106         * monitor.h, monitor.c: added mono_locks_dump () function
10107         to help debug deadlocks involving managed locks.
10108
10109 2006-11-13  Dick Porter  <dick@ximian.com>
10110
10111         * file-io.c (get_file_attributes): If the file is a symlink try
10112         and get the stat data for the target, but also add the
10113         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
10114         the specs for the windows symlink support, but will probably have
10115         to be reworked when I have test data from a vista machine.  Fixes
10116         bug 79887.
10117
10118 2006-11-13  Dick Porter  <dick@ximian.com>
10119
10120         * gc.c (mono_domain_finalize): 
10121         * marshal.c (mono_delegate_begin_invoke): 
10122         * threadpool.c (socket_io_init, mono_thread_pool_init)
10123         (mono_thread_pool_finish): 
10124         * monitor.c (mono_monitor_try_enter_internal): 
10125         * threads.c (mono_thread_resume, mono_thread_init)
10126         (mono_thread_suspend_all_other_threads)
10127         (mono_thread_execute_interruption): 
10128         * appdomain.c (mono_domain_unload): Check for NULL error returns
10129         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
10130         75733.
10131
10132 2006-11-11  Miguel de Icaza  <miguel@novell.com>
10133
10134         * process.c
10135         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
10136         Only close the handle if the value of the handle is not
10137         INVALID_HANDLE_VALUE.  This just makes the process a bit more
10138         robust.
10139
10140         Improvement for #75733, so that we do not run into this problem. 
10141
10142         
10143         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
10144         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
10145         internal variables.  Fixes #79462 
10146         
10147
10148 2006-11-09  Dick Porter  <dick@ximian.com>
10149
10150         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
10151         Use poll() not select().  Fixes bug 79397.
10152
10153 2006-11-09  Raja R Harinath  <rharinath@novell.com>
10154
10155         Fix #79872
10156         * assembly.c (mono_assembly_load_from_full): Check that the given
10157         image has an assembly manifest.
10158
10159 2006-11-09  Ankit Jain  <jankit@novell.com>
10160
10161         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
10162         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
10163         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
10164
10165 2006-11-07  Dick Porter  <dick@ximian.com>
10166
10167         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
10168         Put the old resolver behaviour back for pre-2.0 profiles.
10169
10170 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
10171
10172         * threadpool.c: precise GC and locking fixes.
10173
10174 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
10175
10176         * class.c: don't load types that have an explicit unaligned
10177         managed reference. Provide better info in the TypeLoad exception.
10178         Part of the fix for bug #79744.
10179         * object.c: use the correct check for class type load issues.
10180
10181 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
10182
10183         * class.c: enforce alignment of fields with managed references
10184         even when Pack=1 is forced by the user (bug #77788).
10185
10186 2006-11-03  Dick Porter  <dick@ximian.com>
10187
10188         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
10189         If the address reverse lookup fails, return it as the hostname
10190         anyway.  Fixes bug 79721.
10191
10192 2006-11-03  Dick Porter  <dick@ximian.com>
10193
10194         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
10195         Fix build on Windows.
10196
10197 2006-11-02  Dick Porter  <dick@ximian.com>
10198
10199         * icall-def.h: 
10200         * object-internals.h: 
10201         * exception.c (mono_get_exception_thread_interrupted): 
10202         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
10203         Fixes bug 74525.
10204
10205         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
10206         Check for pending Thread.Interrupt.
10207
10208 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
10209         * loader.c: Fixed bug 79684.
10210
10211 2006-10-27  Dick Porter  <dick@ximian.com>
10212
10213         * file-io.c (get_file_attributes): Force symlinks to directories
10214         to be returned as a regular file.  Fixes bug 79733.
10215 2006-10-26  Dick Porter  <dick@ximian.com>
10216
10217         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
10218         CreateFile to open a directory then we need to set the
10219         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
10220
10221 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
10222
10223         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
10224         friends.
10225
10226 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
10227
10228         * sgengc.c: small cleanup of timer code.
10229
10230 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
10231
10232         * sgen-gc.c: fix some warnings and start adding support for
10233         complete object removal on domain unload.
10234
10235 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
10236
10237         * assembly.c: build_assembly_name should not consider a version
10238         number without build or revision number invalid. Fixes bug #79715.
10239
10240 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
10241
10242         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
10243         call kernel32 function OutputDebugString directly.
10244         
10245         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
10246         
10247 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
10248
10249         * reflection.c: small cleanup, using a function to insert a MonoString
10250         in the string heap.
10251
10252 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
10253
10254         * reflection.c: moving GC fixes.
10255
10256 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
10257
10258         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
10259         all the objects with finalizers belonging to an unloading appdomain.
10260
10261 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
10262
10263         * sgen-gc.c: added ability to allocate even when the nursery is fully
10264         pinned and fixed a couple of bugs.
10265
10266 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
10267
10268         * threads.h: Revert the last change for now.
10269
10270         * threads.h (mono_thread_get_pending_exception): Rename this to
10271         mono_thread_get_undeniable_exception ().
10272
10273 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
10274
10275         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
10276         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
10277         when fname does not refer to valid assembly. This result in a more
10278         meaningful error message.
10279         * exception.c: added mono_get_exception_bad_image_format2 which 
10280         constructs a BadImageFormatException using the ctor taking a custom
10281         message and the file name. Passing in a NULL msg results in a default
10282         message.
10283         * exception.h: define mono_get_exception_bad_image_format2 function.
10284         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
10285         when file name pointed to an invalid IL image. Use 
10286         mono_get_exception_file_not_found2 to construct FileNotFoundException,
10287         as this results in a more meaningful error message.
10288
10289 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
10290
10291         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
10292         #79465.
10293
10294 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
10295
10296         * metadata.c (mono_type_size): Change the align parameter to guint32 for
10297         consistency with the other _size functions.
10298         (mono_type_stack_size): Ditto.
10299
10300         * class.c object.c icall.c: Fix warnings caused by the above change.
10301
10302         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
10303
10304         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
10305
10306         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
10307
10308 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
10309
10310         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
10311         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
10312         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
10313         threadpool.h, threads-types.h: mark more internal functions.
10314
10315 2006-10-11  Dick Porter  <dick@ximian.com>
10316
10317         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
10318         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
10319         reproduce the bug even before applying the fix.)
10320
10321 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
10322
10323         * reflection.c: allow retrieving attributes for arguments in generic
10324         methods (bug #79241).
10325
10326 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
10327
10328         * debug-mono-symfile.c: properly check fopen () result (found by
10329         coverity).
10330
10331 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
10332
10333         * reflection.c: make error message clearer and fixed two
10334         issuelets found by Coverity.
10335
10336 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
10337
10338         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
10339
10340 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
10341
10342         * object-internals.h, gc-internal.h, profiler-private.h:
10343         mark internal functions.
10344
10345 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
10346
10347         * reflection.c: put data in the text section.
10348         * icall.c: recognize more types in type_from_typename ().
10349         * process.c, marshal.c: added some GC FIXMEs.
10350
10351 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
10352
10353         * loader.c: check for NULL before initializing.
10354
10355 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
10356
10357         * gc.c (finalizer_thread): Use a non-alertable wait here.
10358
10359         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
10360         until the correct solution is found.
10361
10362 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
10363
10364         * reflection.c (mono_module_get_object): Avoid an assert when operating on
10365         modules with no metadata. Fixes #79596.
10366
10367         * image.c (load_metadata_ptrs): Put back the error message when
10368         the #- heap is encountered since the support is not complete yet.
10369
10370 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
10371
10372         * gc.c: do not allow the user to SuppressFinalize () a
10373         delegate because it would leak the trampoline if present.
10374
10375 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
10376
10377         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
10378         PropertyPtr table.
10379
10380 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
10381
10382         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
10383
10384         * metadata.c (mono_metadata_get_param_attrs): Ditto.
10385
10386         * row-indexes.h: Add definitions for *Ptr tables.
10387
10388         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
10389
10390         * metadata.c (mono_metadata_translate_token_index): New helper function to
10391         translate table indexes used in uncompressed metadata.
10392         (mono_metadata_decode_table_row): Ditto.
10393         (mono_metadata_decode_table_row_col): Ditto.
10394
10395         * metadata.c: Add table schema for *Ptr tables.
10396
10397         * class.c loader.c: Use the new helper function to access the affected metadata
10398         tables.
10399         
10400         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
10401         #38532.
10402         
10403 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
10404
10405         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
10406         sequences which can be unbounded in size. Fixes #79583.
10407
10408 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
10409
10410         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
10411         static initialization.
10412
10413         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
10414
10415         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
10416
10417         * domain.c (mono_domain_free): Free up type_init_exception_hash.
10418
10419         * object.c (mono_runtime_class_init): Implement correct semantics when a static
10420         ctor fails, i.e. throw the same exception on subsequent accesses.
10421         
10422 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
10423
10424         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
10425         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
10426         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
10427         Handle marshalling of interfaces and VARIANTs contained in structs.
10428         
10429         Code is contributed under MIT/X11 license.
10430         
10431 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
10432
10433         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
10434         
10435         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
10436         mempool.
10437
10438 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10439
10440         * console-io.c: ignore previous SIGINT handler.
10441
10442 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
10443
10444         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
10445         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
10446         #79460, #79461, #79485.
10447
10448         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
10449
10450         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
10451         #79217.
10452
10453 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
10454
10455         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
10456         could be generated from it.
10457
10458 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
10459
10460         * rand.c: fix read loop to correctly handle EINTR.
10461
10462 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
10463
10464         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
10465         internal calls are defined to keep methods closer to the declaring
10466         type and allow a significant reduction in runtime relocations and
10467         memory usage.
10468
10469 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
10470
10471         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
10472         exception message to have FileNotFoundException use the default
10473         assembly load error message. Fixes bug #79426.
10474         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
10475
10476 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10477
10478         * threadpool.c: (start_thread_or_queue) use the root domain when
10479         creating the thread instead of the async object one.
10480
10481 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
10482
10483         * class.c, object.c, class-internals.h, reflection.c:
10484         for arrays, store element_size inside MonoClass (speedup
10485         for array object creation).
10486
10487 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
10488
10489         * icall.c: fixed CodeBase to use the file name and not the module
10490         name (bug #79365).
10491
10492 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
10493
10494         * mono-debug.c, mono-debug.h: export find_method as
10495         mono_debug_find_method ().
10496
10497 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
10498
10499         * debug-helpers.c, class-internals.h: added a few functions useful
10500         when debugging under gdb.
10501
10502 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10503
10504         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
10505         characters that need special handling.
10506
10507 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
10508
10509         * mono-config.c: make the os/cpu specification more flexible,
10510         allowing lists and negation.
10511
10512 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
10513
10514         * marshal.c: COM Interop fixes. Handle case where method->klass.
10515         is interface. Handle BSTR/MonoString when null. Use CDECL as 
10516         calling convention on non-windows platforms. This is for
10517         compatibility with XPCOM and MainWin COM.
10518         
10519         Code is contributed under MIT/X11 license.
10520         
10521
10522 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
10523
10524         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
10525         correctly. Fixes #79217.
10526
10527         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
10528
10529 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
10530
10531         * mono-config.c: allow both an os and cpu attribute for dllmap
10532         and dllentry elemnets to enable a single config file to be used
10533         for multiple architectures.
10534
10535 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
10536
10537         * loader.c: MonoLoaderError was cleared too soon on load failure.
10538         Fixes bug #79424.
10539
10540 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
10541
10542         * icall.c: use the defining class vtable when accessing a
10543         static field, not a pobblibly derived class.
10544
10545 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
10546
10547         * icall.c string-icalls.c: Remove references to unicode.h.
10548
10549         * unicode.h unicode.c Makefile.am: Remove these unused source files.
10550
10551         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
10552
10553         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
10554         indicating the image where custom marshaller types should be looked up.
10555         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
10556         custom marshallers, instead of corlib. Fixes #79425.
10557
10558 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
10559
10560         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
10561
10562 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
10563
10564         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
10565         Implement Environment.ProcessorCount.
10566         
10567         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
10568         Implement Environment.ProcessorCount.
10569         
10570         * icall.c: 
10571         Add Environment.ProcessorCount icall.
10572         
10573         Patch by Jason McFall.
10574
10575 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10576
10577         * assembly.c: don't append .exe/.dll when the filename already contains
10578         one of those extensions.
10579
10580 2006-09-12  Martin Baulig  <martin@ximian.com>
10581
10582         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
10583         to array interfaces.
10584
10585 2006-09-11  Martin Baulig  <martin@ximian.com>
10586
10587         * reflection.c (mono_image_build_metadata): Create the
10588         MethodImpl's after emitting all types and methods, so we don't
10589         need another fixup pass for them.
10590
10591 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
10592
10593         * class.c (mono_class_from_name_case): Fix regression introduced by the last
10594         change.
10595
10596 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
10597
10598         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
10599         unload.
10600
10601 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
10602
10603         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
10604         args is not set. Fixes #78926.
10605
10606 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
10607
10608         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
10609
10610         * image.c (load_class_names): Move this to class.c, and rename it to 
10611         'mono_image_init_name_cache'.
10612         (load_modules): Fix a warning.
10613
10614         * class.c icall.c image.c: Initialize image->name_cache lazily.
10615
10616         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
10617         on its name using information in the AOT file.
10618
10619         * class.c (mono_class_from_name): Use the new hook function.
10620
10621 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
10622
10623         * reflection.c (mono_param_get_objects): Handle enum default parameter values
10624         correctly.
10625
10626         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
10627         Fixes #79289.
10628         
10629 2006-09-06  Martin Baulig  <martin@ximian.com>
10630
10631         * icall.c (mono_lookup_internal_call): Small fix.
10632
10633 2006-09-05  Raja R Harinath  <rharinath@novell.com>
10634
10635         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
10636         double g_free.
10637
10638 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
10639
10640         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
10641         when --debug is specified.
10642
10643 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
10644
10645         * class.c (setup_generic_array_ifaces): Fix a warning.
10646
10647 2006-09-04  Miguel de Icaza  <miguel@novell.com>
10648
10649         * Temporarily remove the patch to assemly.c that checks the
10650         assembly versions as it breaks our gacutil.
10651
10652 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
10653
10654         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
10655
10656         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
10657         a net 1.0 runtime.
10658
10659         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
10660         created using the default ctor. Fixes #79152.
10661         (mono_string_builder_to_utf16): Ditto.
10662
10663 2006-09-01  Martin Baulig  <martin@ximian.com>
10664
10665         Fix handling of the generic array interfaces.
10666
10667         * class-internals.h
10668         (MonoDefaults): Removed `generic_array_class' and added
10669         `generic_ilist' class.
10670
10671         * class.c
10672         (mono_bounded_array_class_get): Add the new generic array interfaces.
10673         (setup_generic_array_ifaces): New static method; create vtable
10674         entries for each method in the generic array interfaces.
10675
10676         * metadata.c
10677         (select_container): Allow "parent-less" generic methods.
10678
10679         * marshal.c
10680         (mono_marshal_get_generic_array_helper): New public method.
10681
10682         * icall.c
10683         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
10684         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
10685         moved the interncall into System.Array.
10686
10687 2006-09-01  Raja R Harinath  <rharinath@novell.com>
10688
10689         A few more cases of avoiding work on types with ->byref set.
10690         Has the real fix for #79238
10691         * icall.c (is_generic_parameter): New helper.
10692         (ves_icall_Type_GetGenericParameterPosition): Use it.
10693         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
10694         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
10695         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
10696         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
10697         reference types.
10698         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
10699         reference types.
10700         (ves_icall_Type_get_IsGenericInstance): Likewise.
10701         (ves_icall_Type_get_IsGenericType): Likewise.
10702
10703 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
10704
10705         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
10706         class if possible.
10707
10708         * mempool.h (mono_mempool_get_allocated): New helper function.
10709
10710         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
10711         change.
10712
10713         * mempool.c: Fix warnings and the calculation of stats.
10714
10715         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
10716
10717         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
10718
10719         * loader.c (mono_get_method_from_token): Update method_count stat.
10720
10721         * class-internals.h (MonoStats): Add some stats.
10722
10723 2006-08-31 Robert Jordan  <robertj@gmx.net>
10724
10725         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
10726         with managed variants.
10727         All code is contributed under the MIT/X11 license.
10728         
10729 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
10730
10731         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
10732         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
10733
10734         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
10735
10736         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
10737         with cycles in classes.
10738
10739         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
10740
10741         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
10742         missing a [MarshalAs] directive. Fixes #79203.
10743
10744         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
10745         klass->marshal_info. Fixes #79217.
10746
10747 2006-08-30  Martin Baulig  <martin@ximian.com>
10748
10749         Committing a patch from Joachim Ante <joe@otee.dk>:
10750         Add support for binary data symbol stores.
10751
10752         * debug-mono-symfile.c
10753         (mono_debug_open_mono_symbol_file): Renamed into
10754         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
10755         arguments.
10756
10757         * mono-debug.c
10758         (mono_debug_open_image): Added `raw_contents' and `size' args.
10759         (mono_debug_init_2_memory): New public function.
10760
10761 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
10762
10763         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
10764
10765 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10766
10767         * appdomain.c: implement support for ShadowCopyFiles.
10768
10769 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
10770
10771         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
10772         when value is NULL (and should remove CID #51).
10773
10774 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10775
10776         * image.c: moved 2 functions to ../utils.
10777
10778 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
10779
10780         * gc.c: cope with the target object of a GC handle being NULL
10781         (bug #78877).
10782
10783 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
10784
10785         * class.c: recursively check parent's explicit implementations
10786         of interface methods (fixes bug #79125).
10787
10788 2006-08-19  Miguel de Icaza  <miguel@novell.com>
10789
10790         * filewatcher.c: Avoid warnings when building, do not redefine
10791         constants that are defined.
10792
10793         Remove warnings.
10794
10795 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10796
10797         * image.c: don't fail when the link points to an absolute path.
10798
10799 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
10800
10801         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
10802         Fix CID #3.
10803
10804 2006-08-17  Miguel de Icaza  <miguel@novell.com>
10805
10806         * image.c (full_path): A new method used to obtain the actual path
10807         of an assembly even in the presence of symbolic links.  
10808
10809         This is necessary for the case where we are running a binary that
10810         has been GACed, but we are using the "published" path name
10811         ($prefix/mono/1.0/blah.exe) which happens to point to the real
10812         file in the GAC.
10813
10814         This was the source of the failure for the `xsp' command with the
10815         recent AppDomain changes, as far as the runtime was concerned,
10816         there were two different assemblies: $prefix/mono/1.0/blah.exe and
10817         $prefix/mono/gac/blah/version/blah.exe.
10818
10819         (do_mono_image_open): use full path
10820
10821 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
10822
10823         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
10824
10825 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
10826
10827         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
10828         domain_id is supplied. Fix CID #241 and corlib's unit tests.
10829
10830 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
10831
10832         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
10833         small structures. Fixes #78990.
10834
10835 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
10836
10837         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
10838
10839         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
10840
10841 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10842
10843         * appdomain.c:
10844         * marshal.c: don't load all the assemblies from a domain into newly
10845         created ones. The new domains might have different rules and load
10846         assemblies from different locations. Fixes bug #76757.
10847
10848         Patch by Lluis. Conflicts resolved by Brian Crowell.
10849
10850 2006-08-16  Alp Toker  <alp@atoker.com>
10851
10852         * socket-io.c: First half of the fix for #79084.
10853         Set sa_size to the length of the content, not that of the struct.
10854         Don't add NULL suffix to the content, this should be done in
10855         managed code if needed.
10856
10857 2006-08-14  Raja R Harinath  <rharinath@novell.com>
10858
10859         Fix part of #79012
10860         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
10861         mono_metadata_parse_type returns NULL.
10862
10863 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
10864
10865         * normalization-tables.h : new file for string normalization data.
10866         * locales.c, locales.h, icall.c :
10867           added load_normalization_resource() for string normalization,
10868           and icall as well.
10869         * Makefile.am : added normalization-tables.h to the sources.
10870
10871 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
10872
10873         * marshal.c: Add more helper functions to reduce code duplication and use them
10874         everywhere.
10875
10876 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
10877
10878         * marshal.c: Fix non-x86 stdcall warnings.
10879         
10880         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
10881         them everywhere.
10882
10883 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
10884
10885         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
10886         type check on multi-dimensional arrays. Fixes #79000.
10887
10888 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
10889
10890         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
10891         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
10892         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
10893         * class-internals.h: add is_com_object to class structure.
10894         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
10895         null checks to COM object marshalling. Fix .ctor call on RCW.
10896         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
10897         
10898         All code is contributed under the MIT/X11 license.
10899
10900 2006-08-09  Dick Porter  <dick@ximian.com>
10901
10902         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
10903         racing mono_monitor_allocator_lock() somewhere, so don't delete
10904         the critical section for now.  Found by running and exiting
10905         monodevelop.
10906
10907 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
10908
10909         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
10910         (ves_icall_System_ComObject_FindInterface): Ditto.
10911         (ves_icall_System_ComObject_CacheInterface): Ditto.
10912
10913         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
10914         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
10915
10916 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10917
10918         * threadpool.c: treat pipes from process asynchronous reads as sockets
10919         when reading from them, so we get select/poll or epoll to wait for
10920         data.
10921
10922 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
10923
10924         * loader.c: Fix a typo (CID #233) in the null check.
10925
10926 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
10927
10928         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
10929         Hopefully fixes #78949.
10930         
10931         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
10932         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
10933         bytes. Fixes #78972.
10934
10935 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10936
10937         * filewatcher.c: we need to set errno here.
10938
10939 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10940
10941         * filewatcher.c: let Win32Exception get the error value.
10942
10943 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10944
10945         * filewatcher.c: translate errno into win32 errors for Win32Exception
10946         to know what happened.
10947
10948 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
10949
10950         * threadpool.c: Fix more warnings.
10951
10952         * assembly.c (search_loaded): Fix warnings.
10953
10954         * threadpool.c (mono_thread_pool_finish): Fix warnings.
10955         (mono_async_invoke): Ditto.
10956
10957 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
10958
10959         * object.c (mono_remote_class_vtable): Need to create proxy vtable
10960         entries for __ComObject type in addition to ComImport types.
10961         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
10962         about hash table.
10963         
10964         All code is contributed under the MIT/X11 license.
10965
10966 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
10967
10968         * image.c: avoid tentative loading of modulerefs that contain
10969         no metadata (P/Invoke library names).
10970
10971 2006-07-28  Dick Porter  <dick@ximian.com>
10972
10973         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
10974         mono_loader_lock() somewhere, so don't delete the critical section
10975         for now.  Found by running and exiting monodevelop.
10976
10977 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10978
10979         * filewatcher.c: define the inotify syscalls when we're building on
10980         linux and have sys/syscall.h. The build system might not have support
10981         for inotify but the target system might have it.
10982
10983 2006-07-26  Miguel de Icaza  <miguel@novell.com>
10984
10985         * domain.c: Documentation updates.
10986
10987         * loader.c (mono_free_method): Do not release the method
10988         information if we are being profiled, as profilers will use this
10989         information at shut down to present some data to the user.
10990
10991         This is needed so that the profiler does not crash, as the
10992         profiler tends to keep MonoMethods around, and they might become
10993         invalid if we free these.
10994
10995         (mono_get_method_constrained): Return the original CIL stream
10996         method as well, so verification can be performed against it.
10997
10998 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10999
11000         * filewatcher.[ch]: support for inotify file system watcher.
11001         * icall.c: add new internal calls for the inotify file system watcher.
11002
11003 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11004
11005         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
11006         #78888.
11007
11008 2006-07-20  Dick Porter  <dick@ximian.com>
11009
11010         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
11011         warning.
11012
11013 2006-07-20  Dick Porter  <dick@ximian.com>
11014
11015         * threads.c (start_wrapper): Do the thread cleanup while we still
11016         hold a reference to its object.  Fixes bug 78123.
11017
11018 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
11019
11020         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
11021         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
11022           "managed-to-managed".
11023         * icall.c: Redirect string constructors that take sbyte* to
11024           ves_icall_System_String_ctor_RedirectToCreateString.
11025         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
11026           to CreateString () methods with matching signature.
11027         * reflection.c: Use original security informations for
11028           MONO_WRAPPER_MANAGED_TO_MANAGED.
11029         * security-manager.c: Use original security informations for
11030           MONO_WRAPPER_MANAGED_TO_MANAGED.
11031         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
11032           that is a placeholder and only its address should be used.
11033         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
11034           that is a placeholder and only its address should be used.
11035
11036 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
11037
11038         Begin implementing COM Interop.
11039         * appdomain.c: Increment corlib version.
11040         * class.c: Set ComImport classes' parent to __ComObject.
11041         * loader.c: Mark cominterop methods as such.
11042         * domain.c: Add __ComObject class to MonoDefaults structure.
11043         * image.c: Add 2 hashtables to the image for COM Interop related methods
11044         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
11045         using the mempool allocator
11046         
11047         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
11048         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
11049         declaration for mono_metadata_type_dup_mp.
11050         
11051         * debug-helpers.c: Added strings for two additional wrapper types
11052         * object.c: Create proxy objects for ComImport classes
11053         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
11054         and added __ComObject class to MonoDefaults structure.
11055         
11056         * object-internals.h: Finish MonoRealProxy definition, and add definition of
11057         MonoComInteropProxy and MonoComObject.
11058         
11059         * marshal.c: Added support for COM Interop
11060         (signature_cominterop): Converts managed signature to corresponding
11061         unmanaged COM signature.
11062         (cominterop_get_function_pointer): gets unmanaged function pointer via
11063         COM object vtable
11064         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
11065         (cominterop_get_method_interface): returns interface type that method is defined on
11066         (mono_mb_emit_cominterop_call): emits native call to function pointer
11067         gotten from vtable
11068         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
11069         that matches signature of unmanaged function.
11070         (cominterop_get_native_wrapper): wrapper around adjusted method call.
11071         (cominterop_get_invoke): forwards call from proxy to __ComObject
11072         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
11073         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
11074         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
11075         
11076         * marshal.h: Added Marshal icall declarations.
11077         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
11078         so we can access them in finalizer
11079         
11080 2006-07-14  Dick Porter  <dick@ximian.com>
11081
11082         * object.c (mono_type_initialization_cleanup): Fix a race
11083         condition by temporarily commenting out the critical section
11084         deletion.
11085
11086 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
11087
11088         * reflection.c (create_custom_attr): Fix some warnings.
11089         (create_custom_attr_data): Ditto.
11090         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
11091         types. Fixes #78855.
11092
11093 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
11094
11095         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
11096
11097         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
11098
11099 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
11100
11101         * reflection.c (resolve_object): Add support for DynamicMethod.
11102
11103         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
11104         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
11105
11106 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
11107
11108         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
11109         don't leak GPtrArray's pdata has we have no use (nor free) for it.
11110
11111 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
11112
11113         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
11114         Fixes #77888.
11115
11116 2006-06-30  Raja R Harinath  <rharinath@novell.com>
11117
11118         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
11119         slightly: remove a shadow local variable.
11120
11121 2006-06-29  Raja R Harinath  <rharinath@novell.com>
11122
11123         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
11124         definition that introduces the virtual function slot.
11125         Also fix Coverity #105.
11126
11127 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
11128
11129         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
11130         for dynamic assemblies. Fixes #78724.
11131
11132 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
11133
11134         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
11135         Fixes #78722.
11136
11137 2006-06-21  Martin Baulig  <martin@ximian.com>
11138
11139         * reflection.c
11140         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
11141         fixes #76484.
11142
11143 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
11144
11145         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
11146
11147 2006-06-20  Raja R Harinath  <rharinath@novell.com>
11148
11149         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
11150         nor TYPEREFs.
11151         * class.c (mono_class_create_from_typespec): Add 'context' argument.
11152         Inflate result if necessary.
11153         (mono_class_get_full): Remove old version.  Rename from
11154         'mono_class_get' and add 'context' argument.  Pass it to
11155         ..._create_from_typespec.
11156         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
11157         (mono_ldtoken): Revert change below.
11158
11159 2006-06-20  Martin Baulig  <martin@ximian.com>
11160
11161         * class.c (mono_ldtoken): Don't pass the generic context to
11162         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
11163
11164 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
11165
11166         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
11167         and later freeing it. Fixes #78638.
11168
11169 2006-06-15  Miguel de Icaza  <miguel@novell.com>
11170
11171         * icall.c (mono_class_get_throw): Revert over-zealous error
11172         throwing, the caller for mono_class_get_throw will cope with
11173         errors when classes are not properly initialized already.
11174
11175         The code still copes with loader exceptions though.
11176
11177         Fixes the regression in reftype1 and reftype3 from the CAS tests.
11178         
11179 2006-06-14  Miguel de Icaza  <miguel@novell.com>
11180
11181         Fixes the `make run1' version of RuntimeAbort (to be commited,
11182         source is in Bugzilla).
11183         
11184         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
11185         FALSE on class loading failure instead of returning true.
11186
11187         * class.c (mono_class_create_from_typedef): It is possible for
11188         mono_metadata_interfaces_from_typedef_full to fail if a class is
11189         not found, cope with this.
11190         
11191
11192 2006-06-14  Dick Porter  <dick@ximian.com>
11193
11194         * socket-io.c: 
11195         * process.c: Fix a bunch of signed/unsigned warnings from gcc
11196         4.1.1
11197
11198 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
11199
11200         * culture-info-table.h : oops, forgot to make it nsync with r61548.
11201
11202 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
11203
11204         * icall.c: Another fix for building mono in Visual Studio.
11205
11206 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
11207
11208         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
11209         
11210 2006-06-09  Martin Baulig  <martin@ximian.com>
11211
11212         * debug-mono-symfile.c: Put this back and really fix it this
11213         time. Sorry for all the trouble.
11214
11215 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
11216
11217         * icall.c (mono_class_get_throw): Fix a warning.
11218         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
11219         ReflectionTypeLoadException if needed. Fixes #78606.
11220
11221         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
11222         (mono_class_init): Ditto.
11223
11224         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
11225         ref_only exceptions.
11226         (mono_loader_clear_error): Make this work even if there is no error.
11227
11228 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
11229
11230         * object-internals.h marshal.c marshal.h icall.c: Implement method 
11231         Marshal.GetComSlotForMethodInfo using internal call.
11232
11233 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
11234
11235         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
11236         a function for signalling it.
11237
11238         * class.c (mono_class_from_typeref): Use the new kind of loader error when
11239         a referenced assembly is not found.
11240
11241         * loader.c (mono_loader_error_prepare_exception): Add support for 
11242         LOADER_ERROR_ASSEMBLY. Fix formatting.
11243
11244 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
11245
11246         * domain.c appdomain.c class-internals.h marshal.c: Add support 
11247         for VARIANT marshalling on windows and increment corlib version
11248         since Variant struct was added.
11249
11250 2006-06-03  Miguel de Icaza  <miguel@novell.com>
11251
11252         * debug-mono-symfile.c: Revert Martin's previous patch which broke
11253         stack trace line information:
11254
11255         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
11256         (Martin) when looking up B which is between A and C, return A not C.
11257
11258         Bug is #78573.
11259
11260         Thanks to Alexander Olk for tracking this down.
11261
11262 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
11263
11264         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
11265         
11266         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
11267         avoid clobbering its value.
11268         (mono_string_to_lpstr): Fix a warning on windows.
11269
11270 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
11271
11272         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
11273
11274         * reflection.c loader.c: Removed references to 'dummy' flag.
11275
11276         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
11277
11278         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
11279         it gets GC tracking.
11280
11281         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
11282         GC tracking.
11283         
11284         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
11285
11286         * marshal.c threadpool.c: Update callers of mono_async_result_new.
11287
11288         * appdomain.c: Bump corlib version.
11289
11290 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
11291
11292         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
11293         CEE_STIND_REF when working with object references.
11294
11295 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
11296
11297         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
11298         Fixes #78539.
11299
11300 2006-05-30  Miguel de Icaza  <miguel@novell.com>
11301
11302         * loader.c (method_from_memberref): Fix argument value for
11303         mono_loader_set_error_method_load (I was passing the MonoClass
11304         instead of the class name char *).
11305
11306 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
11307
11308         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
11309         CEE_STIND_REF when working with object references.
11310
11311 2006-05-30  Martin Baulig  <martin@ximian.com>
11312
11313         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
11314         mono_method_full_name() change and replace the ':' with a '.'
11315         here.
11316
11317 2006-05-30  Martin Baulig  <martin@ximian.com>
11318
11319         * debug-mono-symfile.c
11320         (mono_debug_symfile_lookup_location): Fix the algorithm:
11321         when looking up B which is between A and C, return A not C.
11322
11323 2006-05-29  Martin Baulig  <martin@ximian.com>
11324
11325         * mono-debug.h
11326         (MonoDebugMethodInfo): Make the typedef public.
11327         (MonoDebugSourceLocation): New public struct.
11328
11329         * mono-debug.c
11330         (mono_debug_source_location_from_address): Removed.
11331         (mono_debug_source_location_from_il_offset): Removed.
11332         (mono_debug_il_offset_from_address): Removed.
11333         (mono_debug_address_from_il_offset): Removed.
11334         (mono_debug_lookup_method): New public function.
11335         (mono_debug_lookup_source_location): New public function; replaces
11336         the old mono_debug_source_location_from_*() functions; see the
11337         inline documentation.
11338         (mono_debug_free_source_location): New public function.
11339         (mono_debug_print_stack_frame): New public function; see the
11340         inline documentation.
11341
11342         * debug-mono-symfile.c
11343         (mono_debug_find_source_location): Renamed into
11344         mono_debug_symfile_lookup_location(); only take a
11345         `MonoDebugMethodInfo *' and an `offset' argument; added inline
11346         documentation.
11347         (mono_debug_find_method): Renamed into
11348         mono_debug_symfile_lookup_method().
11349
11350 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
11351
11352         * assembly.c (mono_assembly_open_full): Dont overwrite the status
11353         returned by mono_image_open_full ().
11354
11355         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
11356         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
11357         #78517.
11358
11359         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
11360         #78518.
11361
11362 2006-05-27  Miguel de Icaza  <miguel@novell.com>
11363
11364         * class.c (mono_class_from_typeref): handle missing images
11365         earlier, deals with bug #78418.   Refactor code; 
11366
11367         Fix a warning introduced in my previous commit (some stale code
11368         from before I revisited my patch).
11369
11370         * class.c (mono_class_create_from_typedef): On failure, remove the
11371         class from the MonoImage->class_cache as the class is not
11372         initialized;   Fixes the leak pointed out by Paolo.
11373
11374 2006-05-25  Dick Porter  <dick@ximian.com>
11375
11376         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
11377         DeleteCriticalSections until I figure out which one may still be
11378         sometimes locked when mono_thread_cleanup is called.
11379
11380 2006-05-24  Dick Porter  <dick@ximian.com>
11381
11382         * threads.c (mono_thread_cleanup): Move the threading cleanup out
11383         of mono_thread_manage and back into its own function, so it can be
11384         called after the finalizer thread has finished.
11385
11386         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
11387
11388 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
11389
11390         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
11391         Fixes #78495.
11392
11393         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
11394         with non-blittable elements.
11395         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
11396
11397 2006-05-24  Martin Baulig  <martin@ximian.com>
11398
11399         * mono-debug-debugger.h (MonoDebuggerEvent): Added
11400         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
11401
11402         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
11403         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
11404         `mono_debugger_event_handler' to NULL.
11405
11406 2006-05-24  Martin Baulig  <martin@ximian.com>
11407
11408         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
11409
11410 2006-05-24  Martin Baulig  <martin@ximian.com>
11411
11412         * mono-debug-debugger.h
11413         (mono_debugger_create_notification_function): Added
11414         `MonoCodeManager *' argument.
11415
11416 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
11417
11418         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
11419
11420 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
11421
11422         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
11423         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
11424         implementation.
11425
11426 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
11427
11428         * icall.c: precise GC support: objects can't be stored in unmanaged
11429         memory anymore, even if they are kept alive by other references: since
11430         they can move the GC needs to be able to always find them.
11431
11432 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
11433
11434         * object.c: precise GC support for static fields. Support
11435         for moving GCs: write barriers and pinned allocation for interned
11436         strings.
11437
11438 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
11439
11440         * domain.c, domain-internals.h: precise GC support for the MonoDomain
11441         structure.
11442
11443 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
11444
11445         * class.c, gc.c: sgen and precise GC updates.
11446
11447 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
11448
11449         * marshal.h, marshal.c: added write barrier wrapper and precise type
11450         fixes.
11451
11452 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
11453
11454         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
11455         support.
11456
11457 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
11458
11459         * reflection.c: precise and sgen GC updates.
11460
11461 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
11462
11463         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
11464
11465 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
11466
11467         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
11468
11469 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
11470
11471         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
11472         MONO_TYPE_OBJECT. Fixes #78462.
11473
11474 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
11475
11476         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
11477         and blittable types.
11478
11479 2006-05-17  Miguel de Icaza  <miguel@novell.com>
11480
11481         * class.c (mono_class_get_exception_for_failure): Implement parts
11482         of a TODO: if the loader error is set (instead of the class
11483         error), we return a Loader exception that can be properly thrown
11484         elsewhere.
11485
11486         This was exposed by some Winforms 2.0 code that I tried to run
11487         (Atsushi pointed me to it).
11488
11489 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
11490
11491         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
11492         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
11493         
11494         * marshal.c (emit_marshal_vtype): Add limited support for 
11495         UnmanagedType.LPStruct. Fixes #78427.
11496
11497         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
11498         Applied a patch from kangaroo to fix #77523.
11499
11500 2006-05-17  Martin Baulig  <martin@ximian.com>
11501
11502         * threads.c
11503         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
11504         (debugger_thread_created): Removed.
11505         (debugger_thread_exited): Removed.
11506
11507 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
11508
11509         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
11510
11511         * object-internals.h (MonoReflectionResource): Sync with managed version.
11512
11513 2006-05-12  Wade Berrier <wberrier@novell.com>
11514
11515         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
11516
11517 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
11518
11519         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
11520         functions try to allocate from the image mempool.
11521
11522 2006-05-12  Dick Porter  <dick@ximian.com>
11523
11524         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
11525
11526 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
11527
11528         * object.c: The FieldGetter and FieldSetter methods require the full
11529         name of the class, not only the name. Fixes bug #78277.
11530
11531 2006-05-11  Miguel de Icaza  <miguel@novell.com>
11532
11533         * loader.c (method_from_memberref): Do not pass the NULL klass to
11534         mono_loader_set_error_() methods.  Pass the non-NULL value
11535         (class). 
11536
11537 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
11538
11539         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
11540         (mono_assembly_close): Null out assembly->image->references after freeing it.
11541
11542         * image.c (mono_image_close): Free image->references.
11543         
11544         * reflection.c (mono_image_basic_init): Fix a small memory leak.
11545
11546 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
11547
11548         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
11549         before checking if it's NULL (g_assert).
11550
11551 2006-05-10  Martin Baulig  <martin@ximian.com>
11552
11553         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
11554         I thought I already killed that two months ago, but now it somehow reappeared.
11555
11556 2006-05-10  Martin Baulig  <martin@ximian.com>
11557
11558         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
11559
11560 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
11561
11562         * reflection.c: Allocate memory for dynamically created methods in the image
11563         mempools.
11564
11565 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
11566
11567         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
11568         don't use the ad pointer before checking if it's NULL (g_assert).
11569
11570 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
11571
11572         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
11573         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
11574
11575         * marshal.c: Allocate all signatures from mempools.
11576
11577         * marshal.c: Allocate some more signatures from mempools.
11578
11579 2006-05-09  Miguel de Icaza  <miguel@novell.com>
11580
11581         * object.c (mono_load_remote_field): The code used to provide a
11582         temporary variable for returning results if the user did not
11583         provide a result pointer.  But our temporary variable was allocted
11584         on the satck.
11585
11586         Fix calling code to always pass a result area.   Coverity ID 103.
11587
11588 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
11589
11590         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
11591         value, not the old. Fixes #78312.
11592         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
11593
11594         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
11595         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
11596         per-image cache.
11597
11598         * assembly.c (mono_assembly_close): Free image->references.
11599
11600         * assembly.c (mono_assembly_names_equal): Fix a warning.
11601         (mono_assemblies_cleanup): Cleanup more global data.
11602
11603         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
11604
11605         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
11606         ptr_cache and image->modules.
11607
11608         * image.c (mono_image_init): Allocate array_cache lazily.
11609         
11610 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11611
11612         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
11613         behavior was changed recently and has bad side effects.
11614
11615 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
11616
11617         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
11618         
11619         * assembly.c (mono_assembly_close): Remove a debug printf.
11620
11621         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
11622
11623         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
11624         to also allow for temporary references between mono_image_open ()/close ().
11625
11626         * domain.c (get_runtimes_from_exe): Add a FIXME.        
11627
11628 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
11629
11630         * marshal.c: Fix support for dynamic methods.
11631
11632         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
11633
11634         * marshal.c (mono_marshal_cleanup): New cleanup function.
11635
11636         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
11637         image mempools.
11638
11639         * class.c (mono_class_init): Fix leaking class->nested_classes.
11640
11641         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
11642
11643         * image.c (mono_image_init): Initialize the new cashes.
11644
11645         * image.c (mono_image_close): Destroy the new cashes.
11646
11647         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
11648
11649         * mempool.c (mono_mempool_strdup): New helper function.
11650
11651         * class-internals.h: Add prototype for mono_loader_unlock ().
11652
11653         * domain.c (mono_jit_info_table_find): Fix a warning.
11654         (mono_debugger_check_runtime_version): Ditto.
11655
11656         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
11657         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
11658         functions to these modules.
11659
11660         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
11661         metadata modules.
11662         
11663         * marshal.c (mono_free_bstr): Fix a warning.
11664
11665         * assembly.c (mono_assembly_open_full): Fix another small leak.
11666
11667         * object.c: Fix some unload leaks in the remoting code.
11668
11669         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
11670         function.
11671
11672         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
11673
11674         * reflection.c: Fix some unload leaks in dynamic assemblies.
11675
11676 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
11677
11678         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
11679         * marshal.h: Add BSTR support on Win32
11680         * icall.c: Add BSTR icalls
11681         * metadata.h: Add BSTR enums
11682
11683 2006-04-28  Miguel de Icaza  <miguel@novell.com>
11684
11685         Work to catch the crash from #76795 and turn it into an
11686         exception.   As I stubbed out pieces of the VisualBasic support,
11687         I found a number of places where the code was failing and I added
11688         checks to those places. 
11689         
11690         * metadata.c (do_mono_metadata_parse_generic_class): Make this
11691         function return a status code.  If we fail to parse the signature
11692         from mono_metadata_parse_generic_inst, return FALSE.
11693
11694         * loader.c (mono_get_method_from_token): If we fail to load the
11695         method (mono_class_get) return NULL.   
11696
11697         * (method_from_memberref): Return NULL if we are unable to parse
11698         the method signature
11699
11700         (mono_loader_error_prepare_exception): Since we now use the
11701         loader_error flag internally to stop processing, and obtaining
11702         exceptions that might be thrown will walk this code path the
11703         proper way of going from a MonoLoaderError into a
11704         MonoException was convoluted.   This new routine encapsulates the
11705         process of turning the error into an exception and *clearing* the
11706         error afterwards.
11707         
11708 2006-04-27  Miguel de Icaza  <miguel@novell.com>
11709
11710         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
11711         with missing assemblies), and to cope with:
11712
11713                 * Missing fieldref from a non-existing assembly.
11714                 * Missing methodref from a non-existing assembly.
11715
11716         The first batch of work to address *some* of the issues from 76661.
11717         
11718         * object.c (mono_class_create_runtime_vtable): If we fail to
11719         initialize the class raise the exception here. 
11720
11721         * metadata.c (mono_class_get_overrides_full): If any methods fail
11722         to load return the failure to the caller.
11723
11724         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
11725         flagging assemblies that failed to load.   
11726
11727         Do not crash if we are unable to load the assembly.
11728
11729         (mono_assembly_close): Do nothing with REFERENCE_MISSING
11730         assemblies. 
11731
11732         * loader.c (mono_loader_set_error_type_load): Change the
11733         convention to always pass unallocated strings, so we make our own
11734         copies (I know our own code had duplicated strings before, but
11735         this keeps the normal conventions).
11736         (method_from_memberref): Call mono_loader_set_error_method_load
11737         for all possible failures of loading the class. 
11738         Remove assert, turn into a loader error.
11739
11740         (mono_loader_error_to_exception): Move this routine from mini
11741         (mini_loader_error_to_exception) there was no need to have that in
11742         mini. 
11743
11744         * class.c (mono_class_from_typeref): If we were not able to load
11745         the assembly with mono_assembly_load_reference, call the
11746         mono_loader_set_error_type_load to register the problem.
11747
11748         (mono_class_setup_fields): If we fail to load the type from
11749         mono_metadata_parse_type_full, call mono_class_set_failure and
11750         break from the loop.
11751
11752         If class->exception_type is set, we do not layout the fields as
11753         that might crash the runtime, and instead return (from breaking
11754         from the previous loop).
11755
11756         (mono_class_setup_vtable): This now returns a boolean indicating
11757         whether the table was properly setup.   The decision is driven by
11758         mono_class_get_overrides_full which might run into non-existing
11759         methods. 
11760         
11761         (mono_class_init): Returns TRUE on success or FALSE if there was a
11762         problem in loading the type (incorrect assemblies, missing
11763         assemblies, methods, etc).
11764
11765         When we call mono_class_setup_fields we also check for a potential
11766         error inside this call (either a class exception or a general
11767         loader exception).
11768
11769         (mono_class_create_from_typedef): If the parent fails to load
11770         (calling mono_class_get_full) return NULL.
11771         
11772         ** Important **
11773
11774         calls to mono_metadata_parse_type_full should be checked
11775         everywhere and set the mono_class_set_failure
11776         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
11777
11778         The current patch checks the places where my manually constructed
11779         tests show the errors are showing up, but we should do it
11780         everywhere. 
11781
11782         ** Important2 **
11783
11784         mono_class_init return values should be tested everywhere, like
11785         the previous case this is something that we should audit
11786         everywhere and not only on the cases exposed by the tests I
11787         created. 
11788
11789 2006-04-26  Miguel de Icaza  <miguel@novell.com>
11790
11791         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
11792         boolean parameter and instead pass the information on `options'
11793         parameter (FileOptions).
11794
11795         * icall.c: Register the new signature for MonoIO.Open.
11796
11797         * debug-helpers.c (dis_one): Trying to understand how coverity
11798         works.  Fix Run 5, item 78.
11799
11800 2006-04-26  Dick Porter  <dick@ximian.com>
11801
11802         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
11803         dereference.
11804
11805 2006-04-25  Martin Baulig  <martin@ximian.com>
11806
11807         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
11808
11809         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
11810         debugger_thread_created().
11811         (debugger_gc_push_all_stacks): Don't handle the main thread in any
11812         special way.
11813         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
11814         (mono_debugger_finalize_threads): New function; undo the effects
11815         of mono_debugger_init_threads().
11816         (mono_debugger_create_all_threads): Removed.
11817
11818 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
11819
11820         * image.c (mono_image_close): Tidy up trace messages.
11821
11822         * assembly.c (mono_assembly_close): Ditto.
11823
11824         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
11825         no longer references an already freed assembly. Fixes #78168.
11826
11827 2006-04-21  Dick Porter  <dick@ximian.com>
11828
11829         * threads.c (mono_thread_detach): Fix reference counting when
11830         detaching threads.
11831
11832 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
11833
11834         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
11835         #78155.
11836
11837 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
11838
11839         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
11840         (mono_type_to_stind): Ditto.
11841
11842         * marshal.c: Use the new helper functions to simplify code.
11843
11844         * image.c (mono_image_close): Add some code for help debug assembly unloading
11845         problems.
11846
11847         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
11848         image mempool.
11849
11850         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
11851         assembly was already loaded in another appdomain. Fixes #78083.
11852
11853 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
11854
11855         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
11856         referenced assemblies.
11857         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
11858
11859         * domain.c (mono_domain_free): Add a trace message.
11860
11861         * appdomain.c (add_assemblies_to_domain): Ditto.        
11862
11863         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
11864         field.  
11865
11866 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
11867
11868         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
11869
11870 2006-04-12  Martin Baulig  <martin@ximian.com>
11871
11872         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
11873         `USE_INCLUDED_LIBGC'.   
11874
11875 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
11876
11877         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
11878         the patch contains ../ and a small directory name later. Hopefully fixes
11879         #78035.
11880
11881 2006-04-10  Martin Baulig  <martin@ximian.com>
11882
11883         Clean up the debugger's thread-handling code.
11884
11885         The debugger's thread-handling code has been moved from
11886         ../mini/debug-debugger.c to threads.c.  We now iterate directly
11887         over the `threads' hash, keep track of exiting threads and also
11888         use proper locking.
11889
11890         We can now debug XSP and XSP based applications with the debugger.
11891
11892         * object-internals.h (MonoThread): Added `gpointer end_stack'.
11893
11894         * threads.h
11895         (MonoThreadCallbacks): Removed; this was only used by the debugger.
11896         (mono_install_thread_callbacks): Likewise.      
11897
11898         * threads.c (mono_thread_callbacks): Removed.
11899         (debugger_thread_created, debugger_thread_exited): New static functions.
11900         (start_wrapper): Call debugger_thread_created().
11901         (thread_cleanup): Call debugger_thread_exited().
11902         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
11903         (mono_debugger_init_threads): New public function.
11904         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
11905         iterate directly over the `threads' hash and also use proper locking.
11906
11907         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
11908
11909         * mono-debug-debugger.h
11910         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
11911
11912 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
11913
11914         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
11915         argument type=array. Fixes #78057.
11916
11917 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
11918
11919         * culture-info-table.h : regenerated. Fixed bug #69652.
11920
11921 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
11922
11923         * loader.c metadata.c: Reapply a variant r59116.
11924         
11925         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
11926
11927         * class.c (mono_class_setup_interface_offsets): New internal function.
11928
11929         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
11930         interfaces too. Fixes #77398.
11931
11932         * reflection.c (encode_cattr_value): Add support for 
11933         parameter type=object, argument type=array.
11934         (load_cattr_value): Ditto. Fixes #77916.
11935
11936         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
11937         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
11938
11939         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
11940         a byval char array and CharSet is Ansi.
11941
11942         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
11943
11944 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
11945
11946         * metadata.c: Add some locking comments.
11947         
11948         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
11949         mempool.
11950         (mono_metadata_free_method_signature): Don't free the signature itself.
11951
11952         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
11953
11954         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
11955         reference the same MonoImage.
11956         (mono_assembly_load_from_full): Add an assert.
11957
11958 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
11959
11960         * image.c (mono_image_close): Don't put the image we are about to free into the
11961         loaded_images_guid_hash.
11962
11963         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
11964         to reduce code duplication.
11965
11966         * marshal.c: Register the native functions called by this module as icalls, to
11967         somewhat centralize the creation of MonoMethodSignature's.
11968
11969         * loader.c (mono_method_signature): Add a cache for method signatures.
11970
11971         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
11972         the parameter attributes of a method.
11973         (mono_metadata_parse_method_signature_full): Refactored the computation of
11974         parameter attributes into a separate function. Also avoid one allocation in
11975         most cases.
11976
11977         * assembly.c (mono_assembly_close): Ditto.
11978
11979         * image.c (mono_image_close): Log trace messages with INFO level.
11980
11981         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
11982
11983         * image.c reflection.c: Correct reference counting of image modules.
11984         
11985         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
11986         of this function from the image mempool.
11987         
11988         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
11989         to allow more cached types to be used.
11990
11991         * mono-debug.c (mono_debug_add_method): Appled patch from
11992         David S. Miller  <davem@sunset.davemloft.net>: Access 
11993         minfo->lexical_blocks[] entry elements using read32().
11994
11995 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
11996
11997         * loader.c (mono_free_method): No longer free the method header for non-dynamic
11998         methods as it is allocated from the mempool.
11999
12000         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
12001         image mempool.
12002
12003         * metadata-internals.h: Add comments describing the reference counting scheme
12004         used for MonoImage and MonoAssembly.
12005
12006         * image.c assembly.c reflection.c: Rework reference counting of images and 
12007         assemblies so they are freed when the runtime is shut down. Free some 
12008         additional memory structures when an image is unloaded.
12009         
12010 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
12011
12012         * class.c loader.c reflection.c: Allocate more data structures in
12013         the image mempool.
12014
12015 2006-03-31  Miguel de Icaza  <miguel@novell.com>
12016
12017         * icall.c
12018         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
12019         build on pre glib 2.4 systems.
12020
12021 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
12022
12023         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
12024
12025         * icall.c: Fix some warnings.
12026
12027 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
12028
12029         * culture-info-table.h : regenerated.
12030
12031 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
12032
12033         * threads.c, object-internals.h, verify.c: changed the culture caching
12034         code to use a normal MonoArray for storage so the GC can keep track of
12035         them easily. Fixed bits of the cache logic, too and simplified the
12036         code.
12037
12038 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
12039
12040         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
12041         thread for non-Boehm GCs.
12042
12043 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
12044
12045         * domain.c, object.c, domain-internals.h: reduce the amount of memory
12046         needed to keep track of the data for static fields.
12047
12048 2006-03-29  Raja R Harinath  <rharinath@novell.com>
12049
12050         Fix #75172
12051         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
12052         for interface classes.  Use 'num_methods' instead.
12053         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
12054         before using '->vtable_size' field.
12055
12056 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
12057
12058         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
12059         doesn't contain managed pointers, so use a normal hashtable.
12060
12061 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
12062
12063         * reflection.c, class-internals.h, domain.c: fixed handling of types
12064         used as values for objects in custom attributes (bug #77915):
12065
12066 2006-03-24  Martin Baulig  <martin@ximian.com>
12067
12068         * class.c (mono_class_setup_fields): Added support for generic
12069         instances; fixes #77580.
12070
12071 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12072
12073         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
12074
12075 2006-03-24  Dick Porter  <dick@ximian.com>
12076
12077         * file-io.c (get_file_attributes): More stat macro breakage.
12078         Fixes bug 77759.
12079
12080 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
12081
12082         * profiler.c: added the file=filename option in the default profiler
12083         to output the profile data to filename.
12084
12085 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12086
12087         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
12088         bug #77877.
12089
12090 2006-03-22  Martin Baulig  <martin@ximian.com>
12091
12092         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
12093         allocated `MonoClassField *' in `fb->handle'.
12094
12095 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
12096
12097         * class.c, image.c, metadata-internals.h: implemented new mechanism to
12098         allocate interface ID to save memory and allow better ID reuse on
12099         appdomain unload. setup_generic_vtable () removal from Martin.
12100
12101 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
12102
12103         * object.h, appdomain.c, domain.c, exception.c, icall.c,
12104         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
12105         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
12106         write barriers for reference stores with managed objects accessed with
12107         C structures in the runtime and in embedding programs.
12108
12109 2006-03-20  Raja R Harinath  <rharinath@novell.com>
12110
12111         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
12112         'interface_id' and 'max_interface_id' fields of MonoClasses
12113         representing open generic types.
12114
12115 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
12116
12117         * object.h, object.c, icall.c: added functions to deal with
12118         storing valuetypes that contain references in managed objects.
12119         * reflection.c, string-icalls.c, threads.c, marshal.c: small
12120         fixes and comments around uses of mono_array_addr ().
12121
12122 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
12123
12124         * object.h, icall.c, monitor.c: object.GetHashCode ()
12125         implementation that supports the moving garbage collector.
12126
12127 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
12128
12129         * icall.c, threads-types.h, threads.c: implemented finalizer for
12130         LocalDataStoreSlot.
12131
12132 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
12133
12134         * metadata.c (mono_type_size): Add a fixme.
12135         (mono_type_stack_size): Ditto.
12136
12137         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
12138         'type_forwarders' field.
12139
12140         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
12141         attribute from net 2.0.
12142
12143         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
12144         from class.c.
12145
12146         * class.c (mono_class_setup_fields): Fix a warning.
12147         
12148         * class.c (mono_class_from_name): Add support for assemblyref entries
12149         in the EXPORTEDTYPE table.
12150
12151         * reflection.c: Add support for handling type forwarders under net 2.0.
12152
12153         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
12154         
12155 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
12156
12157         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
12158         overwriting entries in ModuleBuild->types, also clean up the code
12159         a little. Fixes #77774.
12160
12161 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
12162
12163         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
12164         load friend assembly info when present.
12165
12166 2006-03-14  Raja R Harinath  <rharinath@novell.com>
12167
12168         Fix crasher on gtest-158.cs.
12169         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
12170         the return value if the MonoClass we want is yet in an
12171         inconsistent state.
12172         * class.c (mono_class_create_from_typedef): Add an comment
12173         explaining an order dependency between mono_class_setup_parent and
12174         mono_class_setup_mono_type.
12175
12176 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
12177
12178         * class.c: documentation updates and events bug fix.
12179
12180 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
12181
12182         * class.c: some cleanup, locking fixes.
12183
12184 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
12185
12186         * class.c: fix the generics code to setup nested
12187         type info to the instantiated type (bug #77770).
12188
12189 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
12190
12191         * marshal.c: fixed a few type correctness issues.
12192
12193 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
12194
12195         * loader.c: the Set/Get/Addrtess array methods should be public.
12196
12197 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
12198
12199         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
12200         
12201         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
12202         info->wrapper.
12203
12204 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
12205
12206         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
12207
12208         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
12209
12210         * mempool.c (mono_mempool_alloc): Speed this up a bit.
12211         (mono_mempool_alloc0): Ditto.
12212
12213 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12214
12215         * socket-io.c:
12216         (create_object_from_sockaddr): it was allocating 4 extra bytes
12217         for the AF_UNIX data. Fixes bug #77747.
12218
12219 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
12220
12221         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
12222
12223 2006-03-09  Dick Porter  <dick@ximian.com>
12224
12225         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
12226         Fixes bug 76966 again.
12227
12228 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
12229
12230         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
12231         names from r57532
12232         * appdomain.c: Bumped corlib version to 48 (due to r57532)
12233
12234 2006-03-07  Martin Baulig  <martin@ximian.com>
12235
12236         * object.c
12237         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
12238
12239 2006-03-07  Martin Baulig  <martin@ximian.com>
12240
12241         * class.c
12242         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
12243         regression introduced in r56970; see gtest-252.cs.
12244
12245         * loader.c (mono_get_method_constrained): Correctly handle generic
12246         methods; see gtest-253.cs.
12247
12248 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
12249
12250         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
12251
12252 2006-03-04  Martin Baulig  <martin@ximian.com>
12253
12254         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
12255         compute the parent type at runtime, just like we're already doing
12256         it for interfaces.
12257
12258         * reflection.c
12259         (mono_reflection_bind_generic_parameters): Don't compute the
12260         parent type anymore.
12261
12262         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
12263
12264 2006-03-04  Martin Baulig  <martin@ximian.com>
12265
12266         * mono-debug-debugger.h
12267         (mono_debugger_create_notification_function): Allocate memory at
12268         runtime and return a pointer to it.
12269
12270 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
12271
12272         * assembly.c: Fix windows build.
12273         
12274         * assembly.c: Fix build.
12275
12276         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
12277
12278         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
12279         
12280 2006-03-03  Dick Porter  <dick@ximian.com>
12281
12282         * process.c
12283         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
12284         Check parameters before dereferencing them.  Fixes Aaron's part of
12285         bug 77393.
12286
12287 2006-03-03  Raja R Harinath  <rharinath@novell.com>
12288
12289         Fix performance regression.
12290         * loader.c (find_method_in_class): Add 'from_class' argument.
12291         Rename 'klass' argument to 'in_class'.  The signature is compared
12292         against the method in 'in_class', and the corresponding method is
12293         returned from 'from_class'.
12294         (find_method): Walk both 'in_class' and 'from_class' in parallel.
12295         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
12296         type definition and generic instantiation in parallel.
12297         (mono_get_method_constrained): Update to changes.
12298
12299 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
12300
12301         * threads.c: make sure the domain is correct, too when doing
12302         mono_thread_attach ().
12303
12304 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
12305
12306         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
12307         windows. Fixes #77683.
12308
12309 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
12310
12311         * object.h, *: introduced specific way to set elements of an array
12312         of references to be used as write barrier. Still need to audit the
12313         uses of mono_array_addr.
12314
12315 2006-03-01  Miguel de Icaza  <miguel@novell.com>
12316
12317         * object-internals.h: New field to cache the assmebly name, patch
12318         from Tambet Ingo (tambet@ximian.com)
12319
12320 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
12321
12322         * decimal.h, class-internals.h, metadata-internals.h,
12323         file-io.h: mark a few function declarations as internal, to
12324         reduce the number of PLT entries.
12325
12326 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12327
12328         * file-io.c: fix typo in warning message.
12329
12330 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
12331
12332         * loader.c: on unix, lookup the "*A" version of a function
12333         if charset is auto as a second option before failing.
12334
12335 2006-02-28  Raja R Harinath  <rharinath@novell.com>
12336
12337         * class.h (mono_class_inflate_generic_method): Revert to two
12338         argument version.
12339         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
12340         (mono_class_inflate_generic_method_full): Add.
12341         * class.c (mono_class_inflate_generic_method_full): Rename from
12342         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
12343         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
12344         * loader.c, reflection.c: Update to changes.
12345
12346 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
12347
12348         * icall.c: const fixes and small improvements.
12349
12350 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12351
12352         * threadpool.c: for asynchronous connect(), enable the same workaround
12353         for BSD 6 as for the Mac. Fixes bug #77637.
12354
12355 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
12356
12357         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
12358         formatted classes. Fixes #77524.
12359
12360 2006-02-24  Raja R Harinath  <rharinath@novell.com>
12361
12362         * class.c (inflate_generic_type): Add a couple more
12363         micro-optimizations.
12364         (inflate_generic_context): Don't use the 'gmethod' from
12365         'inflate_with'.
12366         (mono_class_inflate_generic_method): If the method has generic
12367         parameters, but the passed-in context doesn't have a 'gmethod',
12368         create one.  Use the possibly simplified generic instantiation
12369         from the declaring class instead of the one passed in.
12370
12371 2006-02-24  Raja R Harinath  <harinath@gmail.com>
12372
12373         Make generic method signature and method header handling lazy.
12374         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
12375         (inflate_generic_header): Likewise.
12376         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
12377         parameter to avoid inflating types.
12378         (mono_get_inflated_method): Empty out.
12379         * class.h (mono_class_inflate_generic_method): Update to changes.
12380         * loader.c (mono_get_method_from_token): Don't parse signature for
12381         generic methods, nor methods of generic classes.
12382         (mono_method_signature): Rename from 'mono_method_signature'.
12383         Inflate signature on demand.
12384         (mono_method_get_header): Inflate method header on demand.
12385         * reflection.c: Update to changes.
12386
12387 2006-02-23  Raja R Harinath  <rharinath@novell.com>
12388
12389         * metadata.c (mono_metadata_inflate_generic_inst): If the
12390         instantiation is closed, don't bother expanding it in the new
12391         context.
12392         * class.c (inflate_generic_class): If the generic instantiation
12393         doesn't change after inflation, return the argument itself.
12394         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
12395         Add bounds checks.
12396         (inflate_generic_context): If neither the generic class nor the
12397         generic method instantiations change, return the original context.
12398         * reflection.c (mono_method_get_object): Do
12399         'mono_get_inflated_method' before accessing the ->klass field.
12400         (inflate_mono_method): Don't create a MonoGenericMethod unless
12401         necessary.
12402         (inflate_method): Don't pass a constructed type as the declaring
12403         type of a methodbuilder.
12404
12405 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
12406
12407         * object.c: fix memory overwrite.
12408
12409 2006-02-22  Dick Porter  <dick@ximian.com>
12410
12411         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
12412         it doesn't work any more.
12413         (mono_threads_request_thread_dump): Fix unused variable warnings.
12414
12415 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
12416
12417         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
12418         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
12419         the public header file.
12420
12421 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
12422
12423         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
12424
12425 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
12426
12427         * class-internals.h, object.c: reduce the size of MonoVTable
12428         and store the interface_offsets array at negative offsets.
12429
12430 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
12431
12432         * metadata.c: tweak table descriptors data structures to reduce
12433         size and runtime relocations.
12434
12435 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
12436
12437         * marshal.c: fix some types and opcodes to be type-safe
12438         in marshaling wrappers.
12439
12440 2006-02-21  Ankit Jain  <jankit@novell.com>
12441
12442         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
12443
12444 2006-02-21  Raja R Harinath  <rharinath@novell.com>
12445
12446         * metadata.c (get_constraints): Relax debugging checks for monodis.
12447
12448 2006-02-21  Ankit Jain  <jankit@novell.com>
12449
12450         * metadata.c (mono_metadata_load_generic_params): Move the code
12451         checking for ambiguous generic params from here to mono/dis/get.c
12452         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
12453
12454 2006-02-21  Raja R Harinath  <harinath@gmail.com>
12455
12456         Fix assertion triggered when compiling nemerle.
12457         * class.c (mono_get_shared_generic_inst): Rename from
12458         get_shared_inst and make non-static.
12459         * loader.c (mono_get_shared_generic_method): New.  Used to create
12460         the MonoGenericContext-equivalent of a MonoGenericContainer.
12461         (mono_get_method_from_token): Initialize the 'context' field of
12462         the created MonoGenericContainer.
12463         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
12464         * metadata.c (get_constraints): Add sanity check.
12465         * class-internals.h: Add new internal methods.
12466
12467         * reflection.c (verify_safe_for_managed_space): New sanity check.
12468         Currently checks that owner-less generic parameters aren't allowed
12469         in managed space.
12470         (mono_type_get_object): Use it.
12471         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
12472         that are now in mono_type_get_object.
12473         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
12474
12475 2006-02-19  Raja R Harinath  <harinath@gmail.com>
12476
12477         * metadata.c (mono_type_create_from_typespec): Rename from
12478         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
12479         argument and caching of types in the generic container.
12480         (unwrap_arrays, find_generic_param): Remove.
12481         * metadata-internals.h: Update.
12482         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
12483
12484 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
12485
12486         * class.c (mono_class_get_exception_for_failure): Fix a warning.
12487
12488         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
12489         return values. Fixes #77581.
12490
12491         * class.c (mono_fnptr_class_get): Switch name and name_space.
12492
12493         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
12494         classes and add support for [In, Out] attributes.
12495         (mono_marshal_free_asany): Ditto. Fixes #77524.
12496
12497 2006-02-18  Raja R Harinath  <harinath@gmail.com>
12498
12499         * class.c (mono_class_from_generic_parameter): Make more robust to
12500         incomplete MonoGenericContainers from monodis.
12501
12502 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
12503
12504         * class-internals.h: added some more exception types.
12505         * class.c, metadata.c: added a few checks to handle missing
12506         types.
12507
12508 2006-02-17  Raja R Harinath  <rharinath@novell.com>
12509
12510         Use owner-less generic-params some more.
12511         * class.c (my_mono_class_from_generic_parameter): Remove.
12512         (mono_class_from_generic_parameter): Handle null image,
12513         param->name and param->owner.
12514         (mono_class_from_mono_type): Update.
12515         (mono_class_create_from_typespec): Remove 'container' parameter.
12516         If that parameter is non-null, the result is always inflated by
12517         'mono_class_get_full' anyway.
12518         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
12519         parameter.
12520         (mono_class_get_full): Update.
12521
12522         * class.c (inflate_generic_type) [GENERICINST]: If the generic
12523         instance is not open, don't bother inflating.
12524         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
12525         parse metadata for inflated classes.
12526         (_mono_class_get): Change GenericContext* parameter to
12527         GenericContainer*.
12528         (mono_class_create_from_typespec): Likewise.  Simplify, and
12529         implement trivially.  All the cases are handled in
12530         mono_class_from_mono_type.  Don't inflate returned class.
12531         (mono_class_get_full): Delegate GENERICINST optimization to
12532         inflate_generic_type.
12533         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
12534
12535 2006-02-16  Dick Porter  <dick@ximian.com>
12536
12537         * socket-io.c (create_object_from_sockaddr): Fix typo.
12538         (create_sockaddr_from_object): Check array lengths before
12539         potentially accessing items off the end.
12540         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
12541         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
12542         (ves_icall_System_Net_Sockets_Socket_Send_internal)
12543         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
12544         length checks to avoid wraparound overflows.
12545         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
12546         contents of the array of sockets
12547         (hostent_to_IPHostEntry2)
12548         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
12549         Check return value of inet_ntop ().
12550         (addrinfo_to_IPHostEntry): Fix typo
12551
12552 2006-02-16  Raja R Harinath  <rharinath@novell.com>
12553
12554         Type metadata parsing doesn't use generic-instantiation information.
12555         * metadata.c (mono_metadata_parse_array_full): Change
12556         MonoGenericContext* parameter to MonoGenericContainer*.
12557         (mono_metadata_parse_type_full): Likewise.
12558         (mono_type_create_from_typespec_full): Likewise.
12559         (mono_metadata_parse_mh_full): Likewise.
12560         (mono_metadata_parse_generic_inst): Likewise.
12561         (do_mono_metadata_parse_generic_class): Likewise.
12562         (do_mono_metadata_parse_type): Likewise.
12563         * metadata-internals.h: Update to changes.
12564         * class.c (mono_class_find_enum_basetype): Likewise.
12565         (mono_class_setup_fields): Likewise.
12566         (mono_class_create_from_typespec): Likewise.
12567         * loader.c (method_from_methodspec): Likewise.
12568         (mono_get_method_from_token): Likewise.
12569         (mono_method_get_header): Likewise.
12570
12571 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
12572
12573         * marshal.c: handle additional GENERICINST case (patch from
12574         Thong Nguyen <tum@veridicus.com>).
12575         Fix a few cases where LDIND_I/STIND_I was used for references.
12576
12577 2006-02-16  Raja R Harinath  <rharinath@novell.com>
12578
12579         * reflection.c (mono_reflection_get_token): Remove unused variable.
12580
12581 2006-02-16  Martin Baulig  <martin@ximian.com>
12582
12583         * reflection.c (mono_reflection_get_token): Add support for fields
12584         in instantiated generic types.
12585
12586         * icall.c
12587         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
12588
12589 2006-02-15  Martin Baulig  <martin@ximian.com>
12590
12591         * icall.c
12592         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
12593         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
12594         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
12595         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
12596
12597 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
12598
12599         * class.c, metadata.c, metadata.h, object.c, icall.c,
12600         marshal.c: changed mono_type_get_underlying_type () to do
12601         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
12602         Fixed handling of instantiated generic valuetypes (bug #75479).
12603
12604 2006-02-15  Raja R Harinath  <rharinath@novell.com>
12605
12606         * metadata.c (mono_metadata_decode_signed_value): Simplify.
12607         Delegate to mono_metadata_decode_value, and work on the returned value.
12608
12609         * icall.c (ves_icall_MonoType_GetGenericArguments):
12610         Add consistency check here too.
12611         
12612 2006-02-15  Ankit Jain  <jankit@novell.com>
12613
12614         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
12615         char/short etc.
12616
12617 2006-02-15  Ankit Jain  <jankit@novell.com>
12618
12619         * metadata.c (mono_metadata_decode_signed_value): New function to decode
12620         signed values, used only for representing lower bounds of arrays.
12621         (mono_metadata_parse_array_full): Use new
12622         mono_metadata_decode_signed_value to decode lower bounds.
12623
12624 2006-02-14  Martin Baulig  <martin@ximian.com>
12625
12626         * reflection.c
12627         (mono_reflection_get_token): Support "MonoGenericMethod" and
12628         "MonoGenericCMethod" and allow generic instances / methods.
12629
12630 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
12631
12632         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
12633         to obtain the terminal size using an ioctl.
12634
12635         * object.c (mono_nullable_init): Revert this as nullable reference
12636         types are not valid.
12637         (mono_nullable_box): Ditto.
12638
12639 2006-02-09  Dick Porter  <dick@ximian.com>
12640
12641         * threads.c (mono_thread_detach): Drop a reference to the thread
12642         we're detaching.
12643
12644 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
12645
12646         * object.c (mono_nullable_init): Handle nullable reference types.
12647         (mono_nullable_box): Ditto. Fixes #77446.
12648
12649 2006-02-07  Martin Baulig  <martin@ximian.com>
12650
12651         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
12652
12653 2006-02-07  Ankit Jain  <jankit@novell.com>
12654
12655         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
12656         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
12657         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
12658         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
12659         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
12660         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
12661
12662 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
12663
12664         * class.c (mono_class_create_generic): Set type_token as well.
12665
12666         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
12667         compatible with MS.
12668
12669 2006-02-02  Martin Baulig  <martin@ximian.com>
12670
12671         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
12672         has never been used so far.
12673
12674 2006-02-02  Martin Baulig  <martin@ximian.com>
12675
12676         * mono-debug-debugger.h: Changed comment at the top of this file;
12677         the header is not installed, but it's safe to #include it from
12678         within the JIT.
12679
12680         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
12681         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
12682
12683 2006-02-02  Martin Baulig  <martin@ximian.com>
12684
12685         * mono-debug.h
12686         (MonoSymbolTable): Removed the `metadata_info' field.
12687
12688         * mono-debug.c
12689         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
12690
12691         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
12692         (mono_debugger_add_builtin_types): Removed.
12693         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
12694         (mono_debugger_create_notification_function): We now operate on a
12695         pre-allocated area; take a `gpointer' and return `void'.
12696
12697         * mono-debug-debugger.c
12698         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
12699         (mono_debugger_add_builtin_types): Removed.
12700
12701 2006-02-02  Martin Baulig  <martin@ximian.com>
12702
12703         * threads.c (mono_debugger_create_all_threads): New public method.
12704
12705 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
12706
12707         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
12708         breaks on several platforms.
12709
12710 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
12711
12712         * assembly.c: the VS.NET build doesn't supply default values for
12713         MONO_ASSEMBLIES and MONO_CFG_DIR.
12714
12715 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
12716
12717         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
12718         helper function.
12719
12720         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
12721
12722         * loader.c (method_from_memberref): Fix a warning.
12723
12724         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
12725
12726         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
12727         with explicit layout. Fixes #77433.
12728
12729 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
12730
12731         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
12732         max_interface_id is initialized before using it. Fixes #77398.
12733         (ves_icall_Type_GetInterfaces): Ditto.
12734
12735 2006-01-30  Raja R Harinath  <rharinath@novell.com>
12736
12737         * metadata.c (mono_metadata_parse_method_signature_full): Don't
12738         allocate memory for parameter attributes when parsing memberref
12739         signatures.
12740         * loader.c (mono_loader_set_error_method_load): Don't warn.
12741         (method_from_memberref): Ensure MissingMethodException gets thrown
12742         if method is not found.  Make warning more informative.
12743
12744 2006-01-29  Raja R Harinath  <harinath@gmail.com>
12745
12746         Fix #77397
12747         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
12748         return true if is byref.
12749         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
12750         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
12751         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
12752
12753 2006-01-27  Raja R Harinath  <rharinath@novell.com>
12754
12755         Fix tests/find-method.2.il
12756         * loader.c (find_method, find_method_in_class): Remove is_inflated
12757         argument.  Revert 2006-01-18 change.
12758         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
12759         is generic, search for method in its generic definition.
12760         * class.c (mono_class_setup_vtable_general): Print generic
12761         arguments of generic types in debugging printf.
12762
12763 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
12764
12765         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
12766
12767         * threads.c (mono_threads_request_thread_dump): New helper function.
12768
12769 2006-01-25  Raja R Harinath  <rharinath@novell.com>
12770
12771         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
12772
12773 2006-01-25  Ankit Jain  <jankit@novell.com>
12774
12775         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
12776         move definition to ..
12777         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
12778         
12779 2006-01-25  Ankit Jain  <jankit@novell.com>
12780             Raja R Harinath  <rharinath@novell.com>
12781
12782         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
12783         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
12784         as necessary.
12785
12786 2006-01-25  Martin Baulig  <martin@ximian.com>
12787
12788         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
12789         `MonoDebuggerThread' into debug-debugger.c.
12790
12791 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
12792
12793         * profiler.c: fix printing of data.
12794
12795 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
12796
12797         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
12798           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
12799
12800 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
12801
12802         * object.c: fix deadlock related to string interning.
12803
12804 2006-01-23  Martin Baulig  <martin@ximian.com>
12805
12806         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
12807
12808         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
12809
12810 2006-01-23  Martin Baulig  <martin@ximian.com>
12811
12812         * mono-debug.h: Moved the prototypes of some functions which are
12813         used by the JIT here from mono-debug-debugger.h.
12814
12815 2006-01-21  Martin Baulig  <martin@ximian.com>
12816
12817         * Makefile.am: Don't install mono-debug-debugger.h.
12818
12819 2006-01-21  Martin Baulig  <martin@ximian.com>
12820
12821         * mono-debug-debugger.h: Enforce the private status of this header
12822         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
12823         Moved some stuff from mono-debugger-jit-wrapper.h here.
12824
12825 2006-01-20  Raja R Harinath  <rharinath@novell.com>
12826
12827         * class.c (mono_class_from_typeref): Add a sanity test to help
12828         catch lack of assembly load/search hooks.
12829
12830 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
12831
12832         * marshal.c (emit_struct_conv): Relax the fields with same offset
12833         check even more. Fixes #77230.
12834
12835 2006-01-18  Martin Baulig  <martin@ximian.com>
12836
12837         * loader.c (find_method_in_class): Added `gboolean is_inflated'
12838         argument; if false, we compare the uninstantiated signatures.
12839         (method_from_memberref): Compare the uninstantiated signatures;
12840         fixes #76417.
12841
12842 2006-01-18  Robert Jordan  <robertj@gmx.net>
12843
12844         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
12845         Clear the weak link. Fixes bug #77170.
12846
12847         * gc.c (mono_gchandle_free):
12848         Reflect *-gc.c changes (tiny optimization).
12849
12850 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
12851
12852         * metadata.c (mono_metadata_signature_dup): Applied patch from
12853         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
12854         Fixes #77288.
12855
12856 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
12857
12858         * marshal.c (emit_struct_conv): Allow fields with the same offset when
12859         marshalling from native to managed code. Fixes #77230.
12860
12861 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12862
12863         * threadpool.c: fix problem (Mac only) when more than one asynchronous
12864         connect. Fixes bug #77020.
12865
12866 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
12867
12868         * class.c: fixed id assignement for nested interfaces (bug #77275).
12869         Added also better info for --print-vtable debugging.
12870
12871 2006-01-12  Martin Baulig  <martin@ximian.com>
12872
12873         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
12874         interfaces on-the-fly; fixes #76625.
12875
12876         * class-internals.h
12877         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
12878         don't need that anymore.
12879
12880 2006-01-12  Miguel de Icaza  <miguel@novell.com>
12881
12882         * socket-io.c
12883         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
12884         To avoid initing the nested_classes when not needed I turned the
12885         PeerCredData as a toplevel internal class, as it has to be shared
12886         anyways. 
12887
12888         Fixes the CASA issue.
12889
12890 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
12891
12892         * domain.c: Accessors for MonoJitInfo
12893
12894         * profiler-private.h: Add jitinfo to the end jit hook
12895
12896         * profiler.[ch]: Define new hooks, called after jitting which give
12897         the MonoJitInfo that was compiled
12898
12899 2006-01-10  Martin Baulig  <martin@ximian.com>
12900
12901         * class.c (mono_class_setup_events): Add support for generic
12902         classes; fixes #76440.
12903
12904 2006-01-06  Raja R Harinath  <rharinath@novell.com>
12905
12906         Fix #77160.
12907         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
12908         on passed-in method.
12909
12910 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
12911
12912         * object.c (mono_runtime_invoke_array): Add Nullable support.
12913
12914         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
12915
12916 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
12917
12918         * file-io.c: Don't consider sockets as directory and avoid an endless
12919         loop. Fix bug #76966.
12920
12921 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
12922
12923         * object.c (mono_nullable_init): New helper function.
12924         (mono_nullable_box): Ditto.
12925
12926         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
12927
12928         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
12929
12930         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
12931         
12932 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
12933
12934         * class.c (mono_class_is_assignable_from): Make T assignable to 
12935         Nullable<T>.
12936
12937 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
12938
12939         * appdomain.c: Bump corlib version to 46.
12940         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
12941         serialization purpose) and changed ves_icall_System_Reflection_
12942         Assembly_get_code_base signature to accept a boolean (to escape, or 
12943         not, the assembly code base).
12944
12945 2005-12-23  Dick Porter  <dick@ximian.com>
12946
12947         * icall.c: 
12948         * threads-types.h: 
12949         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
12950         CreateEvent icall now returns "created" boolean parameter.
12951
12952 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
12953
12954         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
12955         #76967.
12956
12957         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
12958         when attr_klass is an interface. Fixes #77045.
12959
12960 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
12961
12962         * marshal.c (emit_struct_conv): Fix previous patch.
12963         
12964         * marshal.c (emit_struct_conv): Add a check for fields with the same
12965         offset.
12966
12967 2005-12-20  Raja R Harinath  <rharinath@novell.com>
12968
12969         Fix regression in Mono.C5.
12970         * class.c (mono_class_create_generic): If 'klass' is an interface
12971         set up the interface offsets.
12972         (mono_class_is_assignable_from): Don't throw away generic arguments.
12973
12974 2005-12-19  Raja R Harinath  <rharinath@novell.com>
12975
12976         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
12977         type parameters.
12978
12979 2005-12-15  Raja R Harinath  <rharinath@novell.com>
12980
12981         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
12982         dead store.
12983         (do_mono_metadata_parse_generic_class): Don't pass the current
12984         generic context when parsing the type being instantiated: it
12985         cannot use it, anyway.
12986
12987         * loader.c (method_from_memberref): Don't inflate a signature if
12988         it doesn't contain any type parameters.
12989
12990 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
12991
12992         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
12993
12994 2005-12-14  Martin Baulig  <martin@ximian.com>
12995
12996         * class.c
12997         (mono_type_get_name_recurse): Don't return null for type
12998         parameters and open generic classes.
12999         (mono_class_setup_methods): Don't exclude generic instances.
13000         (mono_get_unique_iid): Use different IDs for different
13001         instantiations of the same generic type.
13002         (mono_class_setup_vtable): Only use setup_generic_vtable() for
13003         open generic instances; create a normal vtable for closed generic
13004         instances.
13005         (mono_class_setup_vtable_general): We're now also called for
13006         closed generic instances.
13007
13008         * reflection.c
13009         (mono_reflection_bind_generic_parameters): Correctly use
13010         mono_metadata_lookup_generic_inst() everywhere.
13011
13012 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
13013
13014         * object.c (mono_class_create_runtime_vtable): Call 
13015         mono_class_setup_vtable ().
13016
13017         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
13018         function.
13019         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
13020         #76959.
13021
13022         * loader.c (mono_loader_set_error_type_load): Print the type load
13023         warnings to the console so they are more visible to the user.
13024         (mono_loader_set_error_method_load): Ditto.
13025
13026         * reflection.c (ensure_runtime_vtable): Revert the last change as it
13027         is still broken.
13028         
13029         * reflection.c (ensure_runtime_vtable): Fix build.
13030
13031         * reflection.c (ensure_runtime_vtable): Disable an optimization which
13032         doesn't work in all cases.
13033
13034 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
13035
13036         * object.c (mono_array_new_full): Treat a single dimensional array
13037         with 0 lower bounds as an szarray. Fixes #76973.
13038
13039         * reflection.c (custom_attr_visible): Really fix this.
13040
13041 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
13042
13043         * reflection.c (custom_attr_visible): Allow nested public attributes
13044         as well.
13045
13046         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
13047         interface check.
13048
13049 2005-12-12  Raja R Harinath  <harinath@gmail.com>
13050
13051         * class.c (set_generic_param_owner): Delete.
13052         (mono_class_create_from_typedef): Don't set ->owner field of
13053         generic parameters to "param containers" of enclosing classes.
13054         * reflection.c (mono_reflection_initialize_generic_parameter):
13055         Likewise.
13056
13057 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
13058
13059         * reflection.c (custom_attr_visible): Fix build.
13060
13061 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
13062
13063         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
13064         private attributes.
13065         
13066         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
13067         handling of null parameter defaults.
13068
13069 2005-12-09  Raja R Harinath  <rharinath@novell.com>
13070
13071         * class.c (mono_class_from_generic_parameter): Don't set
13072         klass->generic_container.
13073         (my_mono_class_from_generic_parameter): Likewise.
13074
13075 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
13076
13077         * reflection.c (load_public_key): Fix a warning.
13078         (method_encode_code): Fix unaligned accesses.
13079
13080 2005-12-07  Martin Baulig  <martin@ximian.com>
13081
13082         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
13083
13084         * reflection.c
13085         (write_generic_param_entry): Encode our custom attrs.
13086
13087         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
13088
13089 2005-12-07  Martin Baulig  <martin@ximian.com>
13090
13091         * reflection.c (encode_new_constraint): Removed; we don't use the
13092         `NewConstraintAttribute' anymore.
13093
13094 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
13095
13096         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
13097         not fire a TypeResolve event when Assembly.GetType () is called.
13098
13099 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
13100
13101         Beginning of support for nullable types in the runtime. Parts of
13102         this patch are from Martin.
13103
13104         * appdomain.c (MONO_CORLIB_VERSION): Bump
13105
13106         * domain.c (mono_init_internal): get the nullable type
13107
13108         * class.c (mono_class_is_nullable): New method
13109         (mono_class_get_nullable_param): New mehod
13110         (mono_class_create_generic): In types T? set cast_class to T
13111
13112         * class-internals.h (MonoDefaults): new nullable default class
13113         (mono_class_get_nullable_param, mono_class_get_nullable_param):
13114         new methods.
13115
13116 2005-12-05  Raja R Harinath  <rharinath@novell.com>
13117
13118         * metadata.c (select_container): New.  Refactor code to select the
13119         appropriate GenericContainer given the type of generic parameter
13120         we are looking for.
13121         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
13122         not a MonoGenericContext.  Use select_container.  Update parameters.
13123         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
13124         and MONO_TYPE_MVAR.
13125         (unwrap_arrays): Remove duplicate tests.
13126         (find_generic_param): Rename from 'has_same_context'.  Now walks a
13127         generic instantiated class to find any arguments that are generic
13128         parameters.
13129         (mono_type_create_from_typespec_full): Use find_generic_param to
13130         avoid evicting some generic instantiations from the typespec
13131         cache.
13132
13133 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
13134
13135         * reflection.c: fixed writing of doubles on ARM FPA.
13136
13137 2005-12-02  Robert Jordan  <robertj@gmx.net>
13138
13139         * icall.c: Fixed EventInfo.ReflectedType (#76829).
13140
13141 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13142
13143         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
13144         least on SUSE 10 they are not the same (on debian, they are just the
13145         same thing).
13146
13147 2005-12-01  Raja R Harinath  <rharinath@novell.com>
13148
13149         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
13150         DeclaringType for VARs and MVARs.
13151         * class.c (set_generic_param_owner): Fix initialization of owner
13152         fields.
13153
13154 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
13155
13156         * icall.c: fixed Enum.ToObject() to correctly convert the values.
13157
13158 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13159
13160         * threadpool.c: workaround for a bug that shows up on the Mac:
13161         select()+connect() on a blocking socket is not like it should
13162         be, so we proceed to connect() in that case, wasting the I/O
13163         threadpool thread until connect succeedes. Fixes bug #75436.
13164
13165 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13166
13167         * threadpool.c: fix typo when setting file descriptor states.
13168
13169 2005-11-28  Raja R Harinath  <rharinath@novell.com>
13170
13171         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
13172         * metadata.c (mono_metadata_parse_method_signature_full): Don't
13173         create a temporary signature container.
13174         (mono_metadata_parse_generic_param): Update to changes.
13175         (mono_type_create_from_typespec_full): Update to changes.
13176         * loader.c (method_from_memberref): Don't use a
13177         MonoGenericContainer while parsing a memberref signature.
13178         (method_from_methodspec): Remove dead-store of the 'container'
13179         variable.  It's overwritten before use.
13180
13181         * metadata.c (mono_type_create_from_typespec_full): Make debugging
13182         checks tighter.
13183         (mono_metadata_parse_generic_param): Likewise.
13184         * loader.c (find_method_in_class): Does not need a
13185         MonoGenericContainer.  Use 'mono_method_signature' rather than
13186         'mono_method_signature_full'.
13187         (find_method, mono_get_method_constrained, method_from_memberref):
13188         Update to changes.
13189
13190         * metadata.c (mono_type_create_from_typespec_full): Ensure that
13191         owner-less generic-parameters are never evicted from the typespec
13192         cache.
13193
13194         * loader.c (method_from_memberref): Don't use the current context
13195         when parsing signatures.
13196         (method_from_methodspec, mono_get_method_from_token): Update to changes.
13197
13198         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
13199         side-effects in g_assert.
13200         * loader.c (mono_get_method_from_token): Resolve klass earlier so
13201         that we don't potentially lose information.
13202
13203 2005-11-26  Dick Porter  <dick@ximian.com>
13204
13205         * icall.c:
13206         * threads.c: icalls to implement basic (ie, not named)
13207         System.Threading.Semaphore.
13208
13209 2005-11-24  Dick Porter  <dick@ximian.com>
13210
13211         * process.c
13212         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
13213         Use GetProcessId() if it's available.
13214
13215 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
13216
13217         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
13218
13219 2005-11-23  Raja R Harinath  <rharinath@novell.com>
13220             Ankit Jain  <jankit@novell.com>
13221
13222         * loader.c (mono_get_method_from_token): Initialize 'method' field
13223         of all generic parameters before parsing the signature.  Remove
13224         code that "fixed"-up MVAR references.
13225
13226 2005-11-23  Ankit Jain  <jankit@novell.com>
13227
13228         * metadata.c (mono_metadata_has_generic_params):
13229         (mono_metadata_load_generic_param_constraints):
13230         (mono_metadata_load_generic_params): Move duplicate code ...
13231         (mono_metadata_get_generic_param_row): ... here. Returns the
13232         first row-id in GenericParam table for a given owner (token).
13233         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
13234         prototype.
13235
13236 2005-11-23  Raja R Harinath  <rharinath@novell.com>
13237             Ankit Jain  <jankit@novell.com>
13238
13239         * metadata.c (mono_metadata_class_equal): Pass signature_only when
13240         comparing VARs too.
13241         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
13242         type->data.generic_param only if the type is an MVAR.
13243         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
13244         leak owner-less VARs and MVARs into managed space.
13245
13246 2005-11-21  Martin Baulig  <martin@ximian.com>
13247
13248         * class-internals.h
13249         (MonoMethod): Moved the `generic_container' here from
13250         `MonoMethodNormal' since we now also need it for
13251         `MonoMethodPInvoke';
13252         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
13253         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
13254         an union containing both `MonoMethodNormal' and
13255         `MonoMethodPInvoke'.
13256
13257         * loader.c
13258         (mono_get_method_from_token): Allow implementing generic methods
13259         as interncalls.
13260
13261         * threads.c
13262         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
13263         icall.
13264
13265 2005-11-17  Dick Porter  <dick@ximian.com>
13266
13267         * icall.c: 
13268         * process.h: 
13269         * process.c: Split the Process Start_internal icall into
13270         ShellExecuteEx_internal and CreateProcess_internal, which are
13271         called depending on whether UseShellExecute is true.  Fixes bug
13272         76670.
13273
13274         * appdomain.c (MONO_CORLIB_VERSION): Incremented
13275
13276 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
13277
13278         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
13279         'msize' parameters, use the information in 'mspec' instead.
13280         (emit_object_to_ptr_conv): Ditto.
13281
13282         * marshal.c (emit_struct_conv): Handle explicit layout structs with
13283         fields out of order. Fixes #76733.
13284
13285 2005-11-17  Ankit Jain  <jankit@novell.com>
13286
13287         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
13288
13289 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
13290
13291         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
13292           bug #76575.
13293
13294 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
13295
13296         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
13297         for types with non-auto layout. Fixes #76717.
13298
13299 2005-11-16  Ankit Jain  <jankit@novell.com>
13300
13301         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
13302         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
13303         if generic_context is null.
13304           (mono_metadata_generic_param_equal): param->owner can be null.
13305           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
13306         null.
13307
13308 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
13309
13310         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
13311         the correct value.
13312
13313 2005-11-15  Martin Baulig  <martin@ximian.com>
13314
13315         * object.c (set_value): Use mono_class_from_mono_type() instead of
13316         the hack for generic instances; fixes #76136.
13317
13318 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
13319
13320         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
13321         fields.
13322
13323         * image.c (load_metadata_ptrs): Initialize the new fields.
13324
13325         * reflection.c (create_dynamic_mono_image): Ditto.
13326
13327         * reflection.c (build_compressed_metadata): Use the new fields.
13328
13329         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
13330         icall.
13331
13332         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
13333         icall.
13334         
13335 2005-11-15  Ankit Jain  <jankit@novell.com>
13336             Raja R Harinath  <harinath@gmail.com>
13337
13338         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
13339         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
13340         new per-generic_container cache if the cached MonoType's context matches
13341         the current context.
13342           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
13343         to the expected context.
13344           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
13345
13346 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13347
13348         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
13349         we changed the signature of an icall.
13350         * icall.c: Modify to mono_double_ParseImpl return true/false 
13351         depending on the success, instead of throwing the exception. This will
13352         help us in Double.TryParse methods.
13353         
13354 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
13355
13356         * marshal.c (emit_marshal_object): Throw an exception when
13357         marshalling 'object' instead of crashing. Fixes #76696.
13358
13359 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
13360
13361         * class-internals.h: Add prototype for mono_type_get_full_name ().
13362
13363 2005-11-11  Dick Porter  <dick@ximian.com>
13364
13365         * threads.c (mono_thread_manage): Make sure the main thread has
13366         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
13367
13368 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
13369
13370         * loader.c (mono_loader_set_error_type_load): Log a warning to the
13371         console about the missing type.
13372         (mono_loader_set_error_method_load): Ditto.
13373
13374 2005-11-09  Miguel de Icaza  <miguel@novell.com>
13375
13376         * mono-config.c (mono_get_config_dir): Set the system defaults if
13377         none is specified.
13378
13379         * assembly.c (mono_set_dirs): New API entry point to set the
13380         assembly and the config directory in one call
13381
13382 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
13383
13384         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
13385         the ftnptr was created from a delegate in a domain other than the
13386         current domain. Fixes #75377.
13387
13388         * exception.h exception.c: Add mono_get_exception_not_supported ().
13389
13390 2005-11-08  Martin Baulig  <martin@ximian.com>
13391
13392         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
13393
13394 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
13395
13396         * security-manager.h: Added definitions to deal with strongname key 
13397         pairs bigger (and smaller) than 1024 bits.
13398         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
13399         adjust wrt the public key length being used.
13400
13401 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
13402
13403         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
13404           Windows build (r51396-51397).
13405
13406 2005-11-03  Martin Baulig  <martin@ximian.com>
13407
13408         * class.c (mono_class_setup_vtable_general): Also add generic
13409         methods to the vtable; fixes #76581.
13410
13411 2005-11-01  Miguel de Icaza  <miguel@novell.com>
13412
13413         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
13414         sure that we lookup GetString method from the System.Text.Encoding
13415         class, not the derived class or we get an empty method.
13416
13417         Fixed class #76612.
13418
13419 2005-10-25  Miguel de Icaza  <miguel@novell.com>
13420
13421         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
13422         if it has been previously set (embedders). 
13423
13424         Make mono_set_rootdir available also on Unix.
13425
13426 005-10-24  Robert Jordan  <robertj@gmx.net>
13427
13428         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
13429
13430 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
13431
13432         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
13433         only calls which are made to native code use this flag.
13434
13435         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
13436
13437 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
13438
13439         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
13440         Add support for FieldBuilders.
13441
13442 2005-10-29  Martin Baulig  <martin@ximian.com>
13443
13444         * mono-debug.c
13445         (mono_debug_using_mono_debugger): New public method; returns
13446         whether we're running inside the debugger.
13447
13448 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
13449
13450         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
13451         for Method/Constructor/FieldBuilders.
13452
13453 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
13454
13455         * reflection.c (module_add_cattrs): Save custom attributes for global methods
13456         and fields as well.
13457
13458 2005-10-26  Martin Baulig  <martin@ximian.com>
13459
13460         * mono-debug-debugger.c
13461         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
13462
13463 2005-10-24  Raja R Harinath  <harinath@gmail.com>
13464
13465         * icall.c (base64_to_byte_array): Don't pass an out-of-range
13466         integer to isspace.
13467
13468 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
13469
13470         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
13471         when passing valuetypes byref. Fixes #76502.
13472
13473 2005-10-19  Jackson Harper  <jackson@ximian.com>
13474
13475         * profiler.c: Don't put a . in front of types that are not in a
13476         namespace.
13477
13478 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
13479
13480         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
13481
13482 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
13483
13484         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
13485         #76436.
13486         (mono_marshal_get_ldflda_wrapper): Fix a warning.
13487
13488 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13489
13490         * assembly.c metadata-internals.h icall.c: Define an additional
13491         parameter for mono_assembly_name_parse_full, so we can avoid creating
13492         S.R.AssemblyName.Version when no version info wasn't passed.
13493         
13494 2005-10-09  Miguel de Icaza  <miguel@novell.com>
13495
13496         * class.c (mono_type_get_full_name): Reimplement method that was
13497         removed. 
13498
13499         * image.c: Some docs
13500
13501 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
13502
13503         * profiler.c (output_newobj_profile): Fix printing of Total memory
13504         on x86.
13505
13506 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
13507
13508         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
13509
13510 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
13511
13512         * threads.c: remove debug output.
13513
13514 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
13515
13516         * threads.c (mono_thread_manage): Fix crashes if more than 64
13517         threads need to be aborted. Hopefully fixes #75899.
13518
13519         * assembly.c (mono_stringify_assembly_name): New helper function.
13520
13521         * class.c: Use mono_stringify_assembly_name instead of the similar
13522         static function.
13523
13524         * assembly.h assembly.c: Add support for calling a postload search 
13525         hook if an assembly cannot be loaded.
13526
13527         * appdomain.c: Register new search hooks which call the AssemblyResolve
13528         events in AppDomain. Fixes #75231
13529
13530 2005-10-07  Martin Baulig  <martin@ximian.com>
13531
13532         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
13533         methods without debug info.
13534
13535 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
13536
13537         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
13538         wrappers.
13539
13540 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13541
13542         * file-io.c: now that we return symlinks, use lstat and, when the file
13543         is a symbolic link, stat, to get the file attributes. Also avoid the
13544         conversion to/from utf16/external.
13545
13546 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
13547
13548         * class.c (mono_class_layout_fields): Compute klass->has_references
13549         correctly if an embedded valuetype is not yet initialized. Fixes
13550         #76331.
13551
13552 2005-10-04  Martin Baulig  <martin@ximian.com>
13553
13554         * metadata.c
13555         (mono_metadata_load_generic_param_constraints): New public
13556         function; splitted the constraints loading out from
13557         mono_metadata_load_generic_params().
13558
13559         * class.c (mono_class_create_from_typedef): Call
13560         mono_metadata_load_generic_param_constraints() after setting up
13561         the type and creating our parent; fixes #75329.
13562
13563 2005-10-04  Martin Baulig  <martin@ximian.com>
13564
13565         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
13566         non-dynamic parent classes.
13567
13568 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
13569
13570         * file-io.c : win32 build fix (ETXTBSY seems not found).
13571
13572 2005-10-04  Martin Baulig  <martin@ximian.com>
13573
13574         * reflection.c
13575         (mono_image_get_methodspec_token): Make the cache actually work;
13576         fixes #75974.
13577
13578 2005-10-04  Martin Baulig  <martin@ximian.com>
13579
13580         * class.c (mono_class_name_from_token): Removed the unneccessary
13581         `MonoGenericContext *' argument.
13582
13583 2005-10-04  Martin Baulig  <martin@ximian.com>
13584
13585         * loader.c
13586         (method_from_methodspec): Make the caching work again; fixes the
13587         performance regression from #76262.
13588
13589 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13590
13591         * file-io.c:
13592         * file-io.h:
13593         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
13594         GetFileSystemEntries that performs the same work but without going
13595         into io-layer, locking, etc.
13596
13597 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
13598
13599         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
13600         ThreadState_Stopped as well. Fixes #76047.
13601
13602 2005-09-29  Martin Baulig  <martin@ximian.com>
13603
13604         * class.c
13605         (inflate_generic_context): If the new context has a `gmethod', set
13606         its `container' that that gmethod's `container'.
13607
13608         * metadata.c
13609         (mono_metadata_parse_generic_param): Simplify things;
13610         `generic_container = generic_context->container;' is just fine.
13611
13612         * loader.c (method_from_methodspec): Code cleanups.
13613
13614 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
13615
13616         * decimal.c: fix warning (and let gcc generate correct
13617         code on ARM with optimizations).
13618
13619 2005-09-28  Martin Baulig  <martin@ximian.com>
13620
13621         * loader.c
13622         (method_from_memberref): Added `MonoGenericContext *class_context'
13623         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
13624         (method_from_methodspec): If we're a memberref, use the enclosing
13625         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
13626
13627 2005-09-28  Martin Baulig  <martin@ximian.com>
13628
13629         * object.c (mono_runtime_invoke_array): Added support for
13630         MONO_TYPE_GENERICINST; fixes #75917.
13631
13632 2005-09-27  Martin Baulig  <martin@ximian.com>
13633
13634         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
13635         `k->byval_arg.type' to determine the actual type.
13636
13637         * loader.c (method_from_methodspec): Removed some hacks.
13638
13639 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
13640
13641         * class-internals.h (mono_field_is_deleted): Do the test for
13642         rtspecialname before we check the actual name of the field. This
13643         prevents us from dereferencing a pointer into the string table,
13644         saving us from accessing a few pages
13645
13646         * *.c: Replace the use of {Enter,Leave}CriticalSection with
13647         macros. This will allow a deadlock debugger to easily be plugged
13648         in.
13649
13650 2005-09-27  Martin Baulig  <martin@ximian.com>
13651
13652         * loader.c (method_from_methodspec): Create a "signature"
13653         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
13654
13655 2005-09-27  Martin Baulig  <martin@ximian.com>
13656
13657         * class.c
13658         (inflate_generic_class): Correctly set the new context's
13659         container.
13660
13661         * loader.c
13662         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
13663         instead of a `MonoGenericContext *'.
13664         (mono_method_signature_full): Take a `MonoGenericContainer *'
13665         instead of a `MonoGenericContext *'.
13666
13667         * metadata.c
13668         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
13669         instead of a `MonoGenericContext *'.
13670         (mono_metadata_parse_method_signature_full): Likewise.
13671
13672 2005-09-26  Martin Baulig  <martin@ximian.com>
13673
13674         * class.c
13675         (mono_class_from_generic_parameter): Set `klass->generic_container'
13676         (mono_class_from_generic_parameter): Likewise.
13677         (mono_bounded_array_class_get): We inherit the generic container
13678         from the element class.
13679
13680         * loader.c
13681         (find_method, find_method_in_class): Take a `MonoGenericContext *'
13682         argument rather than computing it here.
13683         (method_from_memberref): Correctly set the generic context before
13684         parsing the signature.  Fixes #75681.
13685
13686 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
13687
13688         * object.c (mono_class_has_special_static_fields): Fix warnings.
13689
13690 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13691
13692         * assembly.c: Add parse_public_key function, to
13693         par the public keys. Also added mono_assembly_name_parse_full,
13694         to define it the parsed key should be freed or not.
13695         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
13696         to parse a long format assembly name.
13697         * metadata-internals.h: Keep mono_assembly_name_parse_full as
13698         private, since calling it to preserve the key requires
13699         freeing it manually.
13700         
13701 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
13702
13703         * locales.c : removed HAVE_ICU part.
13704
13705 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
13706
13707         * object.c (mono_class_create_runtime_vtable): Avoid calling 
13708         field_is_special_static if the klass has no special static fields.
13709
13710         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
13711         (MonoCachedClassInfo): Likewise.
13712
13713         * object.c (mono_class_has_special_static_fields): New helper function.
13714
13715 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
13716
13717         * class.c (mono_class_create_from_typedef): Don't call 
13718         interfaces_from_typedef_full for enums.
13719         (mono_class_create_from_typedef): Compute the base types of enums directly
13720         without calling mono_class_setup_fields ().
13721         (mono_class_find_enum_basetype): New helper function.
13722
13723         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
13724         one place inside the string heap.
13725         
13726 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
13727
13728         * class.c: locking fixes, code cleanups, some docs added.
13729         Allocate some data structures in the image mempool.
13730
13731 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
13732
13733         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
13734         the example code.
13735         
13736 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
13737
13738         * class-internals.h, class.c, reflection.c: reduce memory taken by
13739         MonoClass.
13740
13741 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
13742
13743         * metadata.c, metadata.h, loader.h: documentation updates, code and
13744         API cleanups.
13745
13746 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
13747
13748         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
13749         the example code.
13750
13751         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
13752         page faults caused by the runtime while reading metadata.
13753
13754 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13755
13756         * socket-io.c: the field names were changed 3 months ago and no one
13757         realized until bug #76077 got filed!
13758
13759 2005-09-20  Martin Baulig  <martin@ximian.com>
13760
13761         * icall.c (assembly_icalls): Removed some unused debugger icalls.
13762
13763 2005-09-20  Martin Baulig  <martin@ximian.com>
13764
13765         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
13766         write the rank into the class entry.
13767
13768 2005-09-20  Martin Baulig  <martin@ximian.com>
13769
13770         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
13771
13772 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
13773
13774         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13775
13776         * icall.c (custom_attrs_defined_internal): New icall.
13777
13778         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
13779         function.
13780         (mono_custom_attrs_construct_by_type): New helper function.
13781
13782 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
13783
13784         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
13785         terminate the resulting string. Fixes #76123.
13786
13787 2005-09-16  Martin Baulig  <martin@ximian.com>
13788
13789         * mono-debug.c
13790         (mono_debug_add_method): Ignore inflated methods for the moment.
13791
13792 2005-09-14  Martin Baulig  <martin@ximian.com>
13793
13794         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
13795
13796 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
13797
13798         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
13799         return a success/failure indication.
13800         (mono_metadata_interfaces_from_typedef_full): Ditto.
13801         (get_constraints): Ditto.
13802
13803 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
13804
13805         * marshal.c (emit_marshal_array): Fix handling of null arrays.
13806         
13807         * marshal.c (emit_marshal_array): Add support for returning string
13808         arrays from delegates. Fixes #76063.
13809
13810         * marshal.c: Use the emit_ldloc/stloc macros where possible.
13811
13812 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
13813
13814         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
13815         icall.
13816
13817 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
13818
13819         * reflection.c icall.c: Fix after mono_get_exception_type_load
13820         signature change.
13821
13822         * assembly.c (mono_assembly_get_assemblyref): New helper function.
13823         (mono_assembly_load_reference): Use the new helper.
13824
13825         * class-internals.h (MonoLoaderError): New structure containing 
13826         information about type loading errors.
13827
13828         * class-internals.h loader.c: Add APIs to store per-thread loader
13829         error information.
13830
13831         * loader.c class.c: Set the loader error if needed.
13832
13833         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
13834
13835 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
13836
13837         * decimal.c: fixed to handle the broken ARM fp format.
13838
13839 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
13840
13841         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
13842         broken.
13843
13844 2005-09-06  Martin Baulig  <martin@ximian.com>
13845
13846         * domain.c (supported_runtimes): Added v2.0.50727.
13847
13848 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
13849
13850         * culture-info.h: reduce the size of some structures.
13851
13852 2005-09-05  Martin Baulig  <martin@ximian.com>
13853
13854         Reflect latest API changes in the August CTP.
13855
13856         * icall.c
13857         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
13858         ("MonoType.HasGenericArguments"): Removed.
13859         ("MonoMethod.BindGenericParameters"): Renamed to
13860         "MakeGenericMethod".
13861         ("MethodBuilder.BindGenericParameters"): Renamed to
13862         "MakeGenericMethod".    
13863
13864 2005-09-05  Martin Baulig  <martin@ximian.com>
13865
13866         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
13867
13868 2005-09-05  Martin Baulig  <martin@ximian.com>
13869
13870         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13871
13872         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
13873         generic_container is non-NULL.
13874
13875 2005-09-05  Martin Baulig  <martin@ximian.com>
13876
13877         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13878
13879         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
13880
13881 2005-08-29  Michal Moskal  <malekith@nemerle.org>
13882
13883         * reflection.c (encode_locals,
13884         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
13885         for large generic types.
13886
13887 2005-09-05  Martin Baulig  <martin@ximian.com>
13888
13889         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13890
13891         * class.c (mono_dup_array_type): New public method.
13892         (mono_metadata_signature_deep_dup): New public method.
13893         (dup_type): Correctly duplicate array and function types.
13894
13895 2005-09-05  Martin Baulig  <martin@ximian.com>
13896
13897         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13898
13899         * reflection.c (get_default_param_value_blobs): Handle generic types
13900         and generic methods.
13901
13902 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
13903
13904         * class.c: Fixed error reporting (method/class were inversed) for 
13905         inheritance demands.
13906         * security-manager.c|h: Added the AppDomain when calling the managed
13907         System.Security.SecurityManager.InheritanceDemand method.
13908
13909 2005-09-01  Raja R Harinath  <rharinath@novell.com>
13910
13911         * reflection.c (encode_marshal_blob): 'marshaltype' and
13912         'marshaltyperef' are alternate sources for the custom marshaler
13913         name.
13914
13915 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
13916
13917         * class.c: fix creation of array classes with rank == 1
13918         (patch by Ankit Jain <jankit@novell.com>).
13919
13920 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
13921
13922         * object.c: fix check for creating the bound data for arrays vs
13923         szarrays.
13924
13925 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13926
13927         * object.c: configuration file name is now based on the executable name,
13928         not the image name. Fixes bug #75931.
13929
13930 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
13931
13932         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
13933         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
13934
13935 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
13936
13937         * rand.c: Use wincrypt.h instead of WinCrypt.h.
13938
13939 2005-08-24  Ankit Jain  <jankit@novell.com>
13940             Raja R Harinath  <rharinath@novell.com>
13941
13942         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
13943           called by it recursively.
13944           (mono_class_init): Remove special case in pending_init handling, since it's
13945           superseded by the fix to mono_class_from_typeref.
13946
13947 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
13948
13949         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
13950         BROKEN_THREAD_START stuff.
13951
13952 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
13953
13954         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
13955         trampoline.
13956
13957         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
13958         
13959         * object.c (mono_delegate_ctor): Replace the original function address with
13960         a delegate trampoline.
13961
13962 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
13963
13964         * icall.c: add boolean argument to base64_to_byte_array and 
13965         InternalFromBase64String to control whether a whitespace-only string
13966         is allowed (or should casue a FormatException to be thrown). We need
13967         this as the behavior has changed between MS.NET 1.x and 2.0, and we
13968         to match the MS behaviour in both profiles.
13969         * appdomain.c: Bump corlib version.
13970
13971 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13972
13973         This patch implements a big portion of publisher policy
13974         support, used to bind assembly versions and redirect
13975         one assembly from version A to version B.
13976
13977         * assembly.c:
13978         New GSList loaded_assembly_bindings, for storing the cached
13979         assembly bindings.
13980         (assembly_binding_maps_name): New static function for checking if a 
13981         assembly binding information maps an assembly name.
13982         (mono_assembly_binding_info_free): New function for freeing
13983         assembly binding information resources.
13984         (get_publisher_policy_info): New static function for retrieving 
13985         assembly binding information from a MonoImage.
13986         (compare_versions): New static function for comparing an assembly
13987         binding information data and the version of an assembly name.
13988         (check_policy_versions): New static function for checking if an
13989         assembly binding info mapping an assembly name is valid for it.
13990         (mono_assembly_load_publisher_policy): New static function for
13991         loading the 'policy.major.minor.MyAssembly' image for an assembly
13992         with an assembly name 'aname'.
13993         (mono_assembly_bind_version): New static function for updating
13994         assembly redirection.
13995         (mono_assembly_apply_binding): New static function for applying
13996         assembly binding.
13997         (search_binding_loaded): New static function for searching 
13998         loaded assembly binding infos in the cache domain.
13999         (mono_assembly_load_full): Don't apply assembly binding for
14000         reflection only assemblies.
14001
14002         * metadata-internals.h: Add MonoAssemblyBindingInfo,
14003         which contains information about assembly binding. Also
14004         declare signature for mono_config_parse_publisher_policy ()
14005         function, used to retrieve pub policy info.
14006         
14007         * mono-config.c:
14008         (publisher_policy_start): New static function used to parse publisher 
14009         policy config files.
14010         (publisher_policy_parser): New static MonoParseHandler containing 
14011         the functions used when parsing config files.
14012         (mono_config_parse_publisher_policy): New function for parsing
14013         publisher policy files.
14014         
14015 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
14016
14017         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
14018
14019         * marshal.c (mono_delegate_free_ftnptr): Ditto.
14020
14021         * object.c (mono_get_addr_from_ftnptr): New helper function.
14022
14023         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
14024
14025         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
14026
14027 2005-08-19  Dick Porter  <dick@ximian.com>
14028
14029         * threads.c, threads.h, appdomain.c, appdomain.h,
14030         profiler-private.h, monitor.c, object.c, object-internals.h,
14031         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
14032         store the thread ID, so it can hold a 64 bit value if needed.
14033
14034 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
14035
14036         * reflection.c (mono_reflection_create_dynamic_method): Store the
14037         handle class into the method references as well so ldtoken works in
14038         dynamic methods.
14039
14040         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
14041         types.
14042
14043 2005-08-19  Ankit Jain <jankit@novell.com>
14044
14045         Fix #75847.
14046         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
14047           here rather than using the method signature of a arbitrary function
14048           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
14049           two arguments.
14050           Hack done with Harinath.
14051
14052 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14053
14054         * threadpool.c: disable printing stack traces when we get a exception
14055         in a threadpool thread. I need to do more testing to figure out which
14056         cases actually print this. Fixes bug #75828.
14057
14058 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14059
14060         * icall.c: there might be ignored whitespace after the last '='. This
14061         fixes length computation and bug #75840.
14062
14063 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
14064
14065         * assembly.c (mono_assembly_load_full): Consider .exe extension as
14066         well. Fixes #75809.
14067
14068         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
14069         #75784.
14070         
14071         * reflection.c (create_custom_attr_data): Ditto.
14072
14073 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
14074
14075         * locales.c, culture-info.h : removed RegionLCIDMap.
14076         * culture-info-tables.h : regenerated.
14077
14078 2005-08-16  Martin Baulig  <martin@ximian.com>
14079
14080         * class.c (mono_type_get_name_recurse): Small fix.
14081
14082 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
14083
14084         * locales.c : indentation fixie.
14085
14086 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
14087
14088         * object-internals.h,
14089           locales.h,
14090           locales.c,
14091           culture-info.h,
14092           icall.c : added RegionInfo table support.
14093         * culture-info-table.h : regenerated for region support.
14094
14095 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
14096
14097         * reflection.c (resolve_object): handle all kinds of MonoMethod
14098         including generic ones
14099
14100 2005-08-12  Ankit Jain <jankit@novell.com>
14101
14102         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
14103           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
14104
14105 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
14106
14107         * process.c: Don't close a thread handle when it's NULL. This is a
14108         workaround for bug #75733.
14109
14110 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
14111
14112         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
14113
14114 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
14115
14116         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
14117
14118 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14119
14120         * threadpool.c: if a work item in the thread pool has a callback that
14121         catches a exception, don't propagate it after invoking the callback.
14122         Fixes bug #75336.
14123
14124 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
14125
14126         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
14127
14128         * class-internals.h (MonoCachedClassInfo): Add some new fields.
14129
14130         * class.c (mono_class_init): Load field info lazily in the AOT case.    
14131
14132         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
14133
14134 2005-08-03  Ankit Jain  <jankit@novell.com>
14135
14136         Fix #75683.
14137         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
14138           PInvoke calling convention is 0.
14139
14140 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
14141
14142         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
14143         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
14144
14145 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
14146
14147         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
14148         to handle threads not started by the GC (patch by Michael Meeks
14149         <michael.meeks@novell.com>).
14150
14151 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
14152
14153         * reflection.c: Make buffer used in emitting types larger for some
14154         big generic types (patch by Michal Moskal).
14155
14156 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
14157
14158         * mono-debug.c: Fix some (not all) alignment problems.
14159
14160 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14161
14162         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
14163         Invoke mono_image_load_from_data_full passing the refonly
14164         parameter.
14165
14166         * assembly.c
14167         (mono_assembly_open_from_bundle): Add the refonly argument, 
14168         in order to pass it to other methods it calls to.
14169         (do_mono_assembly_open): Add the refonly argument, in order 
14170         to pass it to other methods it calls to.
14171         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
14172         the refonly parameter to it.
14173
14174         * image.c: Add loaded_images_refonly_hash and
14175         loaded_images_refonly_guid_hash to cache the reflection
14176         only loaded images.
14177         (mono_images_init): Initialize the hash tables used for
14178         caching the reflection only images.
14179         (load_modules): Invoke mono_image_open_full passing the refonly
14180         parameter to load the modules the correct way.
14181         (build_guid_table): Add the refonly argument, to re-build the 
14182         correct hash table.
14183         (do_mono_image_open): Added the refonly argument, in order to
14184         define it for the loaded image.
14185         (mono_image_loaded_full): New function, which receives an
14186         additional parameter to look for the image in the refonly or
14187         non-refonly section.
14188         (mono_image_loaded): Updated, using mono_image_loaded_full.
14189         (mono_image_loaded_by_guid_full): The same case that happens
14190         with mono_image_loaded_full.
14191         (mono_image_loaded_by_guid): Likewise.
14192         (register_image): Use the ref_only variable inside MonoImage
14193         to decide in which hash table store the current image.
14194         (mono_image_open_from_data_full): Rename
14195         mono_image_open_from_data to mono_image_open_from_data_full,
14196         adding the refonly argument, to define the ref_only variable 
14197         inside MonoImage.
14198         (mono_image_open_from_data): Return 
14199         mono_image_open_from_data_full.
14200         (mono_image_open_full): Rename mono_image_open to
14201         mono_image_open_full, receiving the new refonly argument,
14202         to pass it to inner methods.
14203         (mono_pe_file_open): Update this function, to open
14204         a MonoImage as a non-refonly image.
14205         (mono_image_close): Use the refonly variable inside
14206         MonoImage to remove the image from the correct caches.
14207
14208         * image.h: Add the signatures of mono_image_open_full,
14209         mono_image_open_from_data_full, mono_image_loaded_full,
14210         mono_image_loaded_by_guid_full.
14211
14212         * metadata-internals.h: Add the ref_only field to 
14213         MonoImage.
14214         
14215 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14216
14217         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
14218         Fix the last behavior, which used to load the assemblies and
14219         extract MonoReflectionAssemblyName information, instead of
14220         extract it from the metadata tables. Needed for Reflection
14221         Only assemblies.
14222         
14223 2005-07-29  Martin Baulig  <martin@ximian.com>
14224
14225         * mono-debug-debugger.c
14226         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
14227         not initialized.
14228
14229         * mono-debug.c
14230         (mono_debug_address_from_il_offset): Check whether we have
14231         debugging support before attempting to take the lock.
14232         (mono_debug_source_location_from_address): Likewise.
14233         (mono_debug_source_location_from_il_offset): Likewise.
14234         (mono_debug_il_offset_from_address): Likewise.
14235         (mono_debug_address_from_il_offset): Likewise.
14236
14237 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
14238
14239         * class.c (mono_class_from_name_case): Add support for dynamic images.
14240         Fixes #75650.
14241
14242         * object.c (mono_class_compute_gc_descriptor): Add a workaround
14243         for #75479.
14244
14245 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
14246         
14247         * reflection.c (mono_method_get_object): Fix warning.
14248
14249 2005-07-28  Martin Baulig  <martin@ximian.com>
14250
14251         * mono-debug.c
14252         (mono_debug_add_wrapper): Also write the wrapper type.
14253
14254 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
14255
14256         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
14257         
14258         * class.c (mono_class_init): Avoid reading nested classes if the AOT
14259         data indicates the class has none.
14260
14261 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
14262
14263         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
14264         loader lock with the debugger lock. Prevents deadlocks for beagle.
14265
14266         Beagle can now run on an smp box for a weekend without any
14267         issues. Woohoo!
14268
14269 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
14270
14271         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
14272         in a module. Fixes #75629.
14273
14274 2005-07-26  Martin Baulig  <martin@ximian.com>
14275
14276         * mono-debug.c (mono_debug_add_wrapper): New static method.
14277         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
14278         interncall or a wrapper.
14279
14280         * mono-debug.h (MonoDebugWrapperData): New public typedef.
14281         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
14282         (MONO_DEBUGGER_VERSION): Bump to 51.
14283
14284         * mono-debug-debugger.c
14285         (mono_debugger_add_type): Removed this empty function.
14286         (mono_debugger_add_method): Likewise.
14287
14288 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
14289
14290         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
14291         before accessing method->slot.
14292
14293 2005-07-21  Jb Evain  <jbevain@gmail.com>
14294
14295         * reflection.c (method_encode_clauses/class): Handle filters clauses.
14296         Fixes #75010.
14297
14298 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
14299
14300         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
14301         #75587.
14302
14303 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
14304
14305         * image.h image.c: Add mono_image_get_guid () API function.
14306
14307 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
14308
14309         There were issues when multiple threads tried to load
14310         assemblies. A deadlock was created between assemblies_mutex and
14311         mono_domain_assemblies_lock. This fixes the issue by making the
14312         assembly ref counting be lock free. See bug 75586.
14313         
14314         * image.c (mono_image_close): The add ref function here was using
14315         Interlocked operations while the unref was using a mutex and a
14316         --. I don't think this was ever a bug that would be exposed in a
14317         non-pendantic way (ie, by an embedder doing a ref on one thread
14318         and an unref on another), but for the sake of correctness, this is
14319         now Interlocked.
14320
14321         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
14322         (mono_assembly_load_reference): Call mono_assembly_addref rather
14323         than touching the refcount ourselves.
14324         (mono_assembly_close): Use InterlockedDecrement to unref the
14325         assembly. Don't acquire the lock unless it is actually needed.
14326
14327 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
14328
14329         * class.c (mono_class_layout_fields): Fix calculation of has_references
14330         for generic types.
14331
14332 2005-07-12  Martin Baulig  <martin@ximian.com>
14333
14334         Applying a patch from Michal Moskal <malekith@nemerle.org>.
14335
14336         * metadata.c
14337         (mono_type_hash): Provide better hashing for generic instances.
14338         (mono_generic_inst_hash): Improve hashing.
14339         (mono_generic_class_hash): Likewise.
14340
14341         * reflection.c (mymono_metadata_type_hash): Improve hashing for
14342         generic instances.
14343
14344 2005-07-12  Martin Baulig  <martin@ximian.com>
14345
14346         * reflection.c (mono_reflection_create_runtime_class): Remove the
14347         hack for generic type definitions and non-`Run' assemblies.
14348         (mono_reflection_bind_generic_parameters): Also use
14349         `klass->wastypebuilder' to check for TypeBuilders.
14350
14351 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
14352
14353         * class.c (mono_class_layout_fields): Fix calculation of has_references
14354         for generic types.
14355
14356         * class.c (inflate_generic_class): Fix a leak.
14357         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
14358         for generic types.
14359
14360 2005-07-11  Martin Baulig  <martin@ximian.com>
14361
14362         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
14363         on error.
14364
14365 2005-07-11  Martin Baulig  <martin@ximian.com>
14366
14367         * loader.c (find_method): Also lookup in
14368         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
14369
14370 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
14371
14372         * appdomain.c (mono_domain_unload): Don't free the error message
14373         before passing it to mono_get_exception_...
14374
14375         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
14376         
14377 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
14378
14379         * threads.c: try to better guess an available RT signal (bug #75387).
14380
14381 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
14382
14383         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
14384         and CACHE_OBJECT.
14385
14386 2005-07-07  Martin Baulig  <martin@ximian.com>
14387
14388         * class.c (mono_type_get_name_full): Return NULL for
14389         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
14390         fixes #75408.
14391
14392 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
14393
14394         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
14395         exit the appdomain as well being aborted.
14396
14397         * threadpool.c: Create all threadpool threads inside the root appdomain, and
14398         change back to the root domain after calling managed code. This enables
14399         appdomains using threadpools to be unloaded.
14400
14401 2005-07-07  Martin Baulig  <martin@ximian.com>
14402
14403         * class-internals.h
14404         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
14405         into `MonoDynamicGenericClass' since we only need it for dynamic
14406         types.
14407
14408         * reflection.c (mono_class_bind_generic_parameters): We don't need
14409         to compute the `parent' here.
14410
14411 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
14412
14413         * culture-info-table.h : regenerated.
14414
14415 2005-07-06  Martin Baulig  <martin@ximian.com>
14416
14417         * icall.c
14418         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
14419
14420         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
14421
14422 2005-07-06  Martin Baulig  <martin@ximian.com>
14423
14424         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
14425         we're doing a signature-only comparision; fixes #74945.
14426
14427 2005-07-06  Martin Baulig  <martin@ximian.com>
14428
14429         * class-internals.h (MonoGenericClass): Moved some things out into
14430         a new `MonoInflatedGenericClass' type.  
14431         (MonoInflatedGenericClass): New type; the `klass' of a
14432         `MonoGenericClass' is now computed lazyly in
14433         mono_get_inflated_generic_class().      
14434
14435         * class.c (mono_get_inflated_generic_class): New public function.
14436         (mono_class_inflate_generic_method): Removed the unused
14437         `MonoClass *' argument.
14438         (setup_generic_vtable): Don't call mono_get_inflated_method() on
14439         all the methods.
14440         (mono_class_create_generic): Make this static and merge it with
14441         mono_class_create_generic_2(); we're now called automatically from
14442         mono_get_inflated_generic_class().
14443
14444         * loader.c (mono_method_signature): Call
14445         mono_get_inflated_method() here.
14446
14447 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
14448
14449         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
14450         type of fields with RVA.
14451
14452         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
14453         for this pseudo class.
14454         (my_mono_class_from_generic_parameter): Likewise.
14455         (mono_class_init): Allow interfaces to have cctors.
14456
14457 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
14458
14459         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
14460         lazily for AOT methods.
14461
14462 2005-07-05  Martin Baulig  <martin@ximian.com>
14463
14464         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
14465         returns FALSE for a successful match, not TRUE.
14466
14467 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
14468
14469         * loader.c (mono_method_get_index): Optimize this a bit.
14470
14471 2005-07-04  Martin Baulig  <martin@ximian.com>
14472
14473         * class.c
14474         (class_compute_field_layout): Move the check for generic type
14475         definitions into mono_class_layout_fields().  Fixes #74684.
14476         (mono_class_from_generic_parameter): Correctly compute
14477         `klass->parent'; fixes #75457.
14478
14479         * reflection.c (register_assembly, register_module): Make sure
14480         `domain->rejobject_hash' is already created.
14481
14482 2005-07-02  Martin Baulig  <martin@ximian.com>
14483
14484         * class-internals.h
14485         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
14486         `MonoDynamicGenericClass'.      
14487
14488 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
14489
14490         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
14491         returned by a field getter is null, since null is a valid value.
14492
14493 2005-07-01  Martin Baulig  <martin@ximian.com>
14494
14495         * reflection.c (mono_reflection_generic_class_initialize): Update
14496         the `dgclass->fields [i].parent' to the correct class.
14497         (mono_image_get_fieldref_token): Use the declaring type, not the
14498         reflected type.
14499
14500 2005-07-01  Martin Baulig  <martin@ximian.com>
14501
14502         * loader.c (find_method): Also look in the interfaces; fixes #75429.
14503
14504 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
14505
14506         * threads.c (thread_cleanup): assert that thread != NULL
14507         (wait_for_tids_or_state_change): We were using the wrong variable
14508         when accessing wait->threads. `i' was always out of the bounds of
14509         the array.
14510
14511 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14512
14513         * loader.c: map user32 and kernel32 to libMonoSupportW
14514
14515 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
14516
14517         * appdomain.c (unload_thread_main): Mark this as WINAPI.
14518
14519 2005-06-28  Martin Baulig  <martin@ximian.com>
14520
14521         * loader.c (method_from_methodspec): Fix #75334.
14522
14523 2005-06-28  Martin Baulig  <martin@ximian.com>
14524
14525         Fix #74953 - Arrays now implement the generic IList<T> interface
14526         on the 2.0 platform.
14527
14528         * class-internals.h (MonoDefaults): Added `generic_array_class'.
14529
14530         * reflection.c (mono_class_bind_generic_parameters): New public
14531         function; similar to mono_reflection_bind_generic_parameters(),
14532         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
14533
14534         * domain.c (mono_init_internal): Try to initialize.
14535         `mono_defaults.generic_array_class' here; this'll only succeed if
14536         we're using the 2.0 corlib.
14537
14538         * icall.c
14539         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
14540         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
14541         (mono_lookup_internal_call): Added support for nested classes.
14542
14543         * loader.c
14544         (mono_get_method_from_token): Set `result->signature->pinvoke' if
14545         we're an interncall and have generic arguments.
14546
14547         * class.c
14548         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
14549         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
14550         instance of System.Array.InternalArray<T> for arrays, so they
14551         implement the generic IList<T> interface.
14552
14553 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
14554
14555         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
14556         (chastamar@yahoo.com). Fixes #75374.    
14557
14558 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
14559
14560         * culture-info-table.h: regenerated.
14561
14562 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14563
14564         * icall.c: handle spaces correctly for base64 strings.
14565
14566 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
14567
14568         * *.c: Kill some warnings.
14569
14570 2005-06-23  Duncan Mak  <duncan@novell.com>
14571
14572         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
14573         that this builds on Solaris 10 (x86).
14574
14575 2005-06-23  Martin Baulig  <martin@ximian.com>
14576
14577         * class.c
14578         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
14579         generic type definitions.
14580
14581 2005-06-23  Martin Baulig  <martin@ximian.com>
14582
14583         Fix #75331.
14584
14585         * metadata.c (mono_class_get_overrides): Renamed to
14586         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
14587         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
14588         pass it to mono_get_method_full().
14589
14590 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
14591
14592         * reflection.c (mono_reflection_create_runtime_class): take the
14593         mono_domain_lock in this method. Prevents deadlocks
14594
14595 2005-06-22  Martin Baulig  <martin@ximian.com>
14596
14597         * loader.c (method_from_methodspec): Fix #75330.
14598
14599 2005-06-22  Martin Baulig  <martin@ximian.com>
14600
14601         * reflection.c (type_get_qualified_name): Use
14602         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
14603         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
14604         argument; use it if we don't have an assembly name.
14605
14606 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
14607
14608         * object.c: In mono_message_init, set "copy out" flag for in
14609         parameters with the [Out] flag.
14610
14611 2005-06-21  Martin Baulig  <martin@ximian.com>
14612
14613         * class.c
14614         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
14615         and MONO_TYPE_PTR.
14616
14617 2005-06-21  Martin Baulig  <martin@ximian.com>
14618
14619         * class.c (mono_class_init): Don't initialize `class->fields' for
14620         generic instances since they're initialized again in
14621         compute_field_layout(). 
14622         (compute_field_layout): Set the field's `generic_info' here; fix
14623         #75320. 
14624
14625 2005-06-21  Martin Baulig  <martin@ximian.com>
14626
14627         * class-internals.h
14628         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
14629
14630         * metadata.c (mono_metadata_generic_method_equal): Also
14631         distinguish the `generic_class'; fixes #75334.
14632
14633 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14634
14635         * domain.c:
14636         * appdomain.c:
14637         * domain-internals.h:
14638         * reflection.c: 'domain_assemblies' field is now protected by its own
14639         lock. Don't call into managed code to run the AssemblyLoad event if we
14640         now there are no registered delegates for it.
14641
14642 2005-06-20  Martin Baulig  <martin@ximian.com>
14643
14644         * class.c (mono_class_is_assignable_from): Use a custom version of
14645         mono_class_has_parent() to make things work for generic instances;
14646         fix #75300.
14647
14648 2005-06-20  Martin Baulig  <martin@ximian.com>
14649
14650         * loader.c (method_from_methodspec): Apply a patch from
14651         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
14652
14653 2005-06-20  Martin Baulig  <martin@ximian.com>
14654
14655         * class.c (mono_class_init): Reverted Zoltan's last change; it
14656         breaks generics.
14657
14658 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
14659
14660         * threads.c (wait_for_tids_or_state_change): Add missing locking.
14661
14662 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14663
14664         * socket-io.c: fix the index in the socket array for writable/error
14665         sockets. Fixes bug #75306.
14666
14667 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
14668
14669         * class.c (mono_class_init): Allow interfaces to have static ctors.
14670
14671 2005-06-17  Martin Baulig  <martin@ximian.com>
14672
14673         * loader.c (method_from_methodspec): Use `context->container' when
14674         parsing the `gmethod->inst'.
14675
14676 2005-06-17  Martin Baulig  <martin@ximian.com>
14677
14678         * class.c (mono_type_get_name_recurse): Don't add the assembly
14679         name for type arguments.
14680
14681 2005-06-15  Martin Baulig  <martin@ximian.com>
14682
14683         * reflection.c (mono_image_get_inflated_method_token): Encode
14684         correct klass; fixes #75260.
14685
14686 2005-06-13 Michal Moskal <malekith@nemerle.org>
14687
14688         * icall.c: Make GetCorrespondingMethod/Constructor take
14689         MonoReflectionMethod method not MonoMethod. Removed
14690         MonoType.GetCorrespondingField, and make
14691         MonoGenericType.GetCorrespondingField take name not
14692         MonoClassField.
14693
14694 2005-06-13  Michal Moskal <malekith@nemerle.org>
14695
14696         * reflection.c (field_encode_signature, encode_locals):
14697          Make sizes of buffers for types larger (for big generic types).
14698          (create_generic_typespec,
14699          mono_reflection_sighelper_get_signature_local,
14700          mono_reflection_sighelper_get_signature_field):
14701          Add asserts for too small buffers.
14702
14703 2005-06-15  Martin Baulig  <martin@ximian.com>
14704
14705         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
14706         if our parent is not a dynamic type.
14707
14708 2005-06-15  Martin Baulig  <martin@ximian.com>
14709
14710         * class-internals.h (MonoTypeNameFormat): New enum.
14711
14712         * class.c
14713         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
14714         (mono_type_get_full_name): Removed.
14715         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
14716         argument instead of the boolean's.
14717
14718         * icall.c (ves_icall_System_MonoType_getFullName):
14719         Added `gboolean assembly_qualified'.    
14720
14721         * reflection.h
14722         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
14723
14724         * reflection.c (mono_reflection_parse_type): Parse the new type
14725         name format.
14726
14727 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14728
14729         * icall.c: no need to convert from utf16 to utf8 and then back again
14730         after the call to GetLogicalDrives.
14731
14732 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14733
14734         * icall.c: frombase64. Fix problems exposed by new tests.
14735
14736 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14737
14738         * icall.c: added internal calls for converting char [] and strings in
14739         base64 into byte [].
14740
14741 2005-06-10  Martin Baulig  <martin@ximian.com>
14742
14743         * class.c (mono_class_create_generic_2): Read the nested classes
14744         from the metadata rather than from `gklass->nested_classes' since
14745         `gklass' might not be initialized yet.
14746
14747 2005-06-09  Duncan Mak  <duncan@novell.com>
14748
14749         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
14750         all public headers. Fixes #74919.
14751
14752 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
14753
14754         * domain.c: The key for proxy_vtable_hash is now a pointer
14755         array. Added new GHashFunc and GCompareFunc functions for this.
14756
14757         * class.h: The list of interfaces in MonoRemoteClass is known in
14758         advance and can't grow (we create a new MonoRemoteClass if needed),
14759         so now the interface array can be allocated together with
14760         MonoRemoteClass.
14761         
14762         * object.c: Added a new method create_remote_class_key.
14763         Fixed mono_remote_class so it does not depend on
14764         mono_upgrade_remote_class.
14765         Removed extend_interface_array.
14766         Added new method clone_remote_class(), which makes a copy of a remote
14767         class and adds a new interface or class to it.
14768         mono_upgrade_remote_class() now creates a new remote class (or gets
14769         it from the cache) if an vtable upgrade is needed. In this way
14770         we make sure that other objects sharing the same remote class
14771         don't get the new vtable with unwanted interfaces.
14772         
14773         * object-internals.h:
14774         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
14775         
14776         * marshal.c: Track changes in mono_upgrade_remote_class().
14777
14778 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
14779         * icall.c: Add runtime methods for obtaining members of inflated
14780         class, which were created from supplied non-inflated members. It
14781         is used in internal Get{Method,Constructor,Field} methods in
14782         System.Type
14783
14784 2005-06-09  Martin Baulig  <martin@ximian.com>
14785
14786         * reflection.c
14787         (mono_reflection_bind_generic_method_parameters): Fix #75169.
14788
14789 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14790         * reflection.c (mono_image_basic_init): Define
14791         Version in MonoDynamicAssembly. 
14792         
14793 2005-06-08  Martin Baulig  <martin@ximian.com>
14794
14795         Fix #75136.
14796
14797         * loader.c
14798         (mono_method_signature_full): New public method; takes a
14799         `MonoGenericContext *'.
14800         (find_method): Use mono_method_signature_full() and pass the
14801         klass'es context to it.
14802
14803         * class.c (mono_class_is_inflated_method): Use
14804         mono_method_signature_full() and pass the context to it.
14805
14806 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
14807
14808         * object.c: add proper locking in mono_remote_class_vtable(),
14809         fixes possible memory corruption.
14810
14811 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
14812
14813         * marshal.c (mono_remoting_marshal_init): set
14814         initialized after initialization.
14815
14816 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
14817
14818         * locales.c : hush.
14819
14820 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
14821
14822         * object.c (extend_interface_array): fix really silly
14823         memory corrupting / comparison bug.
14824
14825 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14826
14827         * reflection.c: Functions added to support the creation
14828         of CustomAttributeData, which includes Attribute data
14829         used by ReflectionOnly methods.
14830
14831         * reflection.h:  mono_reflection_get_custom_attrs_data and
14832          mono_custom_attrs_data_construct added (functions exposed).
14833
14834          * icall.c: Added mono_reflection_get_custom_attrs_data
14835          as icall.
14836         
14837 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
14838
14839         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
14840         lupus's request.
14841
14842 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
14843
14844         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
14845
14846         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
14847         dynamic DllImportAttribute.
14848
14849         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
14850         dynamic DllImportAttribute.
14851
14852         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
14853         Fixes #75162.
14854
14855 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14856
14857         * threads.c: avoid segfault when an unstarted thread is aborted.
14858
14859 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
14860
14861         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
14862         Returns the name and version of the runtime for reporting.
14863
14864 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14865
14866         * appdomain.c: bump corlib version.
14867         * object-internals.h: new field in MonoReflectionAssembly.
14868
14869 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14870
14871         * object-internals.h: Carlos forgot to add this field.
14872
14873 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14874
14875         * icall.c: Added create_version to create instances
14876         of Version of MonoReflectionAssemblyName. This change helps
14877         the AssemblyName tests to keep running fine.
14878         
14879 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
14880   
14881         * object.c (mono_method_return_message_restore): A somehow less
14882         intrusive fix for #75138.
14883
14884 2005-06-03  Raja R Harinath  <rharinath@novell.com>
14885
14886         * object.c (mono_method_return_message_restore): Fix computation
14887         of expected number of out args.
14888
14889 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
14890
14891         * reflection.c (mono_image_get_method_info): Fix the case when the
14892         charset is empty.
14893
14894 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
14895
14896         * object.c: Added missing null check in
14897           mono_method_return_message_restore.
14898
14899 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
14900
14901         * reflection.c (mono_image_get_method_info): Handle the case when
14902         dllentry is empty.
14903
14904 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
14905
14906         * object.c: When creating the vtable for a proxy, take into account
14907         all inherited interfaces, not only the ones registered in
14908         iclass->interfaces. This fixs bug #74996.
14909         Also, in mono_method_return_message_restore, verify that the array
14910         of out args has the expected lengh.
14911
14912 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14913
14914         * socket-io.c: update the timeout in Poll when the call is interrupte.
14915
14916 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14917
14918         * socket-io.c: support abort/suspend in Select_internal after last
14919         change.
14920
14921 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14922
14923         * threadpool.c: remove warning.
14924
14925 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14926
14927         * icall.c:
14928         * socket-io.[ch]: Select_internal uses poll() now when available, thus
14929         removing the 1024 limit from select(). Runtime part of the fix for
14930         bug #71203.
14931
14932 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14933
14934         * socket-io.c: when resolving the addresses for the same
14935         host returned by gethostname(), get the local IPs from the interface
14936         list. Loopback addresses are discarded if the are interfaces up with
14937         non-loopback ones. Fixes bug #63265.
14938
14939 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
14940
14941         * appdomain.c, verify.c, object-internals.h, reflection.c:
14942         bumped corlib number to 36, and added new extra_flags field
14943         to ReflectionMethodBuilder and friends.  Fixes #75060.
14944
14945 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
14946
14947         * gc.c: register a new weak link only if the object is non-null
14948         (fixes bug#75047).
14949
14950 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
14951
14952         * culture-info.h : short time pattern too.
14953
14954 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
14955
14956         * culture-info.h : expand long time pattern string length.
14957
14958 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
14959
14960         * culture-info-table.h : update (more French date format; #72788).
14961
14962 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
14963
14964         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
14965         the method is static. Fixes #75029.
14966
14967 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
14968
14969         * reflection.c: Update the table_idx field of method builders after
14970         saving the module, since it can change. This is a workaround for
14971         bug #74914. 
14972
14973 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
14974
14975         * culture-info-table.h : update (additional French date format).
14976
14977 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
14978
14979         * icall.c (ves_icall_type_Equals): Revert last change.
14980         
14981         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
14982
14983         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
14984
14985 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
14986
14987         * class-internals.h: Added executioncontext_class field to 
14988         MonoDefaults structure.
14989         * domain.c: Cache System.Threading.ExecutionContext class in 
14990         mono_defaults.
14991         * object.c: Capture the ExecutionContext for asynchroneous calls in
14992          mono_async_result_new.
14993         * object-internals.h: Added execution_context and original_context 
14994         fields to MonoAsyncResult. Added execution_context to MonoThread.
14995         * security-manager.c|.h: Added mono_get_context_capture_method to 
14996         return the capture method (if required by the security manager or by
14997         the framework version used).
14998         * threadpool.c: Apply capture (if present) ExecutionContext in 
14999         mono_async_invoke and revert to original context after it completes.
15000
15001 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
15002
15003         * culture-info-table.h : updated (real hacky solution for zh-CHT).
15004
15005 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
15006
15007         * culture-info-table.h : zh-CHT related workaround.
15008
15009 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
15010
15011         * marshal.c (emit_marshal_custom): Add some error checking and call the
15012         methods in the ICustomMarshaler interface. Fixes #74875.
15013         
15014         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
15015         native->managed wrappers.
15016
15017 2005-05-12  Martin Baulig  <martin@ximian.com>
15018
15019         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
15020         here and use the loader lock.
15021
15022         * mono-debug.c: Properly lock when the debugger is not attached.
15023         (mono_debug_init): Release the initial lock if we're not running
15024         in the debugger.
15025
15026 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
15027
15028         * marshal.c (emit_marshal_custom): Pass through NULL values without
15029         calling the custom marshalling routines.
15030
15031         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
15032         conversion in structures. Fixes #74882.
15033
15034 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
15035
15036         * culture-info-table.h : zh-* cultures were missing.
15037
15038 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
15039
15040         * threads.c: Added a new event background_change_event which is signaled
15041         when a thread changes its background mode.
15042         Moved here several checks previously done in managed code. The checks
15043         require the thread lock, and using the thread lock in managed code
15044         can result in deadlocks.
15045         Merged Start_internal and Thread_internal into a single method. Now 
15046         Thread_internal does all work of creating and starting a thread.
15047         Added icalls for setting and getting the state of the object. Moved from
15048         managed code to avoid locking there.
15049         Added wait_for_tids_or_state_change() which is called instad of
15050         wait_for_tids when waiting for non-backround threads to end. This method
15051         will return if one of the threads ends or the background_change_event
15052         is signaled.
15053         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
15054         the background mode. This method signals the background_change_event
15055         event.
15056         * icall.c:
15057         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
15058         removed Start_internal.
15059         
15060 2005-05-11  Martin Baulig  <martin@ximian.com>
15061
15062         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
15063         to order of some fields to get proper alignment on 64-bit machines.
15064
15065 2005-05-11  Martin Baulig  <martin@ximian.com>
15066
15067         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
15068         changes as they're broken and completely fuck up the debugger.
15069
15070         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
15071
15072 2005-05-10  Martin Baulig  <martin@ximian.com>
15073
15074         * reflection.c (mono_reflection_generic_class_initialize): Don't
15075         call mono_class_setup_parent() here.
15076
15077 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15078
15079         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
15080         send/receive timeout use an integer in milliseconds. We were using a
15081         struct timeval.
15082
15083 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15084
15085         * locales.c:
15086         (internal_get_cultures): reserve the first slot of the array for the
15087         InvariantCulture, which will be filled in managed code.
15088
15089 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
15090
15091         * reflection.c (mono_image_fill_module_table): Initialize the
15092         GENERATION field as well.
15093
15094 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15095
15096         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
15097         Monitor.Enter on the object.
15098
15099 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
15100
15101         * threads.c: Enable the wait for running threads when exiting.
15102         * icall.c: Suspend all threads before exiting.
15103
15104 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
15105
15106         * assembly.c (mono_assembly_load_reference): Fix warning.
15107
15108 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15109
15110         * threadpool.c: changed the default number of threads per cpu. From now
15111         on, the default will be 20 + (5 * number of cpus) instead of 50.
15112
15113 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
15114
15115         * loader.c (mono_method_get_signature_full): Add locking here.
15116
15117 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
15118
15119         * appdomain.c: Moved methods for parsing and freeing assembly
15120         names to assembly.c.
15121         * assembly.c, domain-internals.h: Created public methods for parsing
15122         assembly names. Fixed mono_assembly_load_with_partial_name:
15123         it now finds the best match, taking into account the version,
15124         token and culture specified in the partial name. Also return
15125         the latest version if no version information is specified.
15126
15127 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
15128
15129         * threadpool.c: replace check for SocketAsyncCall class.
15130
15131 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15132
15133         * threadpool-internals.h:
15134         * Makefile.am: added threadpool-internals.h
15135
15136         * threadpool.c: call mono_unhandled_exception on exceptions not handled
15137         that happen in threadpool threads (tested on MS).
15138         (mono_thread_pool_remove_socket): new function that dispatch any pending
15139         AIO call on a socket that is closing. By now only epoll really needs it,
15140         as select/poll wake up when the socket closes.
15141
15142
15143         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
15144
15145 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
15146
15147         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
15148
15149 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
15150
15151         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
15152
15153 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
15154
15155         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
15156         has an abort request, convert it into a suspend request.
15157
15158 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
15159
15160         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
15161         warning for the usage of `UnmanagedFunctionPointerAttribute' which
15162         is not supported yet.
15163
15164 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15165
15166         * image.c: register assemblies loaded from data (bundles) in the loaded
15167         assemblies hash. Fixes bug #74772.
15168
15169 2005-04-29  Martin Baulig  <martin@ximian.com>
15170
15171         * class.c (mono_type_get_name_recurse): Update to the new naming
15172         schema from the latest .NET 2.x beta2.
15173         (mono_class_setup_vtable_general): If we're a generic instance,
15174         copy the vtable from our generic type definition and inflate all
15175         the methods in it.
15176
15177         * loader.c (find_method): Update to the new naming schema from the
15178         latest .NET 2.x beta2.
15179
15180 2005-04-29  Raja R Harinath  <harinath@gmail.com>
15181
15182         * class.c (mono_class_init): Add a mono_loader_unlock to the
15183         #74734 fix.
15184
15185 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
15186
15187         * icall.c (ves_icall_System_Environment_Exit): Remove the 
15188         suspend_all_other_threads () call for the time being, since it can hang.
15189
15190         * threads.c (mono_thread_manage): Similarly, disable the waiting for
15191         the background threads to exit, since it can also hang.
15192
15193         * class.c (mono_class_init): Applied patch from Ankit Jain 
15194         (radical@gmail.com). Avoid pending init errors when a field refers
15195         to a nested class using a typeref. Fixes #74734.
15196
15197         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
15198         this for dynamic modules.
15199
15200 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15201
15202         * threads.c: don't wait for threads that are in the process of aborting
15203         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
15204         and waiting for background threads to finish. This makes xsp and
15205         mod-mono-server exit without random length delays and/or hangs.
15206
15207 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15208
15209         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
15210
15211 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
15212
15213         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
15214         dynamic types to prevent infinite loops. Fixes #74727.
15215
15216         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
15217         ..._is_assignable_to.
15218
15219 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
15220
15221         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
15222
15223 2005-04-25  Martin Baulig  <martin@ximian.com>
15224
15225         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
15226
15227         * domain.c
15228         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
15229
15230         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
15231
15232         * reflection.c (build_compressed_metadata): Set metadata header
15233         version to 2.0.
15234
15235 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
15236
15237         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
15238         number into an integral and a decimal part. Fixes #70473.
15239
15240         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
15241
15242 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
15243
15244         * culture-info-table.h : reflected the latest locale-builder output.
15245
15246 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15247
15248         * threadpool.c: check for SuspendRequested too when deciding if
15249         mono_thread_interruption_checkpoint should be called.
15250
15251 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15252
15253         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
15254         * threads.c: remove interruption_mutex and use Interlocked instead. When
15255         suspending all the threads, wait for all the suspended events at once.
15256         If we're shutting down and get an APC that is going to be queued,
15257         call mono_thread_execute_interruption immediately, as the thread might
15258         be sleeping on a pthread condition or mutex.
15259
15260         * icall.c: call mono_runtime_set_shutting_down before suspending the
15261         threads.
15262
15263         Fixes bug #74693. And now xsp is happier when exiting.
15264
15265 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
15266
15267         * loader.c (mono_stack_walk): Fix #74690.
15268
15269 2005-04-22  Martin Baulig  <martin@ximian.com>
15270
15271         * mono-debug.h (MonoDebugMethodJitInfo): Added
15272         `MonoDebugMethodJitInfo *jit'.
15273
15274         * mono-debug.c (mono_debug_read_method): Cache the
15275         MonoDebugMethodJitInfo in `address->jit'.
15276         (mono_debug_free_method_jit_info): New public method.
15277
15278 2005-04-22  Martin Baulig  <martin@ximian.com>
15279
15280         * class.c (mono_class_is_assignable_from): Disallow
15281         type parameter -> interface.
15282
15283 2005-04-21  Dick Porter  <dick@ximian.com>
15284
15285         * threads.c (mono_thread_create): Turn an assertion into an error.
15286
15287 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
15288
15289         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
15290         
15291         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
15292         Fix some gcc 4.0 warnings.
15293
15294 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
15295
15296         * file-io.c: fix alt dir separator char on unix systems
15297         and cleanup (fixes bug #71214).
15298
15299 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
15300
15301         * marshal.c: Use CALLVIRT instead of CALL when dispatching
15302         a call to a remote domain, since the method may be an
15303         interface method in the client domain. This fixes bug #74192.
15304
15305 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15306
15307         * threadpool.c: recv/send are now performed before going back to managed
15308         code to save one transition.
15309
15310 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15311
15312         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
15313
15314         * metadata/threadpool.c: removed hack to workaround the bug above.
15315
15316         Fixes bug #74618.
15317
15318 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
15319
15320         * reflection.c reflection.h: Fix handling of parameter defaults in
15321         dynamic methods. Also fixes handling of parameter attributes.
15322         Fixes #74609.
15323
15324         * mono-debug.c (mono_debug_close_image): Fix warning.
15325
15326 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15327
15328         * socket-io.h: replaced old unused field with new 'blocking'.
15329         * threadpool.c: restore socket blocking state on windows(tm).
15330
15331 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
15332
15333         * icall.c: don't return the codebase in the AssemblyName[] returned by
15334         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
15335         * object-internals.h: Removed FIXME (fields were presents) and fixed
15336         versioncompat declaration.
15337
15338 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15339
15340         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
15341         not closed, so don't cleanup when it happens.
15342
15343 2005-04-13  Chris Toshok  <toshok@ximian.com>
15344
15345         * mono-debug-debugger.h: change prototype for
15346         mono_debugger_lookup_type.
15347
15348         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
15349         this function, although it should probably be named
15350         mono_debugger_init_type.
15351
15352 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15353
15354         * threadpool.c: fix non-AIO case.
15355
15356 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
15357
15358         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
15359         the built-in profiler to measure just JIT compilation times.
15360
15361 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15362
15363         * threadpool.c: the epollfd might be closed by another thread at
15364         any time, so ignore EBADF at treat it as a "we're closing" sign.
15365
15366 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15367
15368         * threadpool.c: release the semaphores with a count equals to the number
15369         of working threads in both IO and regular pools. Fixed typo that messed
15370         up the count of IO pool threads. Don't initialize the pipe handles if
15371         we're using epoll.
15372
15373 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15374
15375         * threadpool.c: some systems don't like a NULL when deleting the socket
15376         from epoll.
15377
15378 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15379
15380         * threadpool.c: fix semaphore allocation.
15381
15382 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15383
15384         * threadpool.c: added epoll() based implementation for asynchronous IO
15385         that is used instead of the default poll() when available.
15386         It can be disabled by setting MONO_DISABLE_AIO.
15387
15388 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15389
15390         * threadpool.c: windows needs 'closesocket' and instead of returning
15391         0 when the stream is closed while in select, it returns -1. Fixes bug
15392         #74573.
15393
15394 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
15395
15396         * class.c (class_compute_field_layout): Fix the regression caused by
15397         the previous try.
15398
15399 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15400
15401         * threadpool.c: separate pool for socket async. IO.
15402         * threadpool.h: mono_max_worker_threads is not a global any more.
15403
15404 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
15405
15406         * class.c (class_compute_field_layout): Fix #74549.
15407
15408 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15409
15410         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
15411         use 2 connected sockets instead.
15412
15413 2005-04-08  Miguel de Icaza  <miguel@novell.com>
15414
15415         * mono-config.c: Add new entry point for mkbundle
15416         mono_config_parse_memory. 
15417
15418 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15419
15420         * threadpool.c: removed another unused function.
15421
15422 2005-04-08  Ankit Jain  <radical@corewars.org>
15423
15424         * reflection.c (get_default_param_value_blobs): Add 'types'
15425         parameter to get the types encoded in the constant table.
15426         (mono_param_get_objects): Use the type from the constant table,
15427         not the type of the parameter, when creating default values.
15428         Handle null default values correctly.
15429
15430 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15431
15432         * file-io.c:
15433         * file-io.h:
15434         * threadpool.c:
15435         * threadpool.h:
15436         * icall.c:
15437         * socket-io.c: removed dead code for async IO.
15438
15439 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15440
15441         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
15442
15443         * threadpool.c: intercept socket async. calls and pass them to a thread
15444         that is polling and dispatching the job items to the threadpool as
15445         socket become ready. Fixes bugs #71217, #71933.
15446
15447         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
15448         between char and short/ushort arrays.
15449
15450         * socket-io.c: remove dead code.
15451
15452 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
15453
15454         * locales.c,
15455           icall.c : removed InternalToUpper_Comp() and
15456           InternalToLower_Comp().
15457
15458 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
15459
15460         * char-conversions.h : The tables were incorrectly generated. Should
15461           be generated against invariant culture.
15462
15463 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
15464
15465         * object.c (mono_runtime_invoke_array): Fix return value when 
15466         passing pre-created valuetype objects to ctors.
15467
15468         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
15469         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
15470         Fixes #74338.
15471
15472 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
15473
15474         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
15475         only used with --security and hides the wrong corlib version error.
15476
15477 2005-03-30  Joshua Tauberer  <tauberer@for.net>
15478
15479         * class.c: Changed mono_class_name_from_token so that types
15480         outside of a namespace don't have an initial period.  Improved
15481         the g_warning message used in _mono_class_get when loading
15482         fails.
15483         * assembly.c: In mono_assembly_load_reference, when an assembly
15484         can't be found, "No such file or directory" is misleading and
15485         unhelpful because a few paths were checked for the presence of
15486         the assembly.  When that happens (ENOENT), display a nicer
15487         message indicating the directories that were searched.  In all
15488         cases, the warning is made easier to read for non-hackers.
15489
15490 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
15491
15492         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
15493         project/solution.
15494         * appdomain.h|domain.c: Removed inline from functions.
15495         * appdomain.c: Reduced warnings when compiling on windows.
15496         * icall.c: Fixed output_debug declaration to gunichar2*.
15497         * mono-config.c: Reduced warnings when compiling on windows.
15498         * rand.c: Added missing "windows.h". Added missing return value.
15499         * rawbuffer.c: Added missing winsock2.h for windows.
15500         * sysmath.h: Added mono-compiler.h header to allow/ease 
15501         compilation with non-GCC compilers.
15502         * threads.c: Fixed declarations to compile with VS.NET C compiler.
15503         Removed cast warnings.
15504
15505         Adapted from the work of J Lothian (for VC6).
15506
15507 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
15508
15509         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
15510         from default_path.
15511
15512 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
15513
15514         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
15515         the 2.0 profile.
15516
15517 2005-03-27  Raja R Harinath  <harinath@gmail.com>
15518
15519         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
15520         has to be in $(exec_prefix).  $(prefix) is for arch-independent
15521         stuff, and it would probably use $(prefix)/share rather than
15522         $(prefix)/lib.
15523
15524 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15525
15526         * console-io.c: added 2 includes that might be missing.
15527
15528 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
15529
15530         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
15531         profile.
15532
15533         * reflection.c (create_custom_attr): Allocate the params array using
15534         alloca so it gets GC tracking.
15535
15536 2005-03-23  Chris Toshok  <toshok@ximian.com>
15537
15538         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
15539         out some spew.
15540
15541 2005-03-24  Raja R Harinath  <rharinath@novell.com>
15542
15543         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
15544         changes to pick up any changes in prefix, etc.
15545
15546 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
15547
15548         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
15549         
15550         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
15551         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
15552
15553 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
15554
15555         * class-internals.h object-internals.h class.c reflection.c: Extend the
15556         mono_lookup_dynamic_token () function to return the class of the
15557         token as well. 
15558
15559         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
15560         well. Fixes #73848.
15561
15562 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
15563
15564         * security-manager.c: Skip inheritance checks for intra-corlib
15565         class inheritance and method overrides. This skips a lot of checks
15566         and (anyway) permissions cannot work until corlib is loaded.
15567
15568 2005-03-23  Martin Baulig  <martin@ximian.com>
15569
15570         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
15571         MONO_TYPE_GENERICINST.  
15572
15573 2005-03-23  Martin Baulig  <martin@ximian.com>
15574
15575         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
15576
15577 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
15578
15579         * class.c: added locking comments to some functions.
15580         Cache the interface offsets arrays (saves about 20 KB
15581         of runtime memory in a typical app).
15582         Reduce the time overhead in mono_class_setup_supertypes ().
15583
15584 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
15585
15586         * icall.c: speedup and fix leaks in GetMethodsByName and
15587         GetPropertiesByName.
15588
15589 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
15590
15591         * reflection.c: some locking fixes.
15592
15593 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
15594
15595         * metadata.c: added missing break in case statement.
15596
15597 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
15598
15599         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
15600         typedbyref return values. Fixes #73941.
15601
15602 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
15603
15604         * security-manager.c|h: Added demandunmanaged method and 
15605         suppressunmanagedcodesecurity class to MonoSecurityManager.
15606         Renamed aptc class to allowpartiallytrustedcallers.
15607
15608 2005-03-17  Martin Baulig  <martin@ximian.com>
15609
15610         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
15611
15612 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15613
15614         * file-io.c: disabled file async. IO using aio_*. It uses the
15615         threadpool now. Workaround for bug #73718.
15616
15617 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
15618
15619         * assembly.h, mono-config.c: added code to deal with bundled configs
15620         for bundled assemblies.
15621
15622 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
15623
15624         * *.c, private.h: cleanup, removing old private.h header file.
15625
15626 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
15627
15628         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
15629         and throw_on_unmappable_char attributes.
15630
15631 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
15632
15633         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
15634         _ProcessName_internal.
15635
15636 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
15637
15638         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
15639         #73631.
15640
15641         * icall.c threads.c threads-types.h: Remove slothash icalls as they
15642         are no longer used.
15643
15644 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
15645
15646         * object.c (compute_class_bitmap): Add support for generics. Fixes
15647         #73527.
15648
15649 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
15650
15651         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
15652
15653 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15654
15655         * filewatcher.c: commented out the code for windows watcher, as we don't
15656         use it (we use the managed implementation instead).
15657
15658 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
15659
15660         * object-internals.h (MonoThread): Remove 'unused1' field.
15661
15662         * appdomain.c: Bump corlib version.
15663
15664         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
15665
15666         * reflection.c (mono_reflection_create_runtime_class): Remove the
15667         AssemblyBuilder.Save optimization since it causes too many problems.
15668
15669 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
15670
15671         * exception.c|h: Added mono_get_exception_reflection_type_load to
15672         create a ReflectionTypeLoadException object.
15673         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
15674         to return NULL is a InheritanceDemand fails during reflection. Updated
15675         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
15676         ReflectionTypeLoadException if an InheritanceDemand fails during 
15677         reflection. Added icall mapping for GetLinkDemandSecurity.
15678         * security-manager.c|h: Added ves_icall_System_Security_
15679         SecurityManager_GetLinkDemandSecurity internal call to return the
15680         class and methods permissions set for a LinkDemand. Removed unused
15681         fields in MonoSecurityManager.
15682
15683 2005-03-10  Martin Baulig  <martin@ximian.com>
15684
15685         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
15686         it's a generic instance.
15687
15688 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
15689
15690         * reflection.c (mono_get_object_from_blob): Applied patch from
15691         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
15692
15693         * class.c (mono_class_is_assignable_from): Another try at fixing 
15694         #73469 without breaking anything.
15695
15696 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
15697
15698         * class.c: (mono_class_is_assignable_from): Revert the last changes
15699         since they don't work with generics.
15700         
15701         * class.c (mono_class_is_assignable_from): Fix build bustage.
15702
15703         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
15704         the managed IsAssignableFrom method. Fixes #73469.
15705
15706         * reflection.c (mono_reflection_call_is_assignable_from): New helper
15707         function.
15708
15709 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
15710
15711         * object.c (mono_load_remote_field_new): Fix returning uninitialized
15712         memory when the remoting callback does not sets the out arguments.
15713         Fixes #73007.
15714
15715         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
15716         by mistake.
15717
15718         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
15719
15720         * object-internals.h (MonoStackFrame): Sync with managed object layout.
15721
15722         * appdomain.c: Bump corlib version.
15723
15724 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
15725
15726         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
15727         function.
15728
15729         * threads.c (mono_thread_attach): Detect threads which are not started
15730         by the GC pthread wrappers.
15731
15732 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
15733
15734         * icall.c: Added new icall for RNG.
15735         * rand.c|h: Added new icall to open the RNG. This allows to share a 
15736         single handle on Linux to access /dev/urandom and fix #73183.
15737
15738 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
15739
15740         * object.c: setting the new vtable in a transparent proxy object must
15741         not change the GC descriptor.
15742
15743 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15744
15745         * object.c: fixed compilation without GCJ support.
15746         * reflection.c: for runtime-created types ensure klass->has_references
15747         is correct (bug #73215).
15748
15749 2005-03-02  Martin Baulig  <martin@ximian.com>
15750
15751         * class.c (mono_class_is_assignable_from): Make this work if
15752         `oklass' is a generic instance; fixes #72831.
15753
15754 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
15755
15756         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
15757         with hasthis set.
15758         
15759         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
15760
15761         * marshal.c: Reorganize native->managed marshalling code to also use
15762         the emit_marshal_... functions.
15763
15764 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
15765
15766         * object.c: typed allocs have issues with bitmap sizes > 30,
15767         so check for max_set >= 30.
15768
15769 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
15770
15771         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
15772         managed code. Fixes #73012.
15773
15774         * metadata.h (MonoMarshalSpec): Add elem_mult field.
15775
15776         * metadata.c reflection.c: Load/Emit elem_mult as well.
15777         
15778         * metadata.h (MonoMarshalSpec): Add comment.
15779
15780         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
15781
15782         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
15783         num_elem to -1 if not given.
15784
15785         * object-internals.h (MonoReflectionMarshal): Add has_size field.
15786
15787         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
15788         given values.
15789
15790 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
15791
15792         * null-gc.c (mono_gc_free_fixed): Was not compilable.
15793
15794 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
15795
15796         * reflection.c (encode_marshal_blob): Encode param_num field as well.
15797
15798         * object-internals.h (MonoReflectionMarshal): Add param_num field.
15799
15800 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
15801
15802         * object.c: generalized the reference bitmap creation
15803         and added hooks for the new GC.
15804         * class-internals.c: removed the gc_bitmap field from MonoClass.
15805
15806 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
15807
15808         * domain.c: help the compiler to produce better code
15809         in mono_jit_info_table_find ().
15810
15811 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
15812
15813         * object.c: make all allocations look typed.
15814
15815 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
15816
15817         * socket-io.c: load Mono.Posix if it's not loaded already
15818         (fixes bug#73033).
15819
15820 2005-02-24  Martin Baulig  <martin@ximian.com>
15821
15822         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
15823         * reflection.c (dup_type): Likewise.
15824
15825 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
15826
15827         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
15828         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
15829
15830 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
15831
15832         * domain.c, threads.c, object-internals.h: make the critical thread
15833         local vars use the fast access mode (even when we're compiled in
15834         a lib). Provide accessors to be used by the jit during codegen.
15835
15836 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
15837
15838         * appdomain.c: Changed hook functios behavior to include
15839         support for the reflection only assemblies. Some icalls were changed
15840         to support the mentioned assemblies too. Signatures of static methods
15841         try_assembly_resolve and real_load now have an additional parameter:
15842         refonly.
15843
15844         * assembly.c: General changes to mono_assembly_ methods to support
15845         reflection only api. Functions mono_assembly_open, mono_assembly_load,
15846         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
15847         suffix, to support an additional gbool parameter to specify whether
15848         the assembli is reflection only or not. Created some new hook functions 
15849         to add support for reflection only assemblies. Signatures of static 
15850         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
15851         have now an additional parameter: refonly.
15852
15853         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
15854         indicating whether the assembly is reflection only or not.
15855
15856         * exception.c: Add mono_get_exception_invalid_operation.
15857
15858         * icall.c: Throw an InvalidOperationException when trying to invoke
15859         a property/method/event, or trying to set/get the value of a field.
15860         Also add an icall to retrieve the ref_only flag to the
15861         MonoReflectionAssembly.
15862
15863 2005-02-23  Chris Toshok  <toshok@ximian.com>
15864
15865         Part of fix for #72827.
15866         * mono-debug.c (mono_debug_add_method): add lexical block data to
15867         the info we write.  Kind of a hack at the moment - we copy the
15868         lexical block info from the MonoDebugMethodInfo to the
15869         MonoDebugMethodJitInfo here, before writing it.
15870         (mono_debug_read_method): read the lexical block info.
15871
15872         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
15873
15874         * debug-mono-symfile.h: add lexical block support.
15875
15876         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
15877         support.
15878
15879 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
15880
15881         * loader.c (mono_lookup_pinvoke_call): Fix warning.
15882
15883         * object.c (mono_runtime_free_method): Call mono_free_method () and
15884         put the TODOs there.
15885
15886         * loader.c (mono_free_method): Free up most memory allocated for 
15887         dynamic methods.
15888
15889 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
15890
15891         * reflection.c: properly flag a Type argument to a
15892         named custom attr value (bug #72248).
15893
15894 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
15895
15896         * reflection.c: reduce code duplication in named custom
15897         attribute encoding.
15898
15899 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
15900
15901         * reflection.c: properly encode custom attrs of type object
15902         (bug #72649).
15903
15904 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
15905
15906         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
15907
15908 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
15909
15910         * socket-io.c: load System.dll if it's not loaded already
15911         (bug #72850 and #70477).
15912
15913 2005-02-21  Martin Baulig  <martin@ximian.com>
15914
15915         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
15916         generic instances.
15917
15918 2005-02-21  Martin Baulig  <martin@ximian.com>
15919
15920         * reflection.c (mono_image_build_metadata): We also need to
15921         "fixup" the MethodImpl table after we computed the final method
15922         indices.  Call fixup_methodimpl() to do that.
15923         (fixup_methodimpl): New private method.
15924
15925 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
15926
15927         * assembly.c: special case mscorlib.dll (bug#72536),
15928         patch from Carlos Alberto Cortez.
15929
15930 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
15931
15932         * threads-types.h threads.c: Fix build bustage.
15933
15934         * threads.c: Use a union for long<->double conversions.
15935
15936         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
15937         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
15938
15939         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
15940         containing the checkpoint call with NOT_TAKEN.
15941         
15942         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
15943         checkpoint before pushing the arguments, so they won't have to be
15944         spilled to stack.
15945
15946 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15947
15948         * domain.c, assembly.c, domain-internals.h: make some data
15949         const and relocation-free.
15950
15951 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
15952
15953         * object.c, appdomain.c, class-internals.h: introduce the
15954         MonoClassRuntimeInfo structure to hold the info needed to
15955         use a class at runtime. Made mono_class_vtable() lock-free
15956         for all the appdomains.
15957
15958 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
15959
15960         * metadata-internals.h, image.c: introduce a per-image mempool to
15961         be used for memory that has the same lifetime as the image.
15962
15963 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
15964
15965         * domain.c: In mono_init_internal(), instead of selecting the first
15966         runtime version supported by an executable, get a list of all
15967         supported versions and select the one for which an mscorlib exists
15968         (since even if the runtime supports a given version, it doesn't mean
15969         that the framework for that version is installed).
15970         Modified get_runtimes_from_exe to support this behavior.
15971         In supported_runtimes, added information about additional system
15972         assembly versions.
15973         
15974         * assembly.c: Added support for more than one system assembly version
15975         per runtime version. Updated the assembly list.
15976         In mono_assembly_remap_version, removed the initial version check,
15977         since we don't know to which version we need to compare until we
15978         get the version set on which the assembly is based.
15979         Moved the code for loading corlib into the new method
15980         mono_assembly_load_corlib(), so it can be used by the initialization
15981         code.
15982         
15983         * domain-internals.h: Updated data structures and added declaration
15984         for mono_assembly_load_corlib.
15985
15986 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
15987
15988         * reflection.c (resolve_object): Fix the creation of the signature in 
15989         the SignatureHelper case.
15990
15991         * assembly.c (mono_assembly_remap_version): Fix binary search.
15992         
15993 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
15994  
15995         * class.c: Added inheritance check when a method is overloaded (from a
15996         virtual method or when implementing an interface) and when a class is
15997         inherited. Added functions to set a failure for a class and to 
15998         retreive the exception from a failure.
15999         * class-internals.h: Added fields to MonoClass to keep the exception
16000         information status for inheritance (or other exceptions) to be thrown
16001         later (i.e. not at load time).
16002         * object.c: Throw the inheritance SecurityException when a type is to 
16003         be created with either class or method inheritance violations.
16004         * reflection.c|h: Fix when getting declsec from a class. Removed 
16005         unrequired code for class. Improved sanity in parameter naming.
16006         * security-manager.c|h: Added functions to check for class and method
16007         inheritance.
16008
16009 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
16010
16011         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
16012         and has_finalize in dynamic types as well.
16013
16014 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
16015
16016         * culture-info-table.h : fixed currency format for en-GB (and so on).
16017
16018 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
16019
16020         * gc.c: ensure the GC handles never have 0 as a value.
16021
16022 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
16023
16024         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
16025         a pointer to a struct to unmanaged code. Fixes #72625.
16026
16027 2005-02-16  Martin Baulig  <martin@ximian.com>
16028
16029         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
16030
16031 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
16032
16033         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
16034
16035 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
16036
16037         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
16038
16039         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
16040         UnmanagedFunctionPointerAttribute, use it for determining calling convention
16041         etc. Fixes #71471.
16042
16043         * reflection.c (mono_custom_attrs_get_attr): New helper function.
16044
16045         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
16046
16047 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
16048
16049         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
16050         changes to make the current context a field in MonoThread.
16051
16052 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
16053
16054         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
16055         the last change.
16056         
16057         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
16058         extracted from mono_marshal_get_native_wrapper.
16059
16060         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
16061         to create wrappers around native functions.
16062
16063         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
16064         delegates for arbitrary function pointers. Fixes #71472.
16065
16066 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
16067
16068         * threads.c: cleaned up the code a little.
16069
16070 2005-02-15  Martin Baulig  <martin@ximian.com>
16071
16072         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
16073         the data table.
16074
16075         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
16076         allocate larger chunks if needed.
16077
16078 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
16079
16080         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
16081         in by mistake.
16082
16083 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
16084
16085         * domain.c: keep the domains in an array and ensure the domain ids
16086         are kept small, so they can be used as indexes to domain-specific data
16087         with a small memory overhead.
16088
16089 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
16090
16091         * icall.c: Handle byref types in Type icalls. Fixes #72544.
16092
16093 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
16094
16095         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
16096
16097 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
16098
16099         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
16100
16101         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
16102         values.
16103
16104         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
16105         
16106 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
16107
16108         * domain-internals.h: add the hashtable here.
16109
16110         * class-internals.h: Remove `info' from MonoMethod
16111
16112         * domain.c: Add a new hashtable, jit_trampoline_hash
16113
16114 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
16115
16116         * object.c: don't set the value of static fields
16117         (fixes bug#72494).
16118
16119 2005-02-11  Martin Baulig  <martin@ximian.com>
16120
16121         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
16122         (mono_debug_add_method): Silently ignore the method if it's too big.
16123         (mono_debug_add_type): Likewise.
16124
16125 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
16126
16127         * threads.c, appdomain.c: remove #ifdefs from the code.
16128
16129 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
16130
16131         * metadata-internals.h: Added flags to MonoAssembly to cache the most
16132         common security informations. This allows us to stay in unmanaged code
16133         when doing LinkDemand and it's special cases (except for the first 
16134         time for initialization). The flags a very much used with --security.
16135         * reflection.c|h: Added code to get declarative security attributes 
16136         for LinkDemand and InheritanceDemand. This required to refactor the
16137         existing code for Demand.
16138         * security-manager.c|h: Added new method fields for the special cases
16139         of LinkDemand.
16140
16141 2005-02-10  Martin Baulig  <martin@ximian.com>
16142
16143         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
16144         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
16145
16146 2005-02-10  Martin Baulig  <martin@ximian.com>
16147
16148         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
16149         debugging code; this is almost a complete rewrite.
16150
16151         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
16152
16153 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
16154
16155         * domain.c, object.h: expose mono_string_equal () and 
16156         mono_string_hash ().
16157         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
16158         it's implemented in managed code.
16159
16160 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
16161
16162         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
16163         lo leak objects between appdomains.
16164
16165 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
16166
16167         * assembly.c: old compilers compilation fix from 
16168         robertj@gmx.net (Robert Jordan).
16169
16170 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
16171
16172         * class-internals.h: Little reminder for the future.
16173
16174         * debug-helpers.c: Fix up wrapper_type_names
16175
16176 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
16177
16178         * image.c, metadata-internals.h: when loading an image from a file,
16179         mmap all of it and use the same codepaths as when using a
16180         in-memory image: the code is simpler and we use less memory
16181         (both writable and readonly).
16182
16183 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
16184
16185         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
16186         API to alloc runtime data structures that need to be tracked by the
16187         GC and contain pointers.
16188         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
16189         make the code more readable and eventually use a different GC.
16190
16191 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
16192
16193         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
16194         for out arguments.
16195         
16196 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
16197
16198         * object.c: In release_type_locks(), don't release the cctor lock
16199         if it has already been released. This fixes a crash in the
16200         thread5 test.
16201
16202 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
16203
16204         * gc.c, marshal.c, icall.c: register a delegate for finalization
16205         only when the native function pointer has been allocated for it.
16206
16207 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
16208
16209         * object.c: cleaned up some code, allocate objects that are
16210         pointer free with the atomic malloc variant. Allocate memory
16211         for static data from the mempool if it's pointer-free.
16212         Allocate the bounds array at the end of the array data, when needed.
16213         * object-internals.h, object.h: move a private function in a private
16214         header.
16215         * class.c: handle missing case in tracking references in fields.
16216
16217 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
16218
16219         * class.c, class-internals.h: keep track if a type has
16220         reference fields in either the instance or static fields.
16221
16222 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
16223
16224         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
16225         and renamed to MonoRuntimeInfo. Added fields to store the expected
16226         framework assembly version. Changed mono_get_framework_version and
16227         mono_get_runtime_version for a single mono_get_runtime_info method.
16228         
16229         * assembly.c: Added method to remap system assembly versions to the
16230         current executing runtime version. Removed old mapping code.
16231         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
16232         
16233         * icall.c, reflection.c: Track api changes.
16234
16235 2005-02-06  Miguel de Icaza  <miguel@novell.com>
16236
16237         * loader.c (method_from_memberref): Improve error reporting,
16238         produce the class name instead of the typeref/typedef index. 
16239
16240 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
16241
16242         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
16243
16244 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
16245
16246         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
16247         stdcall and charset name mangling.  Reorganize the code and add
16248         some tracing stuff.
16249
16250 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
16251
16252         * monodiet.c: More iters!
16253
16254         * marshal.c: Iter usage.
16255
16256         * icall.c: Iter usage.
16257
16258         * object.c: Use iters.
16259
16260         * debug-helpers.c: More iters
16261
16262 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
16263
16264         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
16265         under win32.
16266
16267 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
16268
16269         * mono-debug-debugger.c: use iters
16270
16271         * class.c, class-internals.h: mono_class_setup_events is static
16272         now
16273
16274         * All callers: use iters
16275
16276 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
16277
16278         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
16279         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
16280
16281 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
16282
16283         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
16284
16285         * marshal.h: Add prototypes for ldfld/stfld_remote.
16286
16287         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
16288         this is called during startup.
16289         
16290 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
16291
16292         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
16293         MonoThreadsSync struct private in monitor.c. Changed the way
16294         MonoThreadsSync is allocated so it's faster and there is no
16295         need to keep track of it with a finalizer and it uses less memory.
16296         This also finally allows us to allocate mono objects as ptrfree when
16297         there are no reference fields.
16298
16299 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
16300
16301         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
16302         disappearing link to the GC interface and use them to simplify
16303         the gchandles code.
16304
16305 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
16306
16307         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
16308         stfld_remote which call mono_load/store_field_new. This allows methods
16309         calling ldfld/stfld wrappers to be AOTed.
16310
16311         * console-io.c: Include sys/filio.h under solaris.
16312         
16313         * console-io.c: Include curses.h if needed correctly.
16314
16315 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
16316         
16317         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
16318         method->klass as well.
16319
16320         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
16321
16322         * class.c (mono_class_init): Switch on lazy initialization of 
16323         methods.
16324
16325         * class.c (mono_class_get_finalizer): Handle the case when the 
16326         finalizer is inherited.
16327
16328 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16329
16330         * console-io.c: <curses.h> is needed by term.h on solaris.
16331
16332 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
16333
16334         * icall.c, class-internals.h, monodiet.c, class.c: Remove
16335         mono_class_setup_properties where possible. Remove this ftn from
16336         the header file, and make it static.
16337
16338 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
16339
16340         * loader.c: Add missing setup_... call.
16341
16342         * class.c: Add missing setup_... calls.
16343
16344         * class.c (mono_class_init): Switch on lazy initialization of 
16345         the generic vtable.
16346         
16347         * class.c (mono_class_init): Fix generics broken by the recent changes.
16348
16349         * monodiet.c (handle_type): Add missing setup_... calls.
16350
16351         * class.c: Back out garbage in previous patch.
16352         
16353         * class.c: Add missing setup_... calls.
16354
16355         * class.c (mono_class_get_method_from_name_flags): Avoid calling
16356         mono_class_setup_methods () if possible.
16357
16358         * class-internals.h (MonoClass): Add 'has_cctor' flag.
16359
16360         * class-internals.h (MonoCachedClassInfo): New structure.
16361
16362         * class.c: Initialize properties and events fields of MonoClass lazily.
16363
16364         * class.c: Add infrastructure for lazily initializing the methods and
16365         vtable fields of MonoClass. Not yet used.
16366
16367         * class.c (mono_class_get_finalizer): New helper function.
16368
16369         * class.c: Add infrastructure for loading some class related data from
16370         an AOT file.
16371
16372         * object.c: Add infrastructure for initializing the vtable from data
16373         in the AOT file.
16374
16375         * gc.c (run_finalize): Use mono_class_get_finalizer ().
16376
16377         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
16378         appropriate initialization function before accessing parts of the
16379         MonoClass structure.
16380
16381         * marshal.c: Fix warnings.
16382         
16383         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
16384
16385         * mono-debug-debugger.c (get_exception_message): Use 
16386         mono_class_get_method_from_name_flags ().
16387
16388 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
16389
16390         * reflection.c, appdomain.c: Replace a few manual searches that
16391         Zoltan missed. (Paolo approved this part of my initial patch).
16392
16393 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
16394
16395         * profiler.c: disable recording statistical events at report time.
16396
16397 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
16398
16399         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
16400         to byteswap arrays of enum values, too (bug #72080).
16401
16402 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
16403
16404         * appdomain.c (set_domain_search_path): Allow this to be called if
16405         domain->setup is not yet set.
16406
16407         * loader.c (mono_method_get_index): New helper function.
16408
16409         * loader.c reflection.c: Use mono_method_get_index ().
16410
16411         * class.c (mono_class_get_method_from_name_flags): New helper method.
16412
16413         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
16414         this.
16415
16416         * class.c (mono_class_get_cctor): New helper method.
16417
16418         * string-icalls.c object.c class.c marshal.c reflection.c: Use
16419         mono_class_get_method () to look up methods.
16420
16421 2005-02-01  Miguel de Icaza  <miguel@novell.com>
16422
16423         * console-io.c: Fix the build, this should work on Windows.
16424
16425 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
16426
16427         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
16428         be set to null to keep things valid
16429
16430 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16431
16432         * icall.c: added Console 2.0 icalls.
16433         * Makefile.am: added console-io.[ch]
16434         * console-io.[ch]: internal calls for Console 2.0 API.
16435
16436 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
16437
16438         * class.c: make sure we consider all the interfaces
16439         when calculating max_interface_id (bug found by
16440         Jeroen Frijters running ikvm).
16441
16442 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
16443
16444         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
16445         valuetype fields to null.
16446
16447         * object.c (set_value): Ditto. Fixes #71669.    
16448
16449 2005-01-31  Martin Baulig  <martin@ximian.com>
16450
16451         * metadata.c (mono_metadata_has_generic_params): New public
16452         function; checks whether something is a generic method.
16453
16454 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
16455
16456         * appdomain.c: fix infinite recursion when adding assemblies.
16457
16458 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
16459
16460         * object.c: Fix small typo to return all items for Environment.
16461         GetCommandLineArgs.
16462
16463 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
16464
16465         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
16466         reflection.c: more domain and assembly-unload related fixes
16467         and memory leaks plugs.
16468
16469 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
16470
16471         * 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.
16472
16473 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
16474
16475         * loader.c (mono_method_signature): Make this method lazy
16476         (mono_get_method_from_token): Don't computate the signature here.
16477
16478         Doing this saves quite a bit of memory. I got 90 kb on starting up
16479         monodoc. It should also save some disk reads on startup.
16480
16481         * *: MonoMethod->signature might be NULL now. You *MUST* use
16482         mono_method_signature.
16483
16484 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
16485
16486         * object.c (mono_runtime_get_main_args): Return an array from the
16487         current domain here. Fixes #71938.
16488
16489 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
16490
16491         * monitor.c: formatting changes to comply with the
16492         mono coding style and remove #ifdefs from the code.
16493
16494 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
16495
16496         * metadata.c, private.h: remove some unneeded data
16497         and use a more compact representation for table schemas.
16498
16499 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
16500
16501         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
16502         to get a better distribution in hash tables.
16503         * *.c: use mono_aligned_addr_hash() where appropriate.
16504         * assembly.c: make var static.
16505
16506 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
16507
16508         * domain-internals.h: Put MonoJitInfo on a diet.
16509
16510         * domain.c: Fix a warning.
16511
16512 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
16513
16514         * gc.c: rework the gc handles code to reuse handles
16515         when freed.
16516
16517 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
16518
16519         * domain.c: fixed long standing bug in mono_string_equal() which
16520         was brought to light with the ldstr changes.
16521
16522 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
16523
16524         * reflection.c: Remove warning by adding missing include for marshal.h
16525
16526 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
16527
16528         * domain.c, object.c: change the ldstr_table to hold
16529         MonoString* as keys: makes the runtime isinterned lookup
16530         faster and simplifies memory management.
16531
16532 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
16533  
16534         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
16535         possible to add imperative security checks before calling the icall.
16536         * reflection.c: Return security attributes on the original MonoMethod
16537         (and not the wrapped one). This fix permissions on icalls.
16538
16539 2005-01-25  Dick Porter  <dick@ximian.com>
16540
16541         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
16542         the check for mktime() support actually test the mktime() return
16543         value.  "Fixes" bug 71682, though the output is still different to
16544         MS.
16545
16546 2005-01-25  Martin Baulig  <martin@ximian.com>
16547
16548         * class.c (mono_class_is_assignable_from): Make this work for
16549         generic instances.
16550
16551 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
16552
16553         * marshal.c (mono_string_utf8_to_builder)
16554         (mono_string_builder_to_utf16): We might not have ownership of the
16555         string. In thise case, we need to create a new buffer.
16556
16557         * object-internals.h (mono_stringbuilder_capacity): sb->str might
16558         be null, in which case, use the default capacity.
16559
16560 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
16561
16562         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
16563         GC events to the profiler.
16564
16565 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
16566
16567         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
16568         if you don't want the GC to run.
16569
16570 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
16571
16572         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
16573         start providing a GC API and keeping different implementations in
16574         their own file.
16575         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
16576
16577 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
16578
16579         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
16580         mmap rather than allocating a huge buffer.
16581         (mono_debug_close_mono_symbol_file): Free the buffer allocated
16582         above.
16583
16584 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
16585
16586         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
16587         and CheckExecutionRights.
16588         * reflection.c|h: Keep the index of the declarative security to be 
16589         used, instead of the pointer, when AOT compiler is used. Also add 
16590         class initialization when requesting demands.
16591         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
16592         CheckExecutionRights. Both properties are now FALSE by default, and
16593         unmodifiable, unless the --security option is used.
16594
16595 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
16596
16597         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
16598         reflection.c: properly refcount images and assemblies, many leaks fixed.
16599
16600 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16601
16602         * threadpool.c: increase the timeout for threads in the thread pool to
16603         10s.  Fixes bug #67159.
16604
16605 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
16606
16607         * class-internals.h: Sun's compiler insists on explicit
16608         signed on bit fields to handle then correctly.
16609
16610 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
16613         Make the size of the array fit only the number of invalid path
16614         chars that we have.
16615
16616         * class.c (_mono_class_get): Improve the error reporting when a
16617         class referenced is not found, to assist debugging. 
16618
16619 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
16620
16621         * threads.c: fix off-by-one error.
16622         * domain.c: free data allocated in the domain.
16623
16624 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
16625
16626         * reflection.c (mono_method_body_get_object): Fill out exception info
16627         as well.
16628
16629         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
16630         structure.
16631         
16632 2005-01-19  Martin Baulig  <martin@ximian.com>
16633
16634         * loader.c (mono_get_method_constrained): Make this work again.
16635
16636 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
16637
16638         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
16639         guint16 to match the managed side.
16640
16641         * reflection.c (mono_reflection_body_get_object): Fill out local
16642         variables array.
16643
16644         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
16645         as well.
16646
16647         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
16648         'local_var_sig_token'.
16649
16650 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
16651
16652         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
16653         System.Drawing.
16654
16655         * reflection.c (mono_method_body_get_object): Handle abstract and
16656         runtime methods.
16657
16658 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
16659
16660         * marshal.c, loader.c, class-internals.h, reflection.c:
16661         store the emthod data for a wrapper in an array instead of a list.
16662
16663 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
16664
16665         * marshal.c: change the code to allocate memory more
16666         conservatively for method wrappers.
16667
16668 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
16669
16670         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
16671         fields from MonoClass to the marshal info structure where they belong.
16672
16673 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
16674
16675         * class.c, object.c, class-internals.h, marshal.c: rearrange
16676         some fields and tweak some types to lower memory usage.
16677
16678 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
16679
16680         * threads.c (signal_thread_state_change): Handle the case when the
16681         target thread is the current thread.
16682
16683         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
16684
16685         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
16686         emit_ptr_to_object_conv. 
16687
16688         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
16689         marshalling. Fixes #71352.
16690
16691 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
16692
16693         * metadata.h, blob.h: move table enum to blob.h so it can be included
16694         in any header.
16695         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
16696         cut the size of MonoImage/MonoDynamicImage.
16697
16698 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
16699
16700         * profiler.c (mono_profiler_install_simple): Fix default arguments.
16701
16702 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
16703
16704         * reflection.c, reflection.h, icall.c: add a function to check
16705         if an attribute type is defined for a metadata object.
16706
16707 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
16708
16709         * object-internals.h: Added some needed fields from StringBuilder class.
16710         * marshal.c: Set the maxCapacity when creating a StringBuilder.
16711
16712 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
16713
16714         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
16715         threads before shutting down the runtime.
16716
16717         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
16718
16719 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
16720
16721         * object-internal.h, threads.c: implement stacksize and 
16722         parameterized thread start functionality (requires
16723         matching corlib). Marked broken code for later removal.
16724
16725 2005-01-12  Martin Baulig  <martin@ximian.com>
16726
16727         * class-internals.h (MonoGenericClass): Moved the `initialized'
16728         flag to MonoDynamicGenericClass, removed `init_pending'.
16729         (MonoGenericInst): Added `is_reference' flag.
16730
16731 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
16732
16733         * reflection.c (mono_image_create_pefile): Only set the pe_offset
16734         inside the MSDOS header. Fixes #71201.
16735
16736         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
16737         gc thread.
16738         (mono_domain_finalize): Ditto.
16739
16740 2005-01-12  Martin Baulig  <martin@ximian.com>
16741
16742         * class.c (mono_get_shared_generic_class): Use the cache for
16743         non-dynamic generic classes.
16744
16745         * class-internals.h (mono_class_create_generic_2): Removed
16746         function prototype, this function is now static inside class.c.
16747
16748         * class.c (mono_class_create_generic_2): Made this static, only
16749         call it from mono_class_init() and mono_class_setup_parent().
16750         (collect_implemented_interfaces_aux): Call mono_class_init() on
16751         the interfaces we collect.
16752         (mono_class_setup_vtable): Call mono_class_init (class->parent).
16753
16754 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
16755
16756         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
16757         it a real thread handle.
16758
16759         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
16760         MonoJitExceptionInfo, since each catch clause needs its own variable.
16761         
16762 2005-01-11  Dick Porter  <dick@ximian.com>
16763
16764         * image.c (mono_pe_file_open): New variant on mono_image_open()
16765         that does not set up the CLI metadata; used for FileVersionInfo so
16766         it can get the data for windows binaries too.
16767         
16768         * process.c (process_read_string_block): Don't read off the end of
16769         the StringTable block.
16770
16771         These both fix bug 70766.
16772
16773 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
16774
16775         * gc.c: set some fields to NULL at GC cleanup time.
16776         * threads.c: if we quit the main thread, call exit ().
16777
16778 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
16779
16780         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
16781
16782 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
16783
16784         * threads.h, threads.c, object.c: added accessor and settor for
16785         main_thread. Handle it specially when exiting from it: wait
16786         for other foreground threads to exit.
16787
16788 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
16789
16790         * process.c, verify.c: remove some bloat.
16791
16792 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
16793
16794         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
16795         the calling convention to cdecl under win32.
16796
16797 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
16798
16799         * object.c (mono_object_get_size): New function to get the size of
16800         an object instance.
16801
16802         * profiler.c (simple_allocation): Use above.
16803
16804 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
16805
16806         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
16807         ves_icall_System_AppDomain_getRootDomain (as it's not required to
16808         get an appdomain by it's id and we can't assume the root's id is 0).
16809         * domain-internals.h: Change the function prototype to match.
16810         * icall.c: Change the icall table for AppDomain.
16811
16812 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
16813
16814         * locales.c (string_invariant_compare_char): Only compute
16815         GUnicodeTypes in the case where we need them.  Test for ordinality
16816         first and return if so.
16817
16818         From the commit:
16819
16820                 /*
16821                  * FIXME: here we must use the information from c1type and c2type
16822                  * to find out the proper collation, even on the InvariantCulture, the
16823                  * sorting is not done by computing the unicode values, but their
16824                  * actual sort order.
16825                  */
16826
16827 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
16828
16829         * loader.c: for P/Invoke methods, allow the "Internal" shared
16830         library name to refer to the calling process symbol namespace.
16831
16832 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
16833
16834         * Makefile.am: Add the security manager to the build.
16835         * security-manager.c|h: New. Initialization of the security manager.
16836
16837 2005-01-07  Dick Porter  <dick@ximian.com>
16838
16839         * threads.c: 
16840         * monitor.c: Update thread state during Monitor and WaitHandle
16841         waits.  Fixes bug 71031.
16842
16843 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
16844
16845         * reflection.c (property_encode_signature): Correctly handle when the
16846         property has no methods.
16847
16848 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
16849
16850         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
16851         
16852         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
16853         fields from mb, not rmb. Fixes #71017.
16854
16855         * marshal.c (emit_ptr_to_str_conv): Add support for 
16856         ByValTStr -> string conversion. Fixes #71015.
16857
16858         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
16859
16860         * mempool.c (mono_mempool_contains_addr): New helper function.
16861
16862 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
16863
16864         * metadata.c (mono_metadata_compute_size): Fix size calculation of
16865         HasSematics encoded fields.
16866         
16867         * metadata.c (mono_type_to_unmanaged): Improve error message for 
16868         invalid string marshalling.
16869
16870         * metadata.c: Fix warnings.
16871         
16872 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
16873
16874         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
16875         profiler support.
16876
16877 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
16878
16879         * domain.c object.c domain-internals.h: Revert part of r38077 since the
16880         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
16881         tests.
16882
16883 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
16884
16885         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
16886         so methods containing these can be AOTed.
16887
16888 2005-01-03  Martin Baulig  <martin@ximian.com>
16889
16890         * loader.c (find_method): Removed the hack for generic instances.
16891         (method_from_memberref): If our parent is a generic instance, pass
16892         its generic type definition to find_method() and then inflate the
16893         method.
16894         (mono_get_method_constrained): Pass the generic type definition to
16895         find_method() and inflate the method later.
16896
16897         * class-internals.h (MonoStats): Added `generic_class_count'.
16898
16899         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
16900         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
16901
16902         * reflection.c (mono_custom_attrs_from_params): Don't ignore
16903         generic type definitions.
16904
16905 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
16906
16907         * loader.c icall.c: Fix warnings.
16908
16909 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
16910
16911         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
16912         blittable types. Fixes #70864.
16913
16914 2004-12-29  Martin Baulig  <martin@ximian.com>
16915
16916         * icall.c
16917         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
16918
16919         * reflection.c (mono_method_get_object): Create a
16920         "System.Reflection.MonoGenericMethod" for inflated methods; don't
16921         call mono_get_inflated_method().
16922
16923         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
16924
16925 2004-12-27  Martin Baulig  <martin@ximian.com>
16926
16927         * class-internals.h (MonoMethod): Added `is_inflated' flag.
16928         (MonoMethodInflated): Added `inflated' field.
16929
16930         * class.c (mono_class_inflate_generic_method): Don't really
16931         inflate the method here; just set the `is_inflated' flag in the
16932         MonoMethod.
16933         (mono_class_get_inflated_method): Actually inflate the method here
16934         if it's not already inflated; we use the MonoMethodInflated's new
16935         `inflated' field as a cache.
16936
16937 2004-12-26  Martin Baulig  <martin@ximian.com>
16938
16939         * class.c
16940         (inflate_generic_class): Moved some code out of inflate_generic_type().
16941         (mono_class_inflate_generic_method): If we're already inflated,
16942         inflate the context and use the declaring method; ie. make sure
16943         the declaring method of an inflated method is always the generic
16944         method definition.
16945         (mono_class_create_from_typedef): Create
16946         `class->generic_container->context->gclass'.
16947
16948 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
16949
16950         * metadata-internals.h, marshal.c, reflection.c: More
16951         MonoGHashTable->GHashTable.
16952
16953         * domain-internals.h, class.c: Change MonoGHashTable's into
16954         GHashTables for some cases where no gc stuff is used
16955
16956         All users: update apis
16957
16958 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
16959
16960         * metadata.c (builtin_types): Make this `const'. Makes this get
16961         put into the shareable section.
16962         (mono_metadata_init): Casts to make gcc happy.
16963
16964 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
16965
16966         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
16967
16968 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
16969
16970         * icall.c: Added an internal call to retrieve the position and length
16971         of assembly-level declarative security attributes (RequestMinimum, 
16972         RequestOptional and RequestRefuse). This is used by the Assembly class
16973         to re-create the corresponding permission sets.
16974
16975 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
16976
16977         * marshal.c: fix the stelemref wrapper to be type correct
16978         (and faster).
16979
16980 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
16981
16982         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
16983         to do key & 0x7fffffff. Hashtable already does this. It just
16984         results in longer code.
16985
16986 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
16987
16988         * appdomain.c: Bump corlib version.
16989         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
16990         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
16991         * reflection.c|h: Add functions to get declarative security infos
16992         (blob position and length) for assemblies, classes and methods.
16993
16994 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
16995
16996         * reflection.c: sort the constant table (bug #70693).
16997
16998 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
16999
17000         * object-internals.h, threads.c, domain.c: add accessors for
17001         the MonoThread and MonoDomain tls keys.
17002
17003 2004-12-18  Martin Baulig  <martin@ximian.com>
17004
17005         * class.c (inflate_generic_type): If we're inflating a generic
17006         instance, set `ngclass->context->container = context->container';
17007         ie. the container we inflated into.
17008
17009         * metadata.c (mono_metadata_parse_generic_param): Reflect above
17010         inflate_generic_type() changes.
17011
17012 2004-12-17  Martin Baulig  <martin@ximian.com>
17013
17014         * class-internals.h
17015         (MonoGenericClass): Replaced `MonoType *generic_type' with
17016         `MonoClass *generic_class'.  Removed `dynamic_info'; if
17017         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
17018         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
17019
17020 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
17021
17022         * exception.c (mono_exception_from_token): New helper function.
17023
17024 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
17025
17026         * assembly.c (mono_assembly_load_with_partial_name): Call 
17027         mono_assembly_loaded before invoking the preload hooks. Fixes
17028         #70564.
17029
17030         * object-internals.h (MonoThread): Change culture_info and 
17031         ui_culture_info into an array.
17032
17033         * threads.c: Cache culture info objects from more than one appdomain.
17034
17035         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
17036         current UI culture.
17037
17038 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
17039
17040         * threads.h threads.c appdomain.c: Clear the culture_info field of
17041         all threads during unloading if they point to an object in the dying
17042         appdomain.
17043
17044 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
17045
17046         * culture-info.h (TextInfoEntry): New struct
17047         * object-internals.h: sync with managed
17048         * locales.c: fill the `text_info_data' field
17049         * culture-info-tables.h: update
17050
17051 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
17052
17053         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
17054         collector.
17055
17056 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
17057
17058         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
17059         (ves_icall_ModuleBuilder_getMethodToken): Ditto
17060
17061 2004-12-12  Martin Baulig  <martin@ximian.com>
17062
17063         * mono-debug-debugger.c (write_type): If we're an enum and the
17064         builtin types have already been initialized, call mono_class_init().
17065
17066 2004-12-11  Martin Baulig  <martin@ximian.com>
17067
17068         * metadata.c (mono_metadata_load_generic_params): Added
17069         `MonoGenericContainer *parent_container' argument; automatically
17070         compute `container->is_method'; pass the correct owner to
17071         get_constraints().      
17072
17073         * reflection.c (compare_genericparam): Sort the GenericParam table
17074         according to increasing owners. 
17075
17076 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
17077
17078         * profiler.c: allow disabling the default profiler.
17079
17080 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
17081
17082         * decimal.c, icall.c: allow disabling System.Decimal support.
17083
17084 2004-12-09  Marek Safar <marek.safar@seznam.cz>
17085
17086         * reflection.c: Add support for null attribute arguments.
17087
17088 2004-12-09  Martin Baulig  <martin@ximian.com>
17089
17090         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
17091         names to get rid of compiler warnings.
17092
17093 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
17094
17095         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
17096         mono_marshal_load_type_info (). Fixes #69625.
17097         (mono_marshal_get_ptr_to_struct): Likewise.
17098
17099 2004-12-08  Martin Baulig  <martin@ximian.com>
17100
17101         * mono-debug.h: Bumped version number to 47.
17102
17103         * mono-debug-debugger.c
17104         (mono_debugger_event_handler, mono_debugger_event): Take two
17105         guint64 arguments insteed of a gpointer and a guint32.  
17106
17107 2004-12-08  Martin Baulig  <martin@ximian.com>
17108
17109         * debug-mono-symfile.h
17110         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
17111         `address' to `native_offset'.
17112
17113 2004-12-08  Martin Baulig  <martin@ximian.com>
17114
17115         * class.c (mono_class_create_from_typespec): Only inflate if we
17116         either have `context->gclass' or `context->gmethod'.
17117
17118 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
17119
17120         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
17121
17122         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
17123
17124         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
17125
17126         * reflection.c (mono_assembly_get_object): Remove the workaround put
17127         in for the release.
17128         
17129         * appdomain.c: Use the corlib_internal field from MonoAssembly.
17130
17131         * appdomain.c: Bump corlib version.
17132
17133         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
17134         be visible in other appdomains.
17135
17136 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
17137
17138         * threads.c: Interlocked inc and dec for longs were messed up,
17139         use a KISS based impl for this. Fixes 70234
17140
17141 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
17142
17143         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
17144
17145 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
17146
17147         * icall.c: fix to follow policy not to allow struct
17148         arguments in icalls.
17149
17150 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17151
17152         * process.c: make the patch that handles spaces in file paths work
17153         on mono/windows too.
17154
17155 2004-12-06  Martin Baulig  <martin@ximian.com>
17156
17157         * class.c (mono_class_create_generic): Call
17158         mono_class_setup_supertypes() if we're dynamic.
17159         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
17160
17161 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
17162
17163         * object-internals.h: Add new fields to MonoThread.
17164
17165         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
17166
17167         * icall.c threads-types.h threads.c: Add new icalls.
17168
17169         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
17170
17171         * object-internals.h (MonoReflectionAssembly): Sync object layout with
17172         managed side.
17173
17174         * appdomain.c: Bump corlib version.
17175
17176         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
17177         internal assemblies. Fixes #69181.
17178
17179 2004-12-05  Martin Baulig  <martin@ximian.com>
17180
17181         * class.c (mono_class_inflate_generic_signature): Make this a
17182         no-op if `context' is NULL or we don't have any type parameters;
17183         also copy `sentinelpos'.        
17184
17185 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
17186
17187         * image.c: Add unbox_wrapper_cache.
17188
17189         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
17190
17191         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
17192         function generator.
17193         
17194         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
17195         Fixes #70173.
17196
17197         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
17198         
17199 2004-12-04  Martin Baulig  <martin@ximian.com>
17200
17201         * loader.c (mono_method_get_signature_full): New public function;
17202         like mono_method_get_signature(), but with an additional
17203         `MonoGenericContext *' argument.
17204
17205         * class.c (mono_class_inflate_generic_signature): Formerly known
17206         as inflate_generic_signature(); make this public.
17207
17208 2004-12-04  Martin Baulig  <martin@ximian.com>
17209
17210         * metadata.c
17211         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
17212         instead of a `MonoGenericContainer *'.  
17213         (mono_metadata_parse_array_full): Likewise.
17214         (mono_metadata_parse_signature_full): Likewise.
17215         (mono_metadata_parse_method_signature_full): Likewise.
17216         (mono_metadata_parse_generic_inst): Likewise.
17217         (mono_metadata_parse_generic_param): Likewise.
17218         (mono_metadata_parse_mh_full): Likewise.
17219         (mono_type_create_from_typespec_full): Likewise.
17220
17221 2004-12-03  Martin Baulig  <martin@ximian.com>
17222
17223         * class-internals.h (MonoGenericContainer): Replaced the
17224         `MonoGenericContext * pointer with a `MonoGenericContext'
17225         structure and made it the first element.
17226
17227 2004-12-03  Martin Baulig  <martin@ximian.com>
17228
17229         * class.c
17230         (inflate_generic_type): Set the `context->container' when creating
17231         a new MonoGenericContext.
17232         (mono_class_inflate_generic_method): Likewise.
17233         (mono_class_create_from_typespec): Just use `context->container'
17234         to get the container.
17235
17236         * loader.c (method_from_methodspec): Set `context->parent' from
17237         `context->container' - and if that's a method container, use its
17238         parent.  Also set the `context->container' when creating a new
17239         MonoGenericContext.
17240         (mono_get_method_from_token): Use just `context->container' to get
17241         the container.
17242
17243         * metadata.c (do_mono_metadata_parse_generic_class): Also set
17244         `gclass->context->container'.
17245
17246         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
17247         the `context->container' when creating a new MonoGenericContext.
17248
17249 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
17250
17251         * reflection.c (compare_genericparam): Sort params with identical
17252         owner by their number. Fixes gen-111 on sparc.
17253
17254 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
17255
17256         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
17257         around the domain changes.
17258
17259         * appdomain.c (mono_domain_unload): Handle the case when the thread
17260         calling Unload is itself being aborted during unloading. Fixes #70022.
17261
17262         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
17263
17264         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
17265         checkpoint_func as an icall so it gets a wrapper.
17266         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
17267         in the cross-appdomain wrappers too.
17268
17269         * threads.c (mono_thread_has_appdomain_ref): Make this public.
17270
17271         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
17272
17273         * reflection.c: Fix some memory leaks.
17274         
17275 2004-12-02  Martin Baulig  <martin@ximian.com>
17276
17277         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
17278
17279         * metadata.c (generic_class_cache): New static hashtable.
17280         (mono_metadata_lookup_generic_class): New public method.
17281
17282 2004-12-02  Martin Baulig  <martin@ximian.com>
17283
17284         * class.c (mono_class_create_from_typedef): Call
17285         mono_class_setup_parent() and mono_class_create_mono_type() before
17286         parsing the interfaces.
17287
17288 2004-12-02  Martin Baulig  <martin@ximian.com>
17289
17290         * metadata.c (generic_inst_cache): New static hashtable.
17291         (mono_metadata_lookup_generic_inst): New public function.
17292         (mono_metadata_inflate_generic_inst): New public function.
17293         (mono_metadata_parse_generic_inst): New public function.
17294         (do_mono_metadata_parse_generic_class): Use the new
17295         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
17296         since this'll also use the cache.
17297
17298         * reflection.c (mono_reflection_bind_generic_method_parameters):
17299         Use mono_metadata_lookup_generic_inst() to use the new cache.
17300
17301         * class.c (inflate_mono_type): Use
17302         mono_metadata_inflate_generic_inst() to inflate a generic
17303         instance; this'll also use the new cache.
17304
17305         * loader.c (method_from_methodspec): Use
17306         mono_metadata_parse_generic_inst() and
17307         mono_metadata_inflate_generic_inst() rather than parsing it
17308         manually, so we can use the new cache.
17309
17310 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
17311
17312         * threads.c (wait_for_tids): Do not incorrectly free threads when 
17313         the wait times out.
17314
17315 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
17316
17317         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
17318         iter->args based on whether parameters are passed in registers (i.e.
17319         MONO_ARCH_REGPARMS is defined)
17320
17321 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
17322
17323         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
17324         the exception message. Fixes #70070.
17325         (method_from_methodspec): Fix warnings.
17326
17327 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17328
17329         * process.c: (complete_path) return the path quoted
17330
17331 2004-12-01  Martin Baulig  <martin@ximian.com>
17332
17333         * class-internals.h (MonoGenericInst): New structure.
17334         (MonoGenericClass): Replaced `type_argc', `type_argv' and
17335         `is_open' with `MonoGenericInst *inst'.
17336         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
17337         `is_open' with `MonoGenericInst *inst'.
17338
17339 2004-11-30  Martin Baulig  <martin@ximian.com>
17340
17341         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
17342
17343         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
17344         to `generic_class_cache'.
17345
17346         * metadata.c
17347         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
17348         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
17349         (mono_generic_inst_is_valuetype): Renamed to
17350         mono_generic_class_is_valuetype().
17351
17352         * class-internals.h
17353         (MonoGenericInst): Renamed to MonoGenericClass.
17354         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
17355         (MonoClass): Renamed `generic_inst' to `generic_class'.
17356         (MonoGenericContext): Renamed `ginst' to `gclass'.
17357
17358         * object-internals.h
17359         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
17360
17361         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
17362         mono_reflection_generic_class_initialize().
17363
17364         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
17365         now known as "System.Reflection.MonoGenericClass".
17366         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
17367
17368 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
17369
17370         * class-internals.h: Added a flag field to MonoClass to cache the
17371         declarative security attributes actions associated with the class.
17372         * domain-internals.h: Added booleans to MonoJitInfo to cache the
17373         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
17374         applicable to the JITted method.
17375         * reflection.c|h: Added functions to extract (as flags) which security
17376         actions are available (declaratively) for a method, class or assembly.
17377         * metadata.c|h: Added functions to search the declarative security
17378         table in the metadata.
17379         
17380 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
17381
17382         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
17383         EXPORTEDTYPES are already in the class name cache, so there is no
17384         need to add extra code here to look at them. Just removes a bit of
17385         cruft.
17386
17387         (ves_icall_System_Environment_get_TickCount): No need for #if
17388         WINDOWS. We already have the code in io-layer.
17389
17390 2004-11-28  Martin Baulig  <martin@ximian.com>
17391
17392         * loader.c
17393         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
17394         Fixes gen-112.cs.
17395
17396 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
17397
17398         * assembly.c (do_mono_assembly_open): Instead of having a
17399         conditional WITH_BUNDLE, incorporate support for bundles here, by
17400         having a global `bundles' variable holding a pointer to the actual
17401         bundles. 
17402
17403         (mono_register_bundled_assemblies): New API call used by the
17404         bundle code. 
17405
17406         See mkbundle.1 for details.
17407         
17408 2004-11-27  Martin Baulig  <martin@ximian.com>
17409
17410         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
17411         the vtable for generic methods.
17412
17413 2004-11-26  Martin Baulig  <martin@ximian.com>
17414
17415         * metadata.c
17416         (mono_metadata_generic_method_hash): New public function.
17417         (mono_metadata_generic_method_equal): Likewise.
17418
17419         * class-internals.h
17420         (MonoGenericContainer): Added `GHashTable *method_hash'.
17421
17422         * reflection.c (ReflectionMethodBuilder): Added
17423         `MonoGenericContainer *generic_container'.
17424         (reflection_methodbuilder_to_mono_method): Don't create a new
17425         MonoGenericContainer each time we're called.
17426         (mono_reflection_bind_generic_method_parameters): Use
17427         `container->method_hash' to cache the results so we don't create a
17428         different method if we're called several times with the same
17429         arguments.
17430
17431         * loader.c (method_from_methodspec): Use the new
17432         `container->method_hash' here, too.
17433
17434 2004-11-26  Martin Baulig  <martin@ximian.com>
17435
17436         * class.c (inflate_generic_signature): Correctly compute
17437         `res->has_type_parameters'.
17438         (mono_class_vtable): Use the `has_type_parameters' flag to
17439         determine whether we're a generic method.
17440
17441         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
17442
17443 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
17444
17445         * object.c (mono_runtime_run_main): Fix a small memory leak.
17446
17447 2004-11-25  Martin Baulig  <martin@ximian.com>
17448
17449         * class.c (set_generic_param_owner): Fixed the loop.
17450
17451 2004-11-25  Martin Baulig  <martin@ximian.com>
17452
17453         * object.c (mono_class_vtable): Don't create any JIT wrappers for
17454         generic methods.
17455
17456 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
17457
17458         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
17459         names. Fixes #69787.
17460
17461 2004-11-24  Martin Baulig  <martin@ximian.com>
17462
17463         * class.c (mono_class_create_generic_2): If we don't have a
17464         `ginst->parent', inflate `gklass->parent' to get our parent.
17465
17466 2004-11-24  Martin Baulig  <martin@ximian.com>
17467
17468         * reflection.c (compare_genericparam): Correctly sort the
17469         GenericParam table; fixes #69779.
17470
17471 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
17472
17473         * reflection.c: When writing a PE file, don't create a huge
17474         buffer in memory. Just write the arrays we have to the file.
17475         This reduces memory usage.
17476
17477         * metadata-internals.h: MonoDynamicStream pefile is no longer used
17478         globally.
17479
17480 2004-11-17  Martin Baulig  <martin@ximian.com>
17481
17482         * class.c (mono_class_init): Don't setup `class->parent' for
17483         dynamic instances; moved this to mono_class_generic_2().
17484         (mono_class_create_generic): Also set `klass->inited' for dynamic
17485         generic instances.
17486         (mono_class_create_generic_2): Don't do anything for dynamic
17487         generic instances.  Set `klass->parent' here and also call
17488         mono_class_setup_parent() here. 
17489
17490         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
17491         `MonoType *parent' argument; set `ginst->parent' before calling
17492         mono_class_create_generic_2(), so we set the correct parent.
17493
17494 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
17495
17496         * reflection.c: allow getting attributes from ModuleBuilder
17497         (used by ikvm).
17498
17499 2004-11-17  Martin Baulig  <martin@ximian.com>
17500
17501         * class.c (mono_class_create_from_typedef): If a type parameter is
17502         inherited from an outer class, set its owner to that class.
17503
17504 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
17505
17506         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
17507           for (int*) written size. This fixes bug #69592.
17508
17509 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
17510
17511         * icall.c: Added IsAuthenticodePresnet internal call.
17512         * image.c|h: New function that check a MonoImage for an Authenticode
17513         signature in the certificate PE data directory.
17514         * security.c|h: New internal call to ask the runtime if an 
17515         Authenticode signature seems referenced in the PE header.
17516
17517 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
17518
17519         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
17520
17521         * reflection.c (mono_image_create_pefile): Free the assembly streams
17522         after writing out the assembly file.
17523
17524         * object.c (mono_runtime_run_main): Fix small memory leak.
17525
17526         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
17527         property access modifiers. Fixes #69389.
17528
17529 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
17530
17531         * domain.c, object.c, object-internals.h, domain-internals.h,
17532         object.h, marshal.c: keep dynamic code info per domain.
17533
17534 2004-11-15  Martin Baulig  <martin@ximian.com>
17535
17536         * class.c (mono_type_get_name_recurse): Put type arguments in
17537         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
17538         see bug #68387.
17539
17540 2004-11-15  Martin Baulig  <martin@ximian.com>
17541
17542         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
17543         (mono_class_setup_vtable): When computing `the_cname' for a
17544         generic instance, don't include the namespace since we'd otherwise
17545         add it twice.
17546
17547 2004-11-15  Martin Baulig  <martin@ximian.com>
17548
17549         * class.c (mono_class_create_generic): Changed return type to void.
17550         (mono_class_create_generic_2): New public function; setup
17551         `class->method', `class->field' and `class->interfaces' here
17552         instead of in mono_class_init().
17553
17554         * class.h (mono_class_create_generic): Moved to class-internals.h.
17555
17556 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
17557
17558         * reflection.c (mono_image_create_pefile): take a file HANDLE.
17559         rather than writing to memory, write to this file. Right now,
17560         we are just writting into a buffer, and copying that. However
17561         we can avoid the buffer later.
17562
17563         (mono_dynamic_stream_reset): new function
17564
17565         * icall.c, object-internals.h: update for the above.
17566
17567 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
17568
17569         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
17570         have been using gc'd memory. First it is slower, unlikely
17571         the comment in the source code said, secondly, it increases
17572         our footprint to do it in the gc.
17573
17574         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
17575         the method so that it does not have to copy to managed code.
17576
17577 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
17578
17579         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
17580
17581 2004-11-12  Martin Baulig  <martin@localhost>
17582
17583         * reflection.c (mono_image_create_token): Allow generic method
17584         definitions here, since they may appear in an `.override'; see
17585         gen-98/gen-99 for an example.
17586
17587 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
17588
17589         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
17590         #69365.
17591
17592         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
17593         descriptive.
17594
17595 2004-11-11  Martin Baulig  <martin@ximian.com>
17596
17597         * class.c (mono_class_setup_vtable): In an explicit interface
17598         implementation, the method name now includes the arity.
17599
17600 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
17601
17602         * object.c (mono_array_full_copy): Fix warning.
17603
17604 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
17605
17606         * appdomain.c: Removed look_for_method_by_name(). Use the new method
17607         mono_class_get_method_from_name() instead.
17608         
17609         * class-internals.h: Added two new types of wrappers. 
17610         Added MonoRemotingTarget enum. Added new trampoline function type, which
17611         takes an additional MonoRemotingTarget value as parameter, so it is
17612         possible to request a trampoline for a specific target.
17613         
17614         * class.c: Added new mono_class_get_method_from_name() method.
17615         
17616         * class.h: In MonoRemoteClass, we can have now to vtables, one for
17617         general remoting sinks and one specific for cross domain calls.
17618         
17619         * debug-helpers.c: Added new wrapper names.
17620         
17621         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
17622         of a remote class.
17623         
17624         * image.c: Porperly delete value objects form the remoting invoke hashtable.
17625         
17626         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
17627         with several other methods (mono_marshal_get_xappdomain_dispatch,
17628         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
17629         and others) can generate a fast remoting wrapper for cross domain calls.
17630         More information can be found in docs/remoting.
17631         Other changes: Removed mono_find_method_by_name, and used
17632         mono_class_get_method_from_name instead.
17633         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
17634         is stored in the remoting invoke hashtable.
17635         
17636         * marshal.h: published the new method for getting the xdomain wrapper,
17637         and also added a method for getting the adequate wrapper for a given
17638         method and target.
17639         
17640         * object-internals.h, object.c: Added a couple of methods for capying and
17641         cloning arrays.
17642         Modified mono_install_remoting_trampoline, which takes the new remoting
17643         trampoline that has a remoting target as parameter.
17644         mono_class_proxy_vtable now also takes a remoting target as parameter, and
17645         will return the most suitable vtable for the target.
17646         Added mono_remote_class_vtable, which returns the vtable of a remote class
17647         (which can be the normal remoting vtable or the xdomain vtable).
17648         
17649         * threads.c: the xdomain invoke and dispatch wrappers must also be
17650         protected against interruptions.
17651
17652 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17653
17654         * icall.c: use memmove in BlockCopyInternal when the source and
17655         destination arrays are the same.
17656
17657 2004-11-09  Martin Baulig  <martin@ximian.com>
17658
17659         * class-internals.h (MonoGenericContainer): Removed `method' and
17660         `signature', replaced them with `is_method' and `is_signature'
17661         flags.  Added `context'.
17662
17663         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
17664         instead of a `MonoGenericContainer *'.
17665
17666         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
17667         for dynamic type parameters.
17668         (mono_metadata_load_generic_params): Setup `container->context'.
17669
17670         * reflection.c (mono_reflection_setup_generic_class): Setup
17671         `tb->generic_container->context'.
17672         (do_mono_reflection_bind_generic_parameters): Use
17673         mono_class_inflate_generic_type() to correctly inflate types,
17674         rather than using our own hack just for MONO_TYPE_VAR.
17675
17676 2004-11-09  Martin Baulig  <martin@ximian.com>
17677
17678         * class.c (mono_class_inflate_generic_method): Small fix; don't
17679         crash here.
17680
17681         * icall.c
17682         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
17683         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
17684         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
17685         (ves_icall_Type_BindGenericParameters): Likewise.
17686         (ves_icall_Type_get_IsGenericInstance): Likewise.
17687         (ves_icall_Type_GetGenericParameterPosition): Likewise.
17688         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
17689         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
17690         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
17691
17692 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
17693
17694         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
17695         assembly versions and public key tokens. Fixes #69113.
17696
17697 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
17698
17699         * metadata.c: fix bug introduced with the type cache changes
17700         on 2004-11-06.
17701
17702 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
17703
17704         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
17705         the MonoClass pointer instead of the token in exception clauses.
17706         * reflection.c: updates for the above and make the code not depend
17707         on the structure of MonoExceptionClause.
17708
17709 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
17710
17711         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
17712         Add support for dynamic assemblies. Fixes #69114.
17713
17714         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
17715
17716 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
17717
17718         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
17719         since most only those methods use it. the code member of
17720         MonoMethodPInvoke was dead, so that can be removed too. Also,
17721         remove inline_count (again, not used), and move slot so that it
17722         can share bits with some other flags. This saves 8 bytes in the
17723         structure and gives us about 50 kb back for mcs helloworld.cs
17724
17725         * *.[ch]: Do naming changes for the above.
17726
17727         * loader.c (mono_method_get_header): Lazily init the header
17728         on first access.
17729         (mono_get_method_from_token): don't init the header here
17730         (mono_free_method): the header may never be allocated
17731
17732         Overall, this saves 150 kb of unmanaged allocations
17733         for mcs helloworld.cs. That accounts for 10% of the unmanaged
17734         memory at runtime.
17735         
17736         * loader.c, loader.h (mono_method_get_header): new accessor.
17737
17738         * *.[ch]: use the above method. Prepares us to lazily load
17739         the header.
17740
17741         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
17742         three warnings, which are actual bugs (see 69206).
17743
17744         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
17745         unused. Saves a cool 4 bytes / method.
17746
17747 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
17748
17749         * metadata.c (builtin_types): Add types for System.Object here.
17750         (mono_metadata_parse_type_full): Cache MonoType*'s that are
17751         for a class or valuetype from klass->this_arg or klass->byval_arg.
17752
17753         On mcs for a hello world, this gets us down from 21836 MonoType's
17754         to 14560.
17755
17756         (mono_metadata_free_type): Account for the above change.
17757
17758 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
17759
17760         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
17761         exception instead of asserting if name is null.
17762         (ves_icall_System_AppDomain_GetData): Ditto.
17763
17764 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
17765
17766         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
17767         EnumBuilder.
17768
17769         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
17770         Return NULL when the domain does not have entry_assembly set.
17771
17772         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
17773         Add a 'resource_modules' argument.
17774         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
17775
17776         * reflection.c (mono_reflection_create_runtime_class): Move setting
17777         of wastypebuilder here, so mono_get_type_object () returns a MonoType
17778         for enums too.
17779
17780         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
17781         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
17782         Throw an ArgumentNullException if 'ptr' is null.
17783
17784         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
17785         assemblies here. Fixes #69020.
17786
17787 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
17788
17789         * reflection.c (build_compressed_metadata): Fix the previous patch for
17790         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
17791         the stack.
17792
17793 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
17794
17795         * assembly.c (mono_assembly_names_equal): Allow a match if one of
17796         the cultures is false. Fixes #69090.
17797
17798         * reflection.c (build_compressed_metadata): Fix invalid memory read 
17799         detected by valgrind.
17800         
17801         * reflection.c (mono_reflection_get_type): Avoid triggering a 
17802         TypeResolve multiple times for the same type. Fixes #65577.
17803
17804 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
17805
17806         * marshal.c: Avoid using ldftn to call managed functions. It is
17807         much slower than just a call.
17808
17809         * reflection.c (mono_module_get_object): free the basename we
17810         allocate here from glib.
17811         
17812         * reflection.c (ensure_runtime_vtable): make sure to free
17813         overrides.  Also, we were allocating an array of MonoMethod not an
17814         array of MonoMethod*.
17815
17816         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
17817
17818         * image.c (mono_image_close): free image->guid here.
17819
17820 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
17821
17822         * reflection.c: Fix some spec conformance issues with the PE file
17823         structures so mcs compiled apps run on the Net 2.0 beta.
17824
17825 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
17826
17827         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
17828         Implement this. Fixes #67264.
17829
17830         * debug-helpers.h debug-helpers.c marshal.c: Move 
17831         mono_find_method_by_name to debug-helpers.c.
17832
17833 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
17834
17835         * object.c (mono_release_type_locks): type_initialization_hash is
17836         a GHashTable.
17837
17838         * reflection.c object.c object-internals.h: Fix warnings.
17839
17840         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
17841         without accessors. Fixes #61561.
17842
17843         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
17844         application base from the root domain if not set. Fixes #65641.
17845         (mono_runtime_init): Fix warning.
17846
17847 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17848
17849         * appdomain.c: call mono_thread_pool_init.
17850         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
17851         of worker threads based on the number of CPUs and the environment
17852         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
17853         for non-windows (windows) systems.
17854
17855 2004-10-27  Chris Toshok  <toshok@ximian.com>
17856
17857         * mono-debug-debugger.c (write_class): don't call mono_class_init
17858         here, as even with the check for (!klass->init_pending), we get
17859         into a situation where we're hitting cycles in class
17860         initialization.  Fixes #68816.
17861
17862 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
17863
17864         * image.c: Avoid overwriting values in the loaded_images_hash when an
17865         assembly is loaded multiple times. Fixes #61152.
17866
17867         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
17868         so multiple satellite assemblies for the same name can be loaded.
17869         Fixes #68259.
17870
17871         * mono_domain_assembly_preload: Actually return the loaded assembly, 
17872         not NULL.
17873
17874         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
17875         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
17876
17877         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
17878         pending finalizers are not invoked after the appdomain has been 
17879         unloaded. Fixes #67862.
17880
17881 2004-10-22  Martin Baulig  <martin@ximian.com>
17882
17883         * mono-debug-debugger.c
17884         (mono_debugger_runtime_invoke): Don't box valuetypes.
17885
17886 2004-10-22  Chris Toshok  <toshok@ximian.com>
17887
17888         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
17889         don't hide private methods.
17890
17891 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
17892
17893         * icall.c: Allows the runtime to "share" (when known) the public key
17894         token of an assembly. This avoid the need to recalculate the token 
17895         (from the public key) in managed code.
17896
17897 2004-10-21  Chris Toshok  <toshok@ximian.com>
17898
17899         * debug-helpers.c (append_class_name): argh, revert last patch.
17900         
17901 2004-10-21  Chris Toshok  <toshok@ximian.com>
17902
17903         * debug-helpers.c (append_class_name): use '+' as the delimiter,
17904         not '/', so that it matches what the debugger uses to look up
17905         methods.
17906
17907 2004-10-21  Martin Baulig  <martin@ximian.com>
17908
17909         * mono-debug-debugger.c (mono_debugger_throw_exception): New
17910         public method; this is called each time an exception is thrown and
17911         allows the debugger to use exception catch points.
17912
17913 2004-10-21  Martin Baulig  <martin@ximian.com>
17914
17915         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
17916         the stack pointer and the exception object in some struct and pass
17917         that to the debugger.
17918
17919 2004-10-21  Chris Toshok  <toshok@ximian.com>
17920
17921         * mono-debug-debugger.c (do_write_class): add instance/static
17922         event support.  We don't expose "raise" or "other" yet.
17923         (event_is_static): new method.
17924
17925 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
17926
17927         * mono-debug-debugger.c
17928         (mono_debugger_handle_exception): Remove
17929         bogus return value for fussy compilers.
17930
17931 2004-10-20  Martin Baulig  <martin@ximian.com>
17932
17933         * mono-debug-debugger.c
17934         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
17935         (mono_debugger_handled_exception): Likewise.
17936
17937 2004-10-20  Martin Baulig  <martin@ximian.com>
17938
17939         * mono-debug-debugger.h (MonoDebuggerEvent): Added
17940         MONO_DEBUGGER_EVENT_EXCEPTION.
17941
17942         * mono-debug-debugger.c (mono_debugger_handle_exception): New
17943         public function to send the debugger a notification for an
17944         exception and inform it about a catch/finally clause.
17945
17946 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
17947
17948         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
17949         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
17950         fix 2.95 build. 
17951
17952         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
17953
17954 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
17955
17956         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
17957         marshalled as [In,Out]. Fixes #58325.
17958
17959 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
17960
17961         * reflection.c (mono_method_body_get_object): Implement some fields.
17962
17963 2004-10-12  Martin Baulig  <martin@ximian.com>
17964
17965         * reflection.c (mono_reflection_bind_generic_parameters): Small
17966         fix, correctly retrieve our parent from a generic instance.
17967
17968 2004-10-12  Martin Baulig  <martin@ximian.com>
17969
17970         * metadata.c (mono_metadata_generic_param_equal): We always have
17971         an owner.
17972
17973         * class.c
17974         (mono_class_from_generic_parameter): We need to have an owner.
17975         (my_mono_class_from_generic_parameter): Likewise.
17976
17977         * reflection.c (mono_reflection_setup_generic_class): Renamed to
17978         mono_reflection_create_generic_class() and added a new
17979         mono_reflection_setup_generic_class().  
17980         (mono_reflection_initialize_generic_param): If we're a nested
17981         generic type and inherited from the containing class, set our
17982         owner to the outer class.
17983
17984 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
17985
17986         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
17987
17988         * reflection.c (mono_method_body_get_object): New function to create
17989         a MethodBody object.
17990
17991         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
17992
17993 2004-10-11  Martin Baulig  <martin@ximian.com>
17994
17995         * metadata.c (_mono_metadata_type_equal): Renamed to
17996         do_mono_metadata_type_equal() and made static.
17997
17998 2004-10-11  Martin Baulig  <martin@ximian.com>
17999
18000         * appdomain.c: Bump corlib version number to 28.
18001
18002 2004-10-10  Martin Baulig  <martin@ximian.com>
18003
18004         * class-internals.h
18005         (MonoGenericInst): Added `MonoGenericContainer *container'.
18006         (MonoGenericMethod): Likewise.
18007         (MonoGenericContext): Likewise.
18008         (MonoGenericParam): Added `MonoGenericContainer *owner'.
18009
18010         * metadata.c
18011         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
18012         (do_mono_metadata_parse_generic_inst): Likewise.
18013         (mono_metadata_parse_type_full): New public method.  This is the actual
18014         mono_metadata_parse_type() implementation - with an additional
18015         `MonoGenericContainer *' argument.
18016         (mono_metadata_parse_array_full): Likewise.
18017         (mono_metadata_parse_signature_full): Likewise.
18018         (mono_metadata_parse_method_signature_full): Likewise.
18019         (mono_metadata_parse_mh_full): Likewise.
18020         (mono_type_create_from_typespec): Likewise.
18021         (mono_metadata_interfaces_from_typedef_full): New public method;
18022         this is similar to the other _full() methods, but we take a
18023         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
18024         (mono_metadata_parse_generic_param): Take an additional
18025         `MonoGenericContainer *' argument and lookup the MonoGenericParam
18026         from that container.
18027         (mono_metadata_generic_param_equal): New static method to compare
18028         two type parameters.
18029         (_mono_metadata_type_equal): New static method; takes an
18030         additional `gboolean signature_only' argument - if true, we don't
18031         compare the owners of generic parameters.
18032         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
18033         with a TRUE argument - do a signature-only comparision.
18034
18035         * loader.c: Use the new _full() methods and pass the
18036         MonoGenericContainer to them.
18037
18038         * object-internals.h (MonoReflectionTypeBuilder): Added
18039         `MonoGenericContainer *generic_container' field.
18040         (MonoReflectionMethodBuilder): Likewise.
18041
18042 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
18043
18044         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
18045         case initial images of dynamic assemblies.
18046
18047         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
18048
18049         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
18050
18051         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
18052         length of event->other array.
18053         (typebuilder_setup_events): Ditto.
18054
18055         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
18056         'assembly_by_name' and add an 'assemblies' list.
18057
18058         * assembly.h assembly.c: Add a new search hook for determining whenever
18059         an assembly is already loaded. Use this instead of searching in the
18060         loaded_assemblies list.
18061
18062         * domain.c appdomain.c: Implement the new search hook so loaded 
18063         assemblies are now scoped by appdomain. Fixes #67727.
18064
18065 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
18066
18067         * threads.c (mono_thread_attach): Initialize synch_lock field so
18068         mono_thread_detach works again.
18069
18070         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
18071         'lib' too. Fixes #63130.
18072
18073 2004-10-06  Jackson Harper  <jackson@ximian.com>
18074
18075         * culture-info-tables.h: regenerated.
18076
18077 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
18078
18079         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
18080         implemented by other interfaces in the result. Fixes #65764.
18081         
18082         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
18083         Handle unloadable modules without crashing.
18084
18085         * image.c (load_modules): Revert the previous patch since modules must
18086         have a fixed index inside the array.
18087         
18088         * image.c (load_modules): Don't include native modules in the modules
18089         array.
18090
18091 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
18092
18093         * reflection.h: Add param_defaults field.
18094
18095         * reflection.c: Add support for parameter defaults in dynamic methods.
18096         Fixes #64595.
18097
18098         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
18099         an empty string when a type has no namespace. Fixes #64230.
18100
18101 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
18102
18103         * tabledefs.h: Added "internal" security actions to support non-CAS
18104         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
18105         Note: they do not seems to be used anymore in 2.0 (new metadata format)
18106
18107 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
18108
18109         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
18110         constructor of abstract class. Fixes #61689.
18111
18112 2004-10-04  Martin Baulig  <martin@ximian.com>
18113
18114         * class-internals.h (MonoGenericContainer): New type.
18115         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
18116         `MonoGenericContainer *generic_container'.
18117         (MonoClass): Replaced `gen_params' and `num_gen_params' with
18118         `MonoGenericContainer *generic_container'.
18119
18120         * metadata.c (mono_metadata_load_generic_params): Return a
18121         `MonoGenericContainer *' instead of a `MonoGenericParam *';
18122         removed the `num' argument.
18123
18124 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
18125
18126         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
18127         for dynamic images.
18128
18129         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
18130         machine fields.
18131
18132         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
18133
18134         * reflection.c: Save pe_kind and machine values into the generated
18135         image file.
18136
18137         * appdomain.c: Bump corlib version number.
18138
18139         * object-internals.h: Reorganize layout of LocalBuilder.
18140
18141         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
18142         New helper function.
18143
18144         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
18145         created MonoType for dynamic types. Fixes #66180.
18146
18147 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
18148
18149         * threadpool.c: the ares hashtable needs a critical section around it.
18150         this prevents some nasty segfaults
18151
18152 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
18153
18154         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
18155         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
18156         bug 67324).
18157         
18158 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
18159
18160         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
18161         
18162 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
18163
18164         * image.c: Always canonicalize image file names, to avoid loading
18165         the same assembly twice when referenced using a relative path.
18166
18167 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
18168
18169         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
18170
18171         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
18172
18173         * marshal.c: Fix warnings.
18174
18175 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
18176
18177         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
18178         attempting to marshal the delegate_trampoline as the method_addr.
18179         This patch has a static hashtable of marshalled delegates so that 
18180         we can map delegate_trampoline addresses back to delegates.  This
18181         allows a delegate passed to managed code to be passed back into native
18182         code.  Fixes #67039
18183
18184 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
18185
18186         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
18187
18188         * reflection.c (method_encode_code): Align method headers properly.
18189         Fixes #66025.
18190
18191 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
18192
18193         * marshal.c: In the runtime invoke wrapper, reset the abort
18194         exception if it is cached. This avoids the automatic rethrowal of 
18195         the exception after the catch of the wrapper. Also check for pending
18196         interruptions before calling the managed method. This is done using
18197         the new method emit_thread_force_interrupt_checkpoint, since the
18198         normal checkpoint method is ignored when running the invoke wrapper.
18199         * object.c: If the abort exception is rethrown, set the abort_exc
18200         field of the thread, so it will be rethrown aftere every catch.
18201         * threadpool.c: Only run an interruption checkpoint if what has been
18202         requested is a stop of the thread (aborts will be ignored).
18203         * threads.c: By default, a thread will now never be interrumped while
18204         running the runtime invoke wrapper (this ensures that runtime_invoke
18205         will always return to the caller if an exception pointer is provided).
18206         There is a new special method mono_thread_force_interruption_checkpoint()
18207         to force an interruption checkpoint even if running a protected
18208         wrapper, which is used by the same runtime invoke wrapper to do a check
18209         at a safe point.
18210
18211 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
18212
18213         * object.c, object-internals.h: Implemented mono_release_type_locks,
18214         which releases the cctor locks held by a thread.
18215         * threads.c, threads.h: In thread_cleanup, release cctor locks held
18216         by a thread. Added mono_thread_exit() method to be used to safely stop
18217         a thread.
18218
18219 2004-09-28  Raja R Harinath  <rharinath@novell.com>
18220
18221         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
18222         Move null check before dereference.  Avoid indexing beyond the end
18223         of the 'modules' array.
18224
18225 2004-09-28  Raja R Harinath  <rharinath@novell.com>
18226
18227         * metadata-internals.h (MonoImage): Add module_count field.
18228         * image.c (load_modules): Set image->module_count.
18229         (mono_image_load_file_for_image): Use image->module_count.
18230         * reflection.c (mono_image_load_module): Append to image->modules array 
18231         of dynamic assembly.
18232         (mono_module_get_object): Fix loop to actually increment index.
18233         Use image->module_count.
18234         * assembly.c (mono_assembly_load_references): Use image->module_count.
18235         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
18236         Likewise.
18237
18238 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
18239
18240         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
18241         Avoid assert on generic types.
18242
18243 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
18244
18245         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
18246
18247         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
18248
18249         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
18250         function to convert a MarshalSpec structure to its managed counterpart.
18251
18252         * reflection.c: Fix warnings.
18253         
18254         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
18255         field.
18256
18257         * icall.c (mono_create_icall_signature): Fix build.
18258
18259 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
18260
18261         * icall.c: Add MakePointType icall.
18262
18263         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
18264         warnings.
18265
18266 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18267
18268         * threadpool.c: reuse allocated slots in the queue.
18269
18270 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
18271
18272         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
18273
18274         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
18275
18276         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
18277         previous change.
18278
18279         * tabledefs.h: Add constants for pinvoke attributes BestFit and
18280         ThrowOnUnmappableChar.
18281
18282         * icall.c (ves_icall_Type_GetPacking): New icall.
18283
18284 2004-09-24  Martin Baulig  <martin@ximian.com>
18285
18286         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
18287
18288 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18289
18290         * appdomain.c:
18291         (mono_domain_set): allow setting a domain that is being unloaded.
18292         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
18293         being unloaded.
18294
18295 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
18296
18297         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
18298         the GetCustomAttributes icall.
18299
18300 2004-09-23  Martin Baulig  <martin@ximian.com>
18301
18302         * object-internals.h (MonoReflectionGenericParam): Replaced
18303         'has_ctor_constraint', `has_reference_type' and `has_value_type'
18304         with `guint32 attrs'.
18305
18306 2004-09-23  Martin Baulig  <martin@ximian.com>
18307
18308         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
18309
18310 2004-09-23  Martin Baulig  <martin@ximian.com>
18311
18312         * object-internals.h (GenericParameterAttributes): New enum.
18313
18314 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
18315
18316         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
18317         
18318         * class.c (init_events): Fill out event->other field.
18319
18320         * class.c: Fix warnings.
18321
18322         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
18323
18324 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
18325
18326         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
18327         walk which doesn't supply the IL offset.
18328
18329 2004-09-22  Martin Baulig  <martin@ximian.com>
18330
18331         * reflection.c (mono_reflection_setup_internal_class): If we're
18332         System.ValueType, System.Object or System.Enum, set
18333         `klass->instance_size' and create the vtable.
18334         (mono_reflection_create_internal_class): If we're an enum type,
18335         get the base class from our current corlib.
18336
18337 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
18338
18339         * reflection.h (MonoResolveTokenError): New type.
18340
18341         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
18342         icall.
18343
18344         * icall.c: Add an 'error' argument to the ResolveToken icalls.
18345
18346 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
18347
18348         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
18349         Support also calling constructors, but only for already allocated objects.
18350
18351 2004-09-17  Geoff Norton <gnorton@customerdna.com>
18352
18353         * reflection.c (type_get_qualified_name): If the klass is null
18354         return the typename to avoid a NullRefEx.
18355         (encode_cattr_value): Get the qualified name of the boxed type,
18356         not the underlying enumtype.  Fixes #62984.
18357
18358 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
18359
18360         * marshal.c: Fix problems with previous checkin.
18361
18362 2004-09-21    <vargaz@freemail.hu>
18363
18364         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
18365         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
18366
18367         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
18368
18369 2004-09-21  Geoff Norton <gnorton@customerdna.com>
18370
18371         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
18372         should only return a type for pointers, arrays, and passbyref types.
18373         Fixes bug #63841.
18374
18375 2004-09-21  Martin Baulig  <martin@ximian.com>
18376
18377         * domain.c (mono_debugger_check_runtime_version): New public
18378         function.
18379
18380         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
18381
18382 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
18383
18384         * reflection.c: Added missing sort to the declarative security 
18385         attributes table. MS implementation stops seeing the attributes if the
18386         token number regress in the table (as shown by ildasm and permview).
18387
18388 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
18389
18390         * object-internals.h (MonoReflectionModule): Add 'token' field.
18391         
18392         * reflection.c (mono_reflection_get_token): Add support for Module
18393         and Assembly.
18394         (mono_module_get_object): Set 'token' field.
18395         (mono_module_file_get_object): Set 'token' field.
18396
18397         * icall.c: Add new Assembly and Module icalls.
18398
18399         * appdomain.c: Bump corlib version.
18400
18401 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
18402
18403         * loader.h loader.c class.h class.c: Add helper functions for obtaining
18404         tokens of metadata objects.
18405
18406         * reflection.h reflection.c (mono_reflection_get_token): New function
18407         to obtain the token of a metadata object.
18408
18409         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
18410
18411 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
18412
18413         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
18414         
18415         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
18416
18417 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
18418
18419         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
18420         * object-internals.h: Added 3 MonoArray* members to MonoReflection
18421         AssemblyBuilder to access the permissions set in the class lib.
18422         * reflection.c: Added security attributes encoding step in 
18423         mono_image_build_metadata.
18424         * tabledefs.h: Added new security actions defined in 2.0:
18425         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
18426
18427 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
18428
18429         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
18430         macro parameter.
18431
18432 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
18433  
18434         * locales.c: nullify the ICU_collator member of CompareInfo when it is
18435           finalized. There where random SIGSEVs at program termination, when
18436           an object being finalized was trying to do a string comparison and
18437           the current culture was already finalized.
18438  
18439 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18440
18441         * threads.c: call thread_cleanup before finishing the thread if we get
18442         there.
18443
18444 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
18445
18446         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
18447         assemblies from the parent. Fixes #65665.
18448
18449 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
18450
18451         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
18452         modifiers.
18453
18454 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
18455
18456         * reflection.h: add prototype for mono_get_dbnull_object
18457         * reflection.c: add prototypes for get_default_param_value_blobs 
18458         and mono_get_object_from_blob for fussier compilers
18459
18460 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
18461  
18462         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
18463         false deadlock checks in class initialization.
18464  
18465 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
18466
18467         * image.c (mono_image_addref): Fix comment.
18468
18469         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
18470         possible.
18471
18472 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
18473
18474         * reflection.c (mono_param_get_objects): Modified to return
18475         ParameterInfo.DefaultValue object.
18476
18477         (get_default_param_value_blobs):
18478         (mono_get_object_from_blob):
18479         (mono_get_dbnull_object): New helper routines. 
18480
18481         * object.c (mono_get_constant_value_from_blob): New helper routine
18482         carved out from get_default_field_value ()
18483
18484         * object-internals.h (mono_get_constant_value_from_blob): Added
18485         function declaration.
18486
18487 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
18488
18489         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
18490         referenced assemblies. Fixes #62135.
18491
18492         * exception.h exception.c (mono_get_exception_file_not_found2): New
18493         helper function.
18494
18495 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
18496
18497         * class.h class.c: Add mono_type_get_underlying_type ().
18498
18499 2004-09-09  Geoff Norton <gnorton@customerndna.com>
18500
18501         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
18502         Fix GetTypes() to support dynamically created assemblies.
18503
18504 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
18505
18506         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
18507         
18508         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
18509         previous patch.
18510
18511         * reflection.h reflection.c loader.c: Allow dynamic construction of
18512         pinvoke methods. Fixes #65571.
18513         
18514         * reflection.c (mono_reflection_get_type): Revert previous change since
18515         it causes regressions.
18516
18517 2004-09-08  Martin Baulig  <martin@ximian.com>
18518
18519         * class.c (class_compute_field_layout): Don't call
18520         mono_class_layout_fields() for open generic instances.
18521
18522 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
18523         * threads.c appdomain.c: fix typo in GC macro
18524
18525 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18526
18527         * threads.c: don't call mono_thread_detach() in start_wrapper(),
18528         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
18529
18530 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
18531
18532         * image.c (mono_image_close): Applied patch from 
18533         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
18534         assembly is loaded multiple times from data.
18535         
18536         * image.c (mono_image_open): Fix warning.
18537
18538 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
18539
18540         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
18541         once. Fixes #58334.
18542         
18543         * reflection.c (mono_reflection_create_runtime_class): Initialize
18544         klass->nested_classes. Fixes #61224.
18545
18546 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
18547
18548         * threads.c: sched_yield() on exit, to allow threads to quit.
18549
18550 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
18551
18552         * object.c (mono_unhandled_exception): Remove leftover debug code.
18553
18554 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
18555
18556         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
18557
18558 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
18559
18560         * marshal.c (emit_marshal_array): Really null terminate string arrays.
18561         
18562         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
18563
18564 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
18565
18566         * marshal.c (emit_marshal_array): Null terminate string arrays.
18567         
18568         * marshal.c (raise_auto_layout_exception): Fix warning.
18569
18570         * reflection.c (mono_param_get_objects): Initialize the default value
18571         with DBNull.Value, not null. Fixes #62123.
18572
18573 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
18574
18575         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
18576         throw an exception with a cute explanation.
18577
18578 2004-09-06  Dick Porter  <dick@ximian.com>
18579
18580         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
18581         Close the new process's thread handle, as we don't use it.  The
18582         handle stays around forever otherwise.
18583
18584 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
18585
18586         * object.c (arith_overflow): Fix warning.
18587
18588         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
18589         calling conventions in method refs. Fixes #65352.
18590
18591         * reflection.c: Fix warnings.
18592
18593 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
18594
18595         * icall.c: Add a new icall for Array.Clear
18596
18597 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
18598
18599         * object.c: When allocating an array, we have to throw
18600         an overflow exception if any of the lengths are < 0.
18601
18602 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
18603
18604         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
18605         properly. Also move implementation of string array marshalling to 
18606         managed code. Fixes #42316.
18607
18608 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18609
18610         * assembly.c: provide more information when loading an assembly fails.
18611
18612 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18613
18614         * filewatcher.c: don't expect the development fam package to be
18615         installed.
18616
18617 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
18618
18619         * marshal.c: Make a copy of the signature cookie since it will be
18620         freed by the caller.
18621         
18622         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
18623
18624         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
18625
18626         * metadata.c (mono_metadata_free_marshal_spec): New function to free
18627         marshal specs.
18628
18629         * marshal.c: More refactoring.
18630         
18631         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
18632         smaller functions.
18633
18634 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
18635
18636         * object.c: In mono_message_invoke, fill the output parameter array after
18637           calling the managed method (it was done before the call). This fixes
18638           bug #59299.
18639
18640 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
18641
18642         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
18643         as well.
18644
18645 2004-09-02  Martin Baulig  <martin@ximian.com>
18646
18647         * class.c (mono_class_instance_size): Don't allow generic type
18648         definitions or open generic instances.
18649         (mono_class_array_element_size): If we're a value type, call
18650         mono_class_instance_size() on the original class.
18651
18652         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
18653         handle generic instances.
18654
18655         * mono-debug-debugger.c (write_type): Handle generic instances
18656         like classes.
18657
18658 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
18659
18660         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
18661         the allocation request fails. Fixes #65089.
18662
18663         * object.c (mono_runtime_free_method): Do not call mono_free_method.
18664         
18665         * object.c (mono_runtime_free_method): New function to free a dynamic
18666         method.
18667
18668         * marshal.c (mono_delegate_free_ftnptr): New function to free the
18669         delegate trampoline.
18670
18671         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
18672         with hasthis as dynamic,
18673
18674         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
18675
18676         * domain.c (mono_jit_info_table_remove): New function to remove an
18677         entry from the jit info table.
18678
18679         * class-internals.h (MonoMethod): Add 'dynamic' field.
18680
18681         * loader.c: Fix warnings.
18682
18683 2004-09-01  Martin Baulig  <martin@ximian.com>
18684
18685         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
18686         instead of mono_debugger_lock() because the latter one is a no-op
18687         unless running in the debugger.
18688
18689 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
18690
18691         * class.c (class_compute_field_layout): Classes with auto-layout or
18692         reference fields are not blittable.
18693         
18694 2004-09-01  Dick Porter  <dick@ximian.com>
18695
18696         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
18697         mono_image_get_filename() to get the assembly location.
18698
18699         * icall.c:
18700         * metadata.h: Fix compile warnings
18701
18702 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
18703
18704         * class.c (class_compute_field_layout): System.Object is blittable.
18705
18706         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
18707         as in/out. Fixes #59909.
18708
18709 2004-09-01  Martin Baulig  <martin@ximian.com>
18710
18711         * metadata.h (MONO_TYPE_ISREFERENCE): Call
18712         mono_metadata_generic_inst_is_valuetype() if we're a generic
18713         instance to check whether our underlying type is a reference type.
18714
18715 2004-09-01  Martin Baulig  <martin@ximian.com>
18716
18717         * metadata.c (mono_type_size): If we're a generic instance, call
18718         mono_class_value_size() for value types.
18719
18720 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
18721
18722         * marshal.c: Implement more custom marshalling functionality. Fixes
18723         #64915.
18724
18725 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
18726
18727         * mono-debug.c, debug-mono-symfile.c: add some locking love.
18728
18729 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
18730
18731         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
18732
18733         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
18734
18735         * icall.c: Fix some warnings.
18736
18737         * threads.c (abort_appdomain_thread): Fix unref errors.
18738         (mono_thread_current): Fix THREAD_DEBUG define.
18739
18740 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
18741
18742         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
18743
18744         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
18745
18746 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
18747
18748         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
18749         string arrays.
18750
18751 2004-08-28  Martin Baulig  <martin@ximian.com>
18752
18753         * metadata.c
18754         (mono_metadata_generic_inst_is_valuetype): New public function.
18755
18756         * metadata.h (MONO_TYPE_ISSTRUCT): Call
18757         mono_metadata_generic_inst_is_valuetype() if we're a generic
18758         instance to check whether our underlying type is a valuetype.
18759
18760 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
18761
18762         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
18763         #63768.
18764
18765 2004-08-25  Martin Baulig  <martin@ximian.com>
18766
18767         * loader.c (mono_get_method_from_token): Abstract methods can also
18768         be generic and thus have type parameters.
18769
18770         * metadata-internals.h
18771         (MonoDynamicImage): Added `GPtrArray *gen_params'.
18772
18773         * reflection.c (mono_image_get_generic_param_info): Don't create a
18774         metadata row, just add an entry to the `gen_params' array.
18775         (build_compressed_metadata): Sort the `gen_params' array and then
18776         actually create the metadata.
18777
18778 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18779
18780         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
18781
18782 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
18783
18784         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
18785
18786 2004-08-24  Martin Baulig  <martin@ximian.com>
18787
18788         * class.cs (mono_class_is_subclass_of): Like an interface, a
18789         generic instance also derives from System.Object.
18790
18791 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
18792
18793         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
18794         custom modifiers to be in any order. Fixes #61990.
18795
18796 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
18797
18798         * object.c: Register mono_object_new_fast icall.
18799         
18800         * object.c (mono_class_get_allocation_ftn): Return to calling
18801         mono_object_new_fast, since it seems faster to compute the object 
18802         size in unmanaged code than passing it as a parameter.
18803
18804         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
18805
18806         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
18807         this function with Boehm as the oom handler, so we don't have to check
18808         the result of GC_malloc.
18809
18810         * object.c: Remove checks for oom.
18811
18812         * object.h object.c (mono_class_get_allocation_ftn): New function to
18813         return the icall which can be used to allocate an instance of a given
18814         class. 
18815
18816         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
18817
18818         * class-internals.h: Add 'enabled' field.
18819
18820 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
18821
18822         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
18823
18824 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
18825         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
18826         value 0x0010.
18827
18828 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
18829
18830         * appdomain.c: use the Tls function for appdomain too,
18831         at Zoltan's request. Actually return in mono_context_get
18832
18833         * appdomain.c, profiler.c, threads.c: use __thread
18834
18835 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
18836
18837         * appdomain.c threads.c: Call GC_CreateThread on windows.
18838
18839         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
18840         multiple libraries since this don't work on windows.
18841
18842 2004-08-18  Martin Baulig  <martin@ximian.com>
18843
18844         * class-internals.h
18845         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
18846         MonoMethodHeader.
18847
18848         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
18849         MonoMethodNormal since we also need it for abstract and interface
18850         methods.
18851
18852         * reflection.c
18853         (build_compressed_metadata): Sort the GenericParam table.
18854         (mono_image_create_token): Added `gboolean create_methodspec'
18855         argument; this is false when generating a MethodImpl token.
18856         (reflection_methodbuilder_to_mono_method): Abstract and interface
18857         methods may also have generic parameters.
18858
18859 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
18860
18861         * appdomain.c: thread local alloc
18862
18863 2004-08-17  Martin Baulig  <martin@ximian.com>
18864
18865         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
18866
18867         * icall.c
18868         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
18869         argument.
18870
18871         * class.c (mono_type_get_full_name): New public function.
18872         (mono_type_get_name): Don't include the type arguments.
18873
18874 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
18875
18876         * Makefile.am: Build static versions of libmetadata and libmonoruntime
18877         for inclusion into the mono executable.
18878
18879 2004-08-16  Martin Baulig  <martin@ximian.com>
18880
18881         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
18882         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
18883
18884 2004-08-14  Martin Baulig  <martin@ximian.com>
18885
18886         * class.c (dup_type): Also copy the `byref' field.
18887
18888 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
18889
18890         * reflection.c (create_dynamic_mono_image): Revert the last change 
18891         since it breaks bootstrap.
18892
18893 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
18894
18895         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
18896
18897         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
18898         not free them with g_free.
18899
18900 2004-08-11  Martin Baulig  <martin@ximian.com>
18901
18902         * reflection.c (mono_reflection_setup_internal_class): Also call
18903         mono_class_setup_mono_type() if we already have a `tb->type.type'.
18904
18905 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
18906
18907         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
18908         called during default (first) AppDomain creation. Keep track of
18909         Evidence when loading assemblies.
18910
18911 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
18912
18913         * opcodes.c, opcodes.h: reduce runtime relocations.
18914
18915 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
18916
18917         * culture-info.h, locales.c: fixes and chages to sue the new
18918         optimized format of the locale data.
18919         * culture-info-tables.h: regenerated.
18920
18921 2004-08-06  Geoff Norton <gnorton@customerdna.com>
18922         
18923         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
18924
18925 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
18926
18927         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
18928         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
18929         * domain-internals.h: icall declaration.
18930         * icall.c: icall registration.
18931         * object-internals.h: New fields in MonoAssembly for CAS.
18932
18933 2004-08-05  Duncan Mak  <duncan@ximian.com>
18934
18935         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
18936         CEE_LDELEM_ANY.
18937
18938 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
18939
18940         * reflection.c: fix to deal with object[] arrays in custom ctors
18941         (bug #62550).
18942
18943 2004-08-05  Martin Baulig  <martin@ximian.com>
18944
18945         * class.c (mono_class_array_element_size): Added support for
18946         generic instances and correctly handle "recursive" types.
18947
18948 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
18949
18950         * assembly.c: Fix warnings.
18951
18952 2004-08-04  Martin Baulig  <martin@ximian.com>
18953
18954         * class.c
18955         (mono_type_get_name_recurse): Added `gboolean include_arity'
18956         argument specifying whether or not we should include the generic
18957         arity in the type name.
18958         (_mono_type_get_name): New static function.
18959         (mono_class_setup_vtable): If we're a generic instance, don't
18960         include the generic arity in the names of explicit method
18961         implementations.        
18962
18963 2004-08-03  Martin Baulig  <martin@ximian.com>
18964
18965         * class.c (mono_type_get_name_recurse): Enclose the generic type
18966         arguments in `<', '>'.
18967
18968 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
18969
18970         * gc.c: make GC warning messages use the trace API, they are just
18971         noise to most of the users.
18972
18973 2004-08-03  Martin Baulig  <martin@ximian.com>
18974
18975         * debug-mono-symfile.c (read_string): Correctly read the string.
18976
18977 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
18978
18979         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
18980         
18981         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
18982         icalls.
18983         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
18984
18985 2004-07-30  Martin Baulig  <martin@ximian.com>
18986
18987         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
18988         Reflect latest symbol writer changes.   
18989
18990 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
18991
18992         * object.c: always create an object if null is passed
18993         to Invoke() where a valuetype is expected.
18994
18995 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
18996
18997         * marshal.c (mono_marshal_init): make managed
18998         signatures match native ones better for 64bits.
18999
19000 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19001
19002         * appdomain.c: hack to build correctly the private bin path on windows.
19003         Fixes bug #61991.
19004
19005 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
19006
19007         * assembly.c: Load mscorlib from the correct framework directory
19008           (mono/<version>/mscorlib.dll).
19009         * appdomain.h: Added prototypes for new functions.
19010         * internals.h: Added some prototypes.
19011         * domain.c: When initializing the runtime, get from the executable and
19012           the configuration files the runtime version that the app supports.
19013           Added support methods for reading app.exe.config. Added list of versions
19014           supported by the JIT. Added two new methods: mono_init_from_assembly,
19015           which initializes the runtime and determines the required version from
19016           the provided exe file, and mono_init_version, which initializes
19017           the runtime using the provided version.
19018         * icall.c: Get machine.config from version-specific directory.
19019         * reflection.c: When generating an image, embed the version number
19020           of the current runtime.
19021
19022 2004-07-28  Dick Porter  <dick@ximian.com>
19023
19024         * socket-io.c
19025         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
19026         returned sockaddr size before creating the remote address object.
19027         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
19028         61608.
19029
19030 2004-07-28  Dick Porter  <dick@ximian.com>
19031
19032         * locales.c (string_invariant_compare_char): Fix invariant char
19033         compares between upper and lower cases.  Fixes bug 61458.
19034
19035 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
19036         
19037         * marshal.c: actually cache stelem.ref wrappers.
19038         
19039 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
19040
19041         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
19042         sections and remove the mono_cli_rva_map () function.
19043
19044 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
19045
19046         * debug-mono-symfile.c: fix one more endianess issue, from a patch
19047         by Geoff Norton (<gnorton@customerdna.com>).
19048
19049 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
19050
19051         * class.c: fix class loads for pointer types (typeof(int) !=
19052         typeof(int*)).
19053
19054 2004-07-27  Martin Baulig  <martin@ximian.com>
19055
19056         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
19057         reading the debugging information from an external ".mdb" file.
19058
19059 2004-07-24  Martin Baulig  <martin@ximian.com>
19060
19061         * reflection.c (mono_image_get_type_info): Only write a class
19062         layout entry if we actually have a size or a packing size.
19063
19064 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
19065
19066         * reflection.c (type_get_fully_qualified_name): 
19067         insert cast to get type checking of ?: with non-gcc compilers
19068
19069 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
19070
19071         * rand.c: use g_getenv for both lookups of
19072         MONO_EGD_SOCKET
19073
19074 2004-07-17  Martin Baulig  <martin@ximian.com>
19075
19076         * reflection.c (mono_reflection_bind_generic_method_parameters):
19077         Set `gmethod->reflection_info'.
19078
19079 2004-07-17  Martin Baulig  <martin@ximian.com>
19080
19081         * class.c (mono_class_create_from_typedef): Insert the newly
19082         created class into the hash table before computing the interfaces
19083         since we could be called recursively.
19084
19085 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
19086
19087         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
19088         function to implement stelem.ref in managed code
19089         * class-internals.h, debug-helpers.c: a new wrapper type
19090         for the above.
19091
19092 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
19093
19094         * gc.c: allow GC handles to work even when no GC is compiled in.
19095         Fix part of bug #61134 (GetAddrOfPinnedObject).
19096
19097 2004-07-13  Peter Williams  <peter@newton.cx>
19098  
19099         * process.c (complete_path): Make sure we don't attempt to execute
19100         directories.
19101  
19102 2004-07-12  Geoff Norton <gnorton@customerdna.com>
19103
19104         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
19105           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
19106           and will add/subtract the hour if needed
19107
19108 2004-07-12  Martin Baulig  <martin@ximian.com>
19109
19110         * reflection.c (mono_field_get_object): If we have
19111         `field->generic_info', take the attributes from
19112         `field->generic_info->generic_type'.    
19113
19114 2004-07-12  Martin Baulig  <martin@ximian.com>
19115
19116         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
19117         This function must be called before initializing the runtime.
19118         (mono_debug_init_1): New function; call this after initializing
19119         the runtime, but before loading the assembly.  It tells the
19120         debugger to load corlib and the builtin types.
19121
19122         * mono-debug-debugger.c: Did some larger changes in the debugging
19123         code; support recursive class declarations, make sure we actually
19124         add all classes.
19125
19126 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19127
19128         * debug-helpers.c: undo my previous patch and fixed the real issue in
19129         ../mini/exceptions-x86.c
19130
19131 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19132
19133         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
19134         when no HOME env. variable was set and a NullRef was thrown in a .cctor
19135         called from other .cctors.
19136
19137 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
19138
19139         * loader.c: Removed the mono_loader_wine_init hack now that we are
19140         doing a managed version of Windows.Forms.
19141
19142 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
19143
19144         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
19145         threadpool.c, threads.c: remove static data from rootset.
19146
19147 2004-07-09  Dick Porter  <dick@ximian.com>
19148
19149         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
19150         Don't do any more processing if the matched length was 0.  It was
19151         increasing the size of the string before.  Fixes bug 61167.
19152
19153 2004-07-09  Dick Porter  <dick@ximian.com>
19154
19155         * socket-io.h:
19156         * socket-io.c
19157         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
19158         Add support for SO_PEERCRED if its available.
19159
19160 2004-07-09  Peter Bartok <pbartok@novell.com>
19161         * loader.c: winelib.exe.so error message is now only displayed if
19162         MONO_DEBUG is set. To help us avoid questions when people are trying
19163         out the new Managed.Windows.Forms.
19164
19165 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
19166
19167         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
19168         for isinst and castclass wrappers.
19169
19170         * class-internals.h icall.c: Move registration and lookup of JIT icalls
19171         to libmetadata from the JIT, so they could be used by the marshalling
19172         code and the interpreter.
19173
19174         * marshal.c: Register marshalling related JIT icalls here instead of
19175         in mini.c. Use CEE_MONO_ICALL instead of the family of 
19176         CEE_MONO_PROC<x> opcodes to call marshalling functions.
19177
19178         * metadata.h: Remove unneeded marshalling conversions.
19179
19180         * opcodes.c: Update for new opcodes.
19181         
19182 2004-07-08  Martin Baulig  <martin@ximian.com>
19183
19184         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
19185         (mono_debug_get_domain_data): Make this function static.
19186
19187 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
19188
19189         * gc.c, object.h: add nice GC handle API for embedders.
19190
19191 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
19192
19193         * reflection.c: more changes for the new api
19194
19195         * object.c: When we reflect on a field w/ a constant value, it
19196         will not have a memory location, so we must access metadata. Also,
19197         allow easier reading of strings so that we can read them from
19198         the constant data.
19199
19200         * class.c (mono_class_layout_fields): no need for literal fields here.
19201
19202         * class-internals.h: api changes for const fields
19203
19204         * icall.c (ves_icall_get_enum_info): use new apis for const fields
19205
19206 2004-07-06  Martin Baulig  <martin@ximian.com>
19207
19208         * mono-debug.h: Increment version number to 44.
19209
19210         * mono-debug.c (mono_debug_add_wrapper): The second argument is
19211         now a gpointer, rewrote this whole method.
19212
19213         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
19214         function.  Add information about the wrapper in a new "misc table".
19215
19216         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
19217         for the new misc table.
19218
19219 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
19220
19221         * metadata-internals.h image.c: Add a cache for helper signatures.
19222
19223         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
19224
19225 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
19226
19227         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
19228         delegates from a delegate. Fixes #61033.
19229         
19230         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
19231         marshalling of stringbuilder arrays. Fixes #59900.
19232
19233 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
19234
19235         * icall.c: Add EnumBuilder:setup_enum_type icall.
19236
19237 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
19238
19239         * icall.c: Added a new icall for the property version of
19240         OffsetOfStringData.
19241
19242 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
19243
19244         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
19245         it has a constant size across platforms.
19246
19247         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
19248         stack trace.
19249
19250 2004-06-29  Martin Baulig  <martin@ximian.com>
19251
19252         * mono-debug.c (mono_debug_add_method): Protect the whole function
19253         in mono_debugger_lock(), not just parts of it.
19254
19255 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
19256
19257         * reflection.c: make sure padding bytes in heaps are zeroed.
19258
19259 2004-06-24  David Waite  <mass@akuma.org>
19260
19261         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
19262         image.c, loader.c, locales.c, marshal.c, metadata.c,
19263         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
19264         string-icalls.c, threads.c: change to C90-style comments from C99 /
19265         C++ -style
19266
19267 2004-06-24  Dick Porter  <dick@ximian.com>
19268
19269         * threads.c
19270         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
19271         return createdNew.  Fixes bug 60412.
19272
19273         * threads-types.h: 
19274         * icall.c: Add createdNew parameter to CreateMutex icall
19275
19276 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
19277
19278         * reflection.c, object-internals.h: save default value in params.
19279
19280 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19281
19282         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
19283         no need to build a new path combining that with the application base.
19284         Fixes bug #60442.
19285
19286 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
19287
19288         * reflection.c: fixed minor standard compliance issues.
19289
19290 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
19291
19292         * reflection.c: fixed issue with encoding some custom attributes
19293         (arrays in properties and fields, bug #60411).
19294
19295 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19296
19297         * reflection.c: fix start address when copying the public key token.
19298
19299 2004-06-23  Martin Baulig  <martin@ximian.com>
19300
19301         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
19302         the `exc' object in a static object to put it into the GC's root set.
19303
19304 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
19305
19306         * reflection.c: make mono_reflection_setup_internal_class ()
19307         callable a second time to setup a new parent class.
19308
19309 2004-06-23  Dick Porter  <dick@ximian.com>
19310
19311         * threads.c: Check for WAIT_IO_COMPLETION return values.
19312
19313 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
19314
19315         * appdomain.c: Removed the g_free on the public key token. Now copy 
19316         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
19317         * assembly.c: Added public key token string value when loading 
19318         assemblies. Fix bug #60439.
19319         * icall.c: Added missing informations (like public key) in 
19320         GetReferencedAssemblies. Fix #60519.
19321         * image.h: Changed definition for public key token from const char*
19322         public_tok_value to guchar public_key_token [17];
19323         * reflection.c: Updated for changes to public key token.
19324
19325 2004-06-22  Lluis Sanchez Gual
19326
19327         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
19328         for the field in base classes.
19329
19330 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
19331
19332         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
19333         mark headers as not supported, they are installed only for use by the
19334         debugger.
19335
19336 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
19337
19338         * *.c, *.h: avoid namespace pollution in public headers.
19339
19340 2004-06-21  Martin Baulig  <martin@ximian.com>
19341
19342         * exception.c (mono_get_exception_security): It's in
19343         "System.Security", not in "System".
19344
19345         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
19346         the exception classes.
19347
19348 2004-06-21  Martin Baulig  <martin@ximian.com>
19349
19350         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
19351         Protect the exception object from being finalized.
19352
19353 2004-06-21  Martin Baulig  <martin@ximian.com>
19354
19355         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
19356         public function.
19357
19358 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
19359
19360         * reflection.c: Load the assembly in mono_reflection_type_from_name,
19361         if it was not loaded before. Fix parts of #60439.
19362
19363 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
19364
19365         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
19366         code that was broken since Ben's change: wrappers are now
19367         dependent on the method signature only again.
19368
19369 2004-06-21  Martin Baulig  <martin@ximian.com>
19370
19371         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
19372         added interface support.
19373
19374 2004-06-21  Martin Baulig  <martin@ximian.com>
19375
19376         * class.c (mono_vtable_get_static_field_data): New public method.
19377
19378 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
19379
19380         * filewatcher.c : Windows build fix to be compliant with API changes.
19381
19382 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
19383
19384         * class.h, class.c: more accessors.
19385         * metadata.h, metadata.c: prepare for hiding MonoType and
19386         MonoMethodSignature: people should use the accessors from now on
19387         outside of the tree.
19388
19389 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
19390
19391         * *.c, *.h: more API cleanups.
19392
19393 2004-06-18  Jackson Harper  <jackson@ximian.com>
19394
19395         * assembly.c: Trace loading assemblies.
19396         * loader.c: Trace loading native libraries.
19397         * mono-config.c: Trace loading config files.
19398         
19399 2004-06-18  Dick Porter  <dick@ximian.com>
19400
19401         * locales.c: Tell ICU the lengths of strings, it can cope with
19402         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
19403
19404 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
19405
19406         * image.c: swapped name/filename;
19407
19408 2004-06-18  Martin Baulig  <martin@ximian.com>
19409
19410         * mono-debug-debugger.c (write_class): Write the parent class at
19411         the end of the header.
19412
19413 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
19414
19415         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
19416
19417 2004-06-17  Raja R Harinath  <rharinath@novell.com>
19418
19419         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
19420         (bundle_obj): New conditional define.
19421         (BUILT_SOURCES): Remove.
19422         ($(bundle_srcs)): Make parallel-make safe.
19423         (libmonoruntime_la_LIBADD): Make unconditional.
19424         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
19425         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
19426
19427 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
19428
19429         * culture-info-tables.h: It was inconsistent with the latest
19430           supp info files.
19431
19432 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
19433
19434         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
19435         be loaded.
19436
19437         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
19438         with gcc 2.95.
19439
19440 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
19441
19442         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
19443         cleaned up public header threads.h.
19444
19445 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
19446
19447         * Makefile.am, *.c, *.h: more API cleanups.
19448
19449 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
19450
19451         * Makefile.am: removed monosn from compilation.
19452         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
19453         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
19454         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
19455         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
19456         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
19457         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
19458
19459 2004-06-15  Jackson Harper  <jackson@ximian.com>
19460
19461         * assembly.c: Make locales lower case when searching the GAC for
19462         assemblies. gacutil will always make locales lowercase when
19463         installing so this effectively makes them case insensitive.
19464         
19465 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
19466
19467         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
19468         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
19469           parameter which allows to choose whether the wait can be interrupted or 
19470           not. Also added the method mono_monitor_enter(), which locks the monitor
19471           using an infinite wait and without allowing interruption.
19472           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
19473           interrupted.
19474         * object.h: Added new fields in MonoThread. suspend_event holds the event
19475           used to susped/resume the thread. synch_lock is the lock object to use for
19476           modifying the thread state.
19477         * threads.c: Use the new synch_lock object for locking, instead of "this",
19478           which can generate deadlocks.
19479           Moved thread state change in Thread.Sleep and Thread.Join from managed
19480           to unmanaged code. This avoids a deadlock when the thread was suspended
19481           just after acquiring the thread lock.
19482           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
19483           Implemented Thread.Suspend using an event instead of ThreadSuspend,
19484           which is not fully implemented in the io-layer.
19485         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
19486
19487 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
19488
19489         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
19490         threads-types.h: more API cleanups.
19491
19492 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
19493
19494         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
19495         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
19496         threadpool.c, threads.c: first pass at the exported API cleanup.
19497
19498 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
19499
19500         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
19501
19502 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19503
19504         * icall.c: added internalGetHome.
19505
19506 2004-06-14  Dick Porter  <dick@ximian.com>
19507
19508         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
19509         possible to return successfully when '.' or '..' were the only
19510         entries in a directory, but were skipped.  The MonoIOStat was not
19511         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
19512         Fixes bug 59574.
19513
19514 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
19515
19516         * reflection.c: make binaries run on .Net 1.1 by default.
19517
19518 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
19519
19520         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
19521
19522 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
19523
19524         * marshal.c: keep track of struct size with explicit layout
19525         (bug #59979).
19526
19527 2004-06-12  Martin Baulig  <martin@ximian.com>
19528
19529         * mono-debug-debugger.c: Comment out a debugging g_message().
19530
19531 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
19532
19533         * reflection.c, reflection.h: do not free custom attrs that are cached.
19534         * icall.c: use braces to make code clearer.
19535
19536 2004-06-11  Martin Baulig  <martin@ximian.com>
19537
19538         * class.h (MonoInflatedField): New type.
19539         (MonoClassField): Replaced `MonoType *generic_type' with
19540         `MonoInflatedField *generic_info'.
19541
19542         * icall.c
19543         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
19544
19545 2004-06-11  Martin Baulig  <martin@ximian.com>
19546
19547         * reflection.c (mono_image_create_method_token): Correctly encode
19548         varargs methods.
19549
19550 2004-06-11  Martin Baulig  <martin@ximian.com>
19551
19552         * metadata.c (mono_metadata_parse_method_signature): When parsing
19553         a MethodDef which has VarArgs, also set sentinelpos if we don't
19554         have any parameters.
19555
19556 2004-06-11  Martin Baulig  <martin@ximian.com>
19557
19558         * verify.c (mono_method_verify): In CEE_CALL, use
19559         mono_method_get_signature() to get the method's signature, unless
19560         we're a PInvoke method.
19561
19562 2004-06-10  Jackson Harper  <jackson@ximian.com>
19563
19564         * assembly.c: Use <path>/lib/mono/gac for the extra paths
19565         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
19566         logical name as the supplied path is just a prefix to the gac not
19567         the direct path to it.
19568         
19569 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
19570
19571         * reflection.c: make the token for a created method match
19572         the token of the MethodBuilder it was created from
19573         (IKVM requires this behaviour now).
19574
19575 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
19576
19577         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
19578         reflection.c, socket-io.c: leak fixes.
19579
19580 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
19581
19582         * icall.c: handle sentinel pos in vararg methods in position different
19583         from 0.
19584
19585 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19586
19587         * culture-info-tables.h: freshly generated.
19588
19589 2004-06-09  Martin Baulig  <martin@ximian.com>
19590
19591         * loader.c (mono_get_method_constrained): Call `mono_class_init
19592         (constrained_class)'.   
19593
19594 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
19595
19596         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
19597         any methods. Fixes #59629.
19598
19599 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
19600
19601         * culture-info-tables.h: reflecting locale-builder updates.
19602
19603 2004-06-08  Dick Porter  <dick@ximian.com>
19604
19605         * object.h:
19606         * locales.c: Fixed compile warnings, including a real bug in
19607         CompareInfo_internal_compare.
19608         
19609 2004-06-08  Dick Porter  <dick@ximian.com>
19610
19611         * locales.c
19612         (ves_icall_System_Globalization_CompareInfo_internal_index):
19613         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
19614         Double-check the resuls of usearches, because ICU currently
19615         ignores most of the collator settings here.  Fixes bug 59720.
19616         
19617 2004-06-08  Dick Porter  <dick@ximian.com>
19618
19619         * locales.c
19620         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
19621         Fix memory leak and segfault-causing typo.  No idea how this one
19622         lasted so long without being noticed.
19623
19624 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
19625
19626         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
19627         any methods. Fixes #59629.
19628
19629 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19630
19631         * assembly.c:
19632         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
19633         own the critical section before). Removed dead code (that's done
19634         in the preload hook).
19635
19636         (mono_assembly_load_with_partial_name): call the preload hook.
19637
19638 2004-06-08  Martin Baulig  <martin@ximian.com>
19639
19640         * metadata.c (mono_metadata_signature_alloc): Default
19641         `sentinelpos' to -1.
19642
19643         * reflection.c (mono_image_get_array_token): Likewise.
19644
19645 2004-06-08  Martin Baulig  <martin@ximian.com>
19646
19647         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
19648
19649         * metadata.c (mono_metadata_parse_method_signature): When parsing
19650         a MethodDef which has VarArgs, set sentinelpos.
19651
19652         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
19653         `gint16' since we're using -1 for non-varargs methods.
19654
19655         * reflection.c
19656         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
19657         (method_encode_signature): Added varargs support.
19658         (method_builder_encode_signature): Likewise.
19659         (mono_image_get_varargs_method_token): New static method.
19660         (mono_image_create_method_token): New public method; this is
19661         called via an icall instead of mono_image_create_token() when
19662         calling a varargs method.       
19663
19664 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
19665
19666         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
19667
19668 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
19669
19670         * culture-info-tables.h : Reflecting the latest locale-builder that
19671           fixed empty array representation ({} to {0}).
19672
19673 2004-06-07  Jackson Harper  <jackson@ximian.com>
19674
19675         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
19676         looking up extra gac paths. This allows MONO_GAC_PATH to act
19677         exactly like a prefix.
19678         
19679 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
19680
19681         * reflection.c (mono_reflection_type_from_name): Make a copy of the
19682         type name before modifying it. Fixes #59405.
19683
19684 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
19685
19686         * culture-info.h: added fields for "all datetime patterns".
19687         * locales.c: (  ves_icall_System_Globalization_CultureInfo
19688           _construct_datetime_format ()): fill xxx_patterns fields.
19689         * object.h: added fields for "all datetime patterns" to
19690           MonoDateTimeFormatInfo.
19691         * culture-info-tables.h: reflecting locale-builder updates.
19692
19693 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
19694
19695         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
19696         the event has no add and remove methods. Fixes #59629.
19697
19698 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
19699
19700         * object.c: Fixed possible integer overflow when allocating large
19701         strings.
19702
19703 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
19704
19705         * culture-info-tables.h: reflecting locale-builder updates.
19706
19707 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
19708
19709         * culture-info-tables.h: reflecting locale-builder updates.
19710
19711 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
19712
19713         * culture-info-tables.h: reflecting locale-builder updates.
19714
19715 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
19716
19717         * threads.c: Made Thread.Sleep abortable.
19718
19719 2004-06-02  Martin Baulig  <martin@ximian.com>
19720
19721         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
19722
19723         * debug-mono-symfile.h: Bumped symbol file version number to 37.
19724
19725 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
19726
19727         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
19728
19729 2004-05-30  Jackson Harper  <jackson@ximian.com>
19730
19731         * reflection.c: Do not hardcode assembly versions or public key
19732         tokens anymore. All of this except the corlib section was dead
19733         code anyways.
19734         
19735 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
19736
19737         * object.c (mono_runtime_invoke_array): Automatically create boxed
19738         objects for byref valuetypes if needed. Fixes #59300.
19739         
19740         * object.c (mono_method_return_message_restore): Handle 
19741         MONO_TYPE_OBJECT as well.
19742
19743 2004-05-28  Jackson Harper  <jackson@ximian.com>
19744
19745         * reflection.c: The modified type encoding was causing build
19746         problems. Reverted for now.
19747         
19748 2004-05-28  Jackson Harper  <jackson@ximian.com>
19749
19750         * reflection.c/h: Take an assembly ref so that we dont create
19751         fully qualified names when encoding types in the same assembly as
19752         the custom attribute being emitted.
19753         * appdomain.c: Increment version number.
19754         
19755 2004-05-26  Duncan Mak  <duncan@ximian.com>
19756
19757         * icall.c
19758         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
19759         Set the full version number (major, minor, build, revision).
19760
19761 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
19762
19763         * marshal.c (emit_struct_conv): increment src/dst after blit
19764         (mono_marshal_get_managed_wrapper,
19765         mono_marshal_get_native_wrapper): make sure we have marshalling
19766         info before marshalling params (info computation affects
19767         blittable)
19768
19769         * class.c (class_compute_field_layout): correctly deal with
19770         blittable
19771         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
19772         value types (as per what windows dows by default)
19773         (mono_class_setup_mono_type): System.ValueType is blittable
19774         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
19775         blittable
19776
19777         * marshal.c (mono_marshal_load_type_info): flag types  as
19778         non-blittable if the native layout doesn't match the managed
19779         layout
19780
19781 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19782
19783         * appdomain.c: don't add stuff in the private search path that is
19784         above the application base. If application base is not set, there's
19785         no private search path.
19786
19787 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
19788
19789         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
19790         byref struct arguments in native->managed marshalling.
19791
19792 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
19793
19794         * marshal.c (mono_marshal_get_runtime_invoke): correctly
19795         cache methods using signature (special case for methods
19796         that are value type or string class)
19797         
19798         * image.c (mono_image_close): clean up allocated GSList's
19799         in runtime_invoke_cache.
19800
19801 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19802
19803         * mono-config.c: set the correct path for mono_cfg_dir on windows when
19804         there's no MONO_CFG_DIR environment variable defined.
19805
19806 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19807
19808         * threads.c: windows version must be >= 0x0500 to include OpenThread.
19809
19810 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
19811
19812         * threadpool.c: Really wait for 500ms after the async call, even if the wait
19813           is interrumped.
19814         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
19815           before waiting for it, and call CloseHandle after the wait to unref it.
19816           This will make sure that handles are not disposed too early.
19817
19818 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19819
19820         * appdomain.c:
19821         * appdomain.h:
19822         * icall.c: removed
19823         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
19824         needed now.
19825
19826         * object.c: se the application_base only for the domain that runs
19827         Main. Fixes bug #59216,
19828
19829 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19830
19831         * appdomain.c:
19832         * object.c: only the domain in which Main is run have
19833         SetupInformation.ConfigurationFile set, so moved a few lines from
19834         appdomain.c to object.c.
19835
19836 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19837
19838         * appdomain.c: we tried to load [name].(dll|exe), but according
19839         to bug #57710, we must also try [culture]/[name].(dll|exe) and
19840         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
19841         There's a test case attached to bug #58922.
19842
19843 2004-05-27  Dick Porter  <dick@ximian.com>
19844
19845         * icall.c:
19846         * file-io.c: Implemented icalls for locking and unlocking regions
19847         in a file.
19848         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
19849         FALSE on error (fixes both compiler warning and real bug.)
19850
19851 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
19852
19853         * culture-info-tables.h: reflecting locale-builder updates.
19854
19855           (Added missing ChangeLog entry for 05/26)
19856
19857 2004-05-27  Jackson Harper  <jackson@ximian.com>
19858
19859         * locales.c: Fix some cut and paste errors.
19860         
19861 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19862
19863         * mono-config.c: set the correct path for config. directory on windows.
19864
19865 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19866
19867         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
19868           on win32.
19869
19870 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
19871
19872         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
19873         from pinvoke functions.
19874         
19875         * marshal.c (mono_ftnptr_to_delegate): Implement this.
19876
19877 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19878
19879         * culture-info-tables.h: reflecting locale-builder updates.
19880
19881 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
19882
19883         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
19884         #59086.
19885
19886 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
19887
19888         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
19889         * icall.c: Modified icalls for RNG.
19890         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
19891         Windows (CryptoAPI).
19892
19893 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
19894
19895         * locales.c: Fix build.
19896
19897 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
19898
19899         * culture-info-tables.h: reflecting locale-builder updates.
19900
19901 2004-05-25  Jackson Harper  <jackson@ximian.com>
19902
19903         * locales.c: When creating the current culture use the $LANGs
19904         specific culture. So DateTimeFormat and NumberFormat entries are created.
19905         
19906 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
19907
19908         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
19909         a char array as parameter.
19910
19911 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
19912
19913         * image.c: In mono_image_open(), always use an absolute path name to
19914           look for already loaded images.
19915
19916 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
19917
19918         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
19919         missing in the windows build (like older cygwin include files).
19920
19921 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
19922
19923         * icall.c: Fixed check for possible integer overflow in Buffer_
19924         BlockCopy icall. Replaced comments style // by /* */.
19925
19926 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
19927
19928         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
19929         
19930         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
19931         check after MONO_VTADDR. Fixes pinvoke2.exe.
19932
19933         * marshal.h marshal.c metadata.h: Add beginnings of support for
19934         ftnptr -> delegate marshalling.
19935
19936 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
19937
19938         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
19939         * threads.c: Fix warnings.
19940
19941 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
19942
19943         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
19944         * icall.c: Registered icalls for Suspend and Resume.
19945         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
19946           Thread.Abort.
19947         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
19948         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
19949         * process.c: Use WaitForSingleObjectEx.
19950         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
19951           checkpoints.
19952         * threads.c, threads.h: Make use of new Ex wait methods. Improved
19953           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
19954           for Suspend and Resume. Added new mono_thread_stop, used for stoping
19955           background threads. Added basic support for Abort in Windows.
19956           Start new threads using a managed delegate invoke wrapper. This wrapper
19957           has an interruption checkpoint that is needed since an interruption
19958           can be requested before the thread leaves the unmanaged code that starts 
19959           the thread.
19960         * marshal.c: Added interruption checkpoint after every native call, and
19961           also before managed calls for wrappers called from unmanaged code to
19962           go into managed code.
19963         * object.h: Added new field in MonoThread to keep track of interruption
19964           requests.
19965
19966 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
19967
19968         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
19969         calls.
19970
19971 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19972
19973         * appdomain.c:
19974         * assembly.c:
19975         * gc.c:
19976         * locales.c:
19977         * mono-config.c:
19978         * rand.c: getenv -> g_getenv (windows!)
19979
19980         * process.c: complete_path is also used on non-windows platforms.
19981
19982 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19983
19984         * icall.c: new signature for Process_Start.
19985
19986         * process.[ch]: new signature for Process_Start. If we're on windows
19987         and UseShellExecute is false, we have to search for the program by
19988         ourselves if we don't get a full path.
19989
19990 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
19991
19992         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
19993         marshalling and call CleanUpNativeData if needed. Fixes #58646.
19994
19995 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19996
19997         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
19998         Fixes bug #58373.
19999
20000 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20001
20002         * process.c: use double quotes to quote program name and arguments on
20003         windows. Fixes bug #58575.
20004
20005 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20006
20007         * file-io.c: don't return "." and ".." when using windows Find*File.
20008
20009 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
20010
20011         * marshal.c: Don't pass wrappers to message init because method 
20012         addressed used to lookup metadata. part of remoting[2|3] fix.
20013
20014 2004-05-15  Jackson Harper  <jackson@ximian.com>
20015
20016         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
20017         path is essentially the same as MONO_PATH except that it points to
20018         GACs instead of lib directories.
20019         * loader.h: The user gac is gone so we dont need function to
20020         enable/disable it.
20021         * mono-config.c: user gac option is now gone.
20022         
20023 2004-05-15  Jackson Harper  <jackson@ximian.com>
20024
20025         * culture-info.h: Make defines more consistent, add calendar data
20026         to the culture info table.
20027         * culture-info-tables.h: Add basic calendar data. Basically
20028         everyone gets default gregorian until all the data is
20029         updated.
20030         * locales.c: Use the new consistent defines. Set calendar data for
20031         culture info objects.
20032         * object.h: add a field for calendar data to CultureInfo
20033         
20034 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
20035
20036         * image.c: image->runtime_invoke_cache is keyed on signatures now.
20037         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
20038         a signature.
20039         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
20040         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
20041         an extra param that is the pointer of the method to invoke. The IL for
20042         the invoke method is no longer specific to the method, but to the
20043         signature of the method. Thus, we can share the same code for multiple
20044         methods. This reduces the number of methods that have to be compiled.
20045
20046 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
20047
20048         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
20049
20050         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20051
20052         * icall.c: Optimize Buffer.BlockCopy.
20053
20054 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20055
20056         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
20057         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
20058         quote). Changed them to "MMMM yyyy".
20059
20060 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
20061
20062         * rand.c
20063         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
20064
20065 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
20066
20067         * reflection.h: Updated after changes to managed structures.
20068
20069         * appdomain.c: Bump corlib version.
20070
20071 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20072
20073         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
20074         windows.
20075
20076 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20077
20078         * Makefile.am: link to ../os/libmonoos.la on windows.
20079
20080         * assembly.c:
20081                 -If MONO_DEBUG, warn about non-existing directories in
20082                 MONO_PATH.
20083                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
20084                 compile time variable.
20085                 -Removed init_default_path and call mono_set_rootdir from
20086                 libmonoos.a instead (windows only).
20087
20088         * assembly.h: declare mono_assembly_getrootdir().
20089
20090         * domain.c:
20091         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
20092
20093         * loader.c: s/getenv/g_getenv/
20094
20095 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
20096
20097         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
20098
20099         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
20100
20101         * metadata.h: Add new marshalling conversions.
20102
20103         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
20104         function.
20105
20106         * reflection.c (mono_reflection_get_type): Lookup the type in all
20107         modules of a multi-module assembly. Fixes #58291.
20108
20109 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
20110
20111         * threads.c: Before aborting a background, set the StopRequested
20112         state.  This avoids throwing the Abort exception.
20113         In mono_thread_manage, don't continue with the shutdown until all
20114         aborted threads have actually stopped.
20115
20116 2004-05-10  Jackson Harper  <jackson@ximian.com>
20117
20118         * locales.c: Remove the modifier from culture names.
20119         
20120 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20121
20122         * Makefile.am: monosn is not installed any more. It has been deprecated
20123         in favor of sn.
20124
20125 2004-05-07  Jackson Harper  <jackson@ximian.com>
20126
20127         * locales.c
20128         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
20129         Fix array construction, add bailout if the length is 0.
20130
20131 2004-05-07  Dick Porter  <dick@ximian.com>
20132
20133         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
20134         machine doesn't have a DNS entry.  Patch by Urs Muff
20135         (umuff@quark.com), fixes bug 57928.
20136
20137 2004-05-06  Jackson Harper  <jackson@ximian.com>
20138
20139         * reflection.c: Handle null PublicTokens properly. alloc mem for
20140         assembly names culture so we dont crash when freeing it.
20141         
20142 2004-05-06  Jackson Harper  <jackson@ximian.com>
20143
20144         * assembly.c: Check the usergac when loading with partial names.
20145         
20146 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
20147
20148         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
20149         does nothing for now (not required for Linux/Windows) but the class
20150         library can call it (and a newer or modified runtime could need it).
20151         * icall.c: Registred icall.
20152
20153 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20154
20155         * loader.c: prints a message on module loading error we set MONO_DEBUG
20156         environment variable.
20157
20158 2004-05-05  Jackson Harper  <jackson@ximian.com>
20159
20160         * appdomain.c: Handle PublicKeyToken=null properly.
20161         
20162 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
20163
20164         * environment.c|h: Added icall ves_icall_System_Environment_
20165         GetOSVersionString to get the current OS version as a string.
20166         * icall.c: Registred icall.
20167
20168 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
20169
20170         * object.c: in mono_object_get_virtual_method(), take into account that
20171         non-virtual methods don't have a slot in the vtable. Check needed when
20172         the object is a proxy.
20173
20174 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
20175
20176         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
20177         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
20178
20179         * object.c (mono_class_compute_gc_descriptor): Fix warning.
20180
20181         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
20182         passed when a valuetype is expected.
20183
20184         * object.c (mono_unhandled_exception): Only set the exit code if the
20185         exception happens in the main thread. Fixes thread5.exe.
20186
20187         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
20188         invalid names. Fixes #58047.
20189
20190 2004-05-03  Jackson Harper  <jackson@ximian.com>
20191
20192         * assembly.c: This line was committed accidently and is unneeded.
20193         
20194 2004-05-03  Jackson Harper  <jackson@ximian.com>
20195
20196         * icall.c: Add new icall for Assembly::LoadWithPartialName
20197         * assembly.c/.h: new function that probes the GAC to load partial
20198         assembly names by Paolo Molaro.
20199         
20200 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20201
20202         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
20203         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
20204         (type_get_fully_qualified_name): Added PublicKeyToken when building a
20205         full type name.
20206
20207 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20208
20209         * appdomain.c: fixed check for 'neutral' culture and removed warning.
20210         * reflection.c: fix bug when parsing a full type name and Version is not
20211         the last thing in the string.
20212
20213 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
20214
20215         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
20216         crashes when it is freed.
20217
20218 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20219
20220         * assembly.c: print the compat warning to stderr.
20221
20222 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
20223
20224         * assembly.c (mono_assembly_load_references): Add a compatibility
20225         hack to run old applications that might be still referencing the
20226         3300-based assemblies, only do this for System.xxx.
20227
20228 2004-05-01  Jackson Harper  <jackson@ximian.com>
20229
20230         * appdomain.c: If the culture is neutral we set it to "".
20231         
20232 2004-04-29  Jackson Harper  <jackson@ximian.com>
20233
20234         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
20235
20236 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
20237  
20238         * string-icalls.c: added low overhead function for copying chars
20239         * icall.c: added needed icall for the above function
20240  
20241 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20242
20243         * icall.c: fix return value of get_global_assembly_cache.  Implemented
20244         Environment.GetLogicalDrives.
20245
20246 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
20247
20248         * rand.c: try and talk to egd or prngd
20249         for random bytes if opening devices fail.
20250
20251 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
20252
20253         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
20254         alignment for the type using the native alignment of its members 
20255         instead of using klass->min_align.
20256
20257         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
20258
20259 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20260
20261         * file-io.c:
20262         * socket-io.c: added check for sys/aio.h.
20263
20264 2004-04-28  Dick Porter  <dick@ximian.com>
20265
20266         * threads.c: Don't abort a thread thats already aborting, when
20267         terminating everything.
20268
20269 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20270
20271         * icall.c: added 2 new async calls for Socket.
20272
20273         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
20274         IO on *nix systems.
20275
20276         * threadpool.c: removed unused variable.
20277
20278 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
20279
20280         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
20281
20282 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
20283
20284         * locales.c: put back string_invariant_tolower () and
20285         string_invariant_toupper ().
20286
20287 2004-04-26 David Waite <mass@akuma.org>
20288
20289         * file-io.h:
20290         * socket-io.h:
20291         * threads.h:
20292         * unicode.h: remove comma from end of enumeration declarations
20293
20294 2004-04-26 David Waite <mass@akuma.org>
20295
20296         * debug-mono-symfile.h:
20297         * decimal.c:
20298         * mono_debug.h:
20299         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
20300
20301
20302 2004-04-26  Jackson Harper  <jackson@ximian.com>
20303
20304         * appdomain.c: Increment version number.
20305         
20306 2004-04-26  Jackson Harper  <jackson@ximian.com>
20307
20308         * appdomain.c: Set assembly references public token value when
20309         PublicKeyToken is specified, not the hash_value. Free public token
20310         values when free assembly name data. Previously the public key
20311         token was hex decoded, however we are using hex encoded public key
20312         tokens, so this is not neccasary.
20313         * assembly.c: Lookup assemblies in the gac if their public token
20314         value is set. Add function to allow enabling user gac
20315         lookups. Specify whether or not the assembly was loaded from the
20316         GAC. Compare full assembly names when checking the cache for
20317         assemblies (Temporarily disabled see comment in code). Remove
20318         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
20319         specifies trace-loader they get extra info to stdout on the
20320         loading of assemblies.
20321         * image.h: Add a field for an assembly references public token
20322         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
20323         whether an assembly has been loaded from the GAC.
20324         * image.c: Remove a corlib -> mscorlib name mapping.
20325         * loader.h: Add function to enable/disable the user gac.
20326         * mono-config.c: Check if the usergac is enabled in the config
20327         file.
20328         * icall.c: New icall to determine whether or not an assembly has
20329         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
20330         * tabldefs.h: Add constant for assemblyref flag that specifies a
20331         full public key is used instead of a public token.
20332         * reflection.c: Remove mscorlib -> corlib mappings. Set
20333         PublicTokenValue instead of hash value. This value is a hex
20334         string so it does not need to be expanded.
20335
20336 2004-04-26  Martin Baulig  <martin@ximian.com>
20337
20338         * mono-debug-debugger.c (mono_debugger_initialize): Set
20339         `mono_debugger_initialized' before calling mono_debug_lock().
20340
20341 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
20342
20343         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
20344           InternalToUpper/InternalToLower.
20345         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
20346           removed invariant culture shortcut.  This is now done in managed code.
20347         * locales.c: (string_invariant_toupper/tolower) removed.
20348
20349 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20350
20351         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
20352         Added Poll internal call.
20353
20354         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
20355         call for Poll. Select was too heavy for polling a single socket.
20356
20357         * threadpool.[ch]: added mono_threadpool_cleanup.
20358         * threads.c: use it. Don't use Thread_Abort on windows.
20359
20360 2004-04-23  Martin Baulig  <martin@ximian.com>
20361
20362         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
20363
20364 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
20365
20366         * icall.c: Registred new icalls for key pair protection and added an
20367         icall for Environment.GetFolderPath on Windows.
20368         * security.c|h: Added new icalls for key pair protection.
20369
20370 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20371
20372         * socket-io.c: don't display the non-supported family warning for known
20373         families. Now this is not displayed on windows when checking support
20374         for IPv4/IPv6.
20375
20376 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20377
20378         * class.c: don't display the layout warning for static fields.
20379
20380 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
20381
20382         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
20383         * locales.c, locales.h: Added new icalls for culture-specific
20384         Char.ToLower and Char.ToUpper.
20385
20386 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20387
20388         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
20389         by David Waite.
20390
20391 2004-04-20  Martin Baulig  <martin@ximian.com>
20392
20393         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
20394         of the type name before passing it to mono_reflection_type_from_name().
20395
20396 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
20397
20398         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
20399         encodings here. Fixes #56965.
20400
20401 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
20402
20403         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
20404         fix test on strstr result not that I can see anything that
20405         relies on the result.
20406
20407 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
20408
20409         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
20410         Fixes #57081.
20411
20412         * marshal.c (mono_marshal_get_string_encoding): New helper function.
20413
20414         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
20415         function to determine which marshalling to use for strings. Fixes
20416         #56965.
20417
20418         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
20419
20420         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
20421
20422 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
20423
20424         * icall.c: #include mono-config.h
20425
20426 2004-04-15  Jackson Harper  <jackson@ximian.com>
20427
20428         * culture-info-tables.h: Fix date formats for en-US culture.
20429         
20430 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
20431
20432         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
20433         ThreadPool.SetMinThreads.
20434         * threadpool.c: Implemented ThreadPool.GetMinThreads and
20435         ThreadPool.SetMinThreads.
20436
20437 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
20438
20439         * mono-config.c: also load the .config file in the directory
20440         where the assembly was found.
20441
20442 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
20443
20444         * assembly.c: load per-assembly config files.
20445         * icall.c: decrapified code to get the config dir and moved to
20446         mono-config.c.
20447         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
20448         per-assembly config files. When doing a dll map lookup give precedence
20449         to the per-assembly data.
20450
20451 2004-04-14  Martin Baulig  <martin@ximian.com>
20452
20453         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
20454         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
20455         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
20456
20457         * mono-debugger-debugger.c: While the debugger is locked, remember
20458         whether the symbol tables have changes and send one single
20459         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
20460
20461 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
20462
20463         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
20464
20465         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
20466         function.
20467
20468         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
20469         account when marshalling string arrays. Fixes #56965.
20470
20471 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
20472
20473         * icall.c: Add new icalls mapping for security.
20474         * security.c|h: Add internal calls for WindowsIdentity,
20475         WindowsImpersonationContext and WindowsPrincipal.
20476
20477 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
20478
20479         * class.c: Added comment to ensure the System.MonoDummy class
20480         is removed when no longer necessary
20481
20482 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
20483
20484         * appdomain.c: Pass arguments to the bootstraping exceptions to
20485         minimize JITed methods at boot
20486
20487         * metadata.c (mono_exception_from_name_two_strings): Allow for the
20488         second string to be null.
20489
20490         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
20491         Change the protocol to minimize the JIT methods at startup.  Now
20492         it Returns the internal codepage, if the value of "int_code_page"
20493         is 1 at entry, and we can not compute a suitable code page
20494         number, returns the code page as a string.
20495
20496 2004-04-13  Jackson Harper  <jackson@ximian.com>
20497
20498         * culture-info-tables.h: Fix number of decimal digits for all
20499         english locales.
20500
20501 2004-04-13  Jackson Harper  <jackson@ximian.com>
20502
20503         * icall.c: Clairfy out of sync error message. It is not always
20504         your corlib that is out of sync.
20505
20506 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
20507
20508         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
20509         properties when only the set accessor is overriden. Fixes #55874.
20510
20511 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
20512
20513         * assembly.c (mono_assembly_load_references): Make this thread safe.
20514         Fixes #56327.
20515
20516 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
20517
20518         * monosn.c: Add missing initialization calls.
20519
20520 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
20521
20522         * locales.c:
20523         ves_icall_System_Globalization_CultureInfo_construct_number_format
20524         Fix g_assert so it compiles on fussier compilers re int/ptr
20525         mismatch
20526
20527 2004-04-08  Dick Porter  <dick@ximian.com>
20528
20529         * socket-io.h:
20530         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
20531         53992.  Also rearrange the code so that the internal calls return
20532         an error value and exceptions are thrown from managed code.
20533
20534         * icall.c: Add type info to the socket icalls.
20535
20536 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20537
20538         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
20539         owes me a beer.
20540
20541 2004-04-07  Martin Baulig  <martin@ximian.com>
20542
20543         * class.c (mono_class_from_generic_parameter): Don't default
20544         `klass->parent' to `mono_defaults.object_type'.
20545
20546 2004-04-07  Martin Baulig  <martin@ximian.com>
20547
20548         * reflection.c (mono_reflection_initialize_generic_parameter): Set
20549         `param->pklass->reflection_info'.       
20550
20551 2004-04-07  Jackson Harper  <jackson@ximian.com>
20552
20553         * culture-info-tables.h: Fix date separator symbol.
20554         
20555 2004-04-07  Martin Baulig  <martin@ximian.com>
20556
20557         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
20558         from System.Type to System.MonoType.
20559
20560 2004-04-07  Martin Baulig  <martin@ximian.com>
20561
20562         * reflection.h
20563         (MonoReflectionGenericParam): Added `has_reference_type' and
20564         `has_value_type' fields.
20565
20566         * reflection.c (mono_image_get_generic_param_info): Encode the
20567         correct flags if we have the `class' or `struct' constraint.
20568
20569 2004-04-07  Martin Baulig  <martin@ximian.com>
20570
20571         * reflection.h
20572         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
20573
20574 2004-04-07  Jackson Harper  <jackson@ximian.com>
20575
20576         * appdomain.c: Revert extra patches, just wanted to bump the
20577         version number.
20578         
20579 2004-04-07  Jackson Harper  <jackson@ximian.com>
20580
20581         * Makefile.am: Add culture-info private headers.
20582         * icall.c: Add new icalls for contructing locales.
20583         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
20584         * locales.h: Declare new culture info construction methods.
20585         * object.h: Add new fields used to avoid the CultureMap to
20586         MonoCultureInfo.
20587         * culture-info.h: Definition of structs used in the culture info
20588         tables.
20589         * culture-info-tables.h: Autogenerated tables that contain culture
20590         info data. This file was generated with the locale-builder tool.
20591         * appdomain.c: Incement corlib version number.
20592         
20593 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
20594
20595         * appdomain.c: (mono_runtime_init) move mono_thread_init
20596         to before mono_object_new calls so critical sections
20597         are initialized before use.
20598
20599 2004-04-07  Martin Baulig  <martin@ximian.com>
20600
20601         * icall.c
20602         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
20603         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
20604         (ves_icall_MonoGenericParam_initialize): Removed.
20605         (monogenericparam_icalls): Removed.
20606         (generictypeparambuilder_icalls): Added new table for
20607         System.Reflection.Emit.GenericTypeParameterBuilder.
20608
20609         * reflection.c
20610         (mono_reflection_define_generic_parameter): Removed.
20611         (mono_reflection_initialize_generic_parameter): This is now called
20612         from GenericTypeParameterBuilder's .ctor.
20613
20614 2004-04-06  Martin Baulig  <martin@ximian.com>
20615
20616         * class.c (mono_class_init): Don't inflate nested classes in a
20617         generic instance.
20618         (mono_type_get_name_recurse): Include the generic arguments for
20619         generic instances and generic type declarations.
20620         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
20621         (_mono_class_get_instantiation_name): Removed.
20622         (mono_class_create_generic): Always use `gklass->name' as our name.
20623
20624         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
20625
20626         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
20627         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
20628         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
20629         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
20630         closed generic methods here.
20631
20632         * reflection.c
20633         (mono_reflection_generic_inst_get_nested_types): Removed.
20634         (inflate_mono_method): Copy the generic parameters from the
20635         MonoMethodHeader into out MonoGenericMethod.
20636
20637 2004-04-06  Martin Baulig  <martin@ximian.com>
20638
20639         * row-indexes.h
20640         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
20641
20642         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
20643
20644         * reflection.c (build_compressed_metadata): If we have any entries
20645         in the GenericParam, MethodSpec or GenericParamConstraint tables,
20646         set the header version to 1.1.
20647
20648 2004-04-06  Martin Baulig  <martin@ximian.com>
20649
20650         * class.c (mono_class_init): If we're a generic instance,
20651         initialize our nested classes, too.
20652         (_mono_class_get_instantiation_name): Deal with the new `!%d'
20653         suffix. 
20654
20655 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20656
20657         * process.c: quote the argument passed to the shell on windows.
20658
20659 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
20660
20661         * threads.c (mono_alloc_special_static_data): Allow this to be
20662         called during startup.
20663
20664 2004-04-02  Martin Baulig  <martin@ximian.com>
20665
20666         * icall.c
20667         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
20668
20669 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
20670
20671         * icall.c: Fix build.
20672
20673 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
20674
20675         * Makefile.am: Added security.c|h.
20676         * icall.c: Added icall for get_UserName;
20677         * security.c: New file for security related icalls. Added function
20678         get_UserName for System.Environment (fix #56144).
20679         * security.h: New. Header file for security.c
20680
20681 2004-04-02  Dick Porter  <dick@ximian.com>
20682
20683         * icall.c: Deleted the icalls that were obsoleted some time ago
20684         by the ICU string code, and which were mixed into the icall
20685         rearranging.  Fixes bug 55969.
20686
20687         * string-icalls.h: 
20688         * string-icalls.c: Deleted the code that those icalls reference.
20689
20690 2004-04-01  Martin Baulig  <martin@ximian.com>
20691
20692         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
20693
20694         * class.c (mono_class_from_generic_parameter): Don't set 
20695         TYPE_ATTRIBUTE_INTERFACE.
20696         (my_mono_class_from_generic_parameter): Likewise.
20697
20698 2004-04-01  Martin Baulig  <martin@ximian.com>
20699
20700         * loader.c (find_method): Added an optional `MonoClass *ic'
20701         argument to search in a specific interface.
20702         (mono_get_method_constrained): New public function.
20703
20704 2004-04-01  Martin Baulig  <martin@ximian.com>
20705
20706         * reflection.c (mono_image_get_generic_field_token): Use the
20707         `handleref' cache here.
20708
20709 2004-04-01  Martin Baulig  <martin@ximian.com>
20710
20711         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
20712
20713         * reflection.c (create_generic_typespec): Use the `typespec' hash
20714         here, not the `typeref' one.    
20715
20716 2004-04-01  Martin Baulig  <martin@ximian.com>
20717
20718         * class.c (mono_class_inflate_generic_type): Moved the
20719         functionality into a new static inflate_generic_type() which
20720         returns NULL if it didn't do anything.  Only increment the
20721         `mono_stats.inflated_type_count' if we actually inflated
20722         something.
20723         (mono_class_get_full): Check the classes type to see whether we
20724         need to inflate it; also inflate MONO_TYPE_(M)VAR.
20725
20726 2004-04-01  Jackson Harper  <jackson@ximian.com>
20727
20728         * reflection.c: Set culture for assembly references.
20729         
20730 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
20731
20732         * reflection.[ch], icall.[ch], Fix support for pinning variables.
20733
20734 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20735
20736         * assembly.c:
20737         (do_mono_assembly_open): the critical section also covers
20738         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
20739
20740 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20741
20742         * threads.c:
20743         (mono_manage_threads): abort the background threads when finishing.
20744         Fixes bug #47232.
20745
20746 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20747
20748         * gc.c: only close the done_event handle if there was no timeout.
20749         C-ified comments.
20750
20751 2004-03-30  Martin Baulig  <martin@ximian.com>
20752
20753         * icall.c (icall_entries): It's called "System.Activator", not
20754         "System.Activation".    
20755
20756 2004-03-30  Martin Baulig  <martin@ximian.com>
20757
20758         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
20759         (mono_class_create_from_typespec): Likewise.
20760
20761 2004-03-30  Martin Baulig  <martin@ximian.com>
20762
20763         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
20764         `has_ctor_constraint' and `initialized'.
20765
20766 2004-03-30  Martin Baulig  <martin@ximian.com>
20767
20768         * reflection.c (encode_new_constraint): New static function to add
20769         the constructor constraint attribute to a type parameter.
20770         (encode_constraints): Call encode_new_constraint() if necessary.
20771
20772         * reflection.h
20773         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
20774
20775         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
20776         
20777 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
20778
20779         * reflection.c, icall.c: add support for pinning variables. 
20780
20781 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
20782
20783         * marshal.c (mono_marshal_get_managed_wrapper):
20784         init bool local with zero rather than null.
20785
20786 2004-03-29  Martin Baulig  <martin@ximian.com>
20787
20788         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
20789         the "official" behavior here.
20790         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
20791
20792 2004-03-29  Martin Baulig  <martin@ximian.com>
20793
20794         * icall.c: Reflect latest API changes.
20795
20796 2004-03-29  Martin Baulig  <martin@ximian.com>
20797
20798         * loader.c (mono_get_method_from_token): Also call
20799         mono_metadata_load_generic_params () for abstract and interface
20800         methods; replace the type arguments in the method signature with
20801         the ones which are loaded from the metadata.
20802
20803 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
20804
20805         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
20806         of the lock is not the current thread. MS.NET don't do it, in spite of
20807         what the documentation says. See bug #56157.
20808
20809 2004-03-28  Martin Baulig  <martin@ximian.com>
20810
20811         * class.c (mono_class_init): Don't call init_properties() and
20812         init_events() for generic instances; set `prop->parent' when
20813         inflating properties.
20814
20815         * reflection.c (mono_generic_inst_get_object): Call
20816         `mono_class_init (ginst->klass)'.
20817         (mono_type_get_object): Only create a MonoGenericInst if your
20818         generic type is a TypeBuilder.
20819         (do_mono_reflection_bind_generic_parameters): Only set
20820         `ginst->is_dynamic' if our generic type is a TypeBuilder.
20821
20822 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
20823
20824         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
20825         Fixes #56091.
20826
20827 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20828
20829         * icall.c: added Kill_internal icall.
20830         * process.[ch]: added Kill_internal icall.
20831
20832 2004-03-25  Martin Baulig  <martin@ximian.com>
20833
20834         * class.h (MonoStats): Added `generic_instance_count',
20835         `inflated_method_count', `inflated_type_count' and
20836         `generics_metadata_size'.       
20837
20838 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20839
20840         * reflection.c: no warnings now.
20841
20842 2004-03-25  Martin Baulig  <martin@ximian.com>
20843
20844         * class.c (mono_class_get_full): New public function; does a
20845         mono_class_get(), but also takes a `MonoGenericContext *'.
20846
20847         * loader.c (mono_field_from_memberref): Renamed to
20848         `field_from_memberref', made static and added `MonoGenericContext *'
20849         argument.
20850         (mono_field_from_token): Added `MonoGenericInst *' argument.
20851         (method_from_memberef): Likewise.
20852         (mono_get_method_from_token): Likewise.
20853         (mono_get_method_full): New public function; does a
20854         mono_get_method(), but also takes a `MonoGenericContext *'.
20855
20856         * verify.c (mono_method_verify): Get the method's generic context
20857         and pass it to mono_field_from_token(), mono_get_method_full() and
20858         mono_class_get_full().
20859
20860 2004-03-25  Martin Baulig  <martin@ximian.com>
20861
20862         * class.c (mono_class_inflate_generic_type): Take a
20863         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
20864         `MonoGenericMethod *'.
20865
20866 2004-03-25  Martin Baulig  <martin@ximian.com>
20867
20868         * loader.h (MonoMethodInflated): Store the MonoGenericContext
20869         instead of the MonoGenericMethod here.
20870
20871 2004-03-25  Martin Baulig  <martin@ximian.com>
20872
20873         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
20874         each time we create a new MonoGenericInst, we also create a new
20875         context which points back to us.
20876
20877         * class.c (inflate_method): Use `ginst->context' instead of
20878         creating a new context.
20879
20880         * loader.c (method_from_memberref): Use
20881         `klass->generic_inst->context' instead of creating a new context.
20882
20883 2004-03-25  Martin Baulig  <martin@ximian.com>
20884
20885         * class.h (MonoGenericContext): New struct.
20886         (MonoGenericMethod): Removed `generic_inst'.
20887
20888         * class.c (mono_class_inflate_generic_method): Take a
20889         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
20890
20891 2004-03-25  Martin Baulig  <martin@ximian.com>
20892
20893         * loader.h (MonoMethodInflated): New typedef.
20894
20895         * metadata.h (MonoMethodSignature): Removed `gen_method', make
20896         `generic_param_count' consume just 30 bits, added `is_inflated'
20897         and `has_type_parameters' flags (one bit each).
20898
20899         * class.c (mono_class_inflate_generic_method): Create a
20900         MonoMethodInflated instead of a MonoMethodNormal and set
20901         `is_inflated' in the method signature.
20902
20903         * class.h (MonoGenericMethod): Removed `generic_method'.
20904
20905 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
20906
20907         * image.c: Make sure the name of a MonoImage is always an absolute path.
20908           This fixes bug #54415.
20909
20910 2004-03-24  Martin Baulig  <martin@ximian.com>
20911
20912         * class.c (mono_class_setup_vtable): If we're a generic instance,
20913         use our generic type's vtable size.
20914
20915 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
20916
20917         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
20918         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
20919         problems.
20920
20921 2004-03-23  Martin Baulig  <martin@ximian.com>
20922
20923         * class.h (MonoDynamicGenericInst): Added `int count_events' and
20924         `MonoEvent *events'.
20925
20926         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
20927         (typebuilder_icalls): Added "get_event_info"; calls
20928         mono_reflection_event_builder_get_event_info(). 
20929
20930         * reflection.c (mono_reflection_generic_inst_initialize): Added
20931         `MonoArray *events'.
20932         (mono_reflection_event_builder_get_event_info): New function.
20933
20934 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
20935
20936         * object.h: add mono_type_initialization_init
20937
20938         * object.c (mono_runtime_class_init): 
20939         implement class constructor synchronization rules
20940         to cope with threading issues.  
20941         add mono_type_initialization_init
20942
20943         * appdomain.c (mono_runtime_init): call 
20944         mono_type_initialization_init
20945
20946         * class.h: removing initializing field from MonoVTable
20947
20948 2004-03-23  Martin Baulig  <martin@ximian.com>
20949
20950         * class.c (my_mono_class_from_generic_parameter): Use
20951         `param->name' if it's not NULL. 
20952
20953 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
20954
20955         * class.c: do not insert non-virtual methods in the vtable.
20956         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
20957         that means the method is non-virtual. This never would have
20958         happened before.
20959
20960 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
20961
20962         * profiler.c: Added lock for accessing coverage_hash.
20963
20964 2004-03-22  Martin Baulig  <martin@ximian.com>
20965
20966         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
20967         `method->method->signature->generic_param_count != 0' to make it
20968         work for interface methods.
20969
20970 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20971
20972         * process.c: quote the string passed to the shell using g_shell_quote.
20973
20974 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20975
20976         * threads.c:
20977         (mono_threads_manage): don't remove the finalizer thread and self
20978         from the threads hash table so that mono_thread_manage can be called
20979         more than once.
20980
20981 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20982
20983         * process.c: quote the arguments when UseShellExecute is true. Fixes
20984         bug #55790.
20985
20986 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20987
20988         * threads.c: set mono_thread_detach as a cleanup routine for every
20989         thread. This way it's always executed upon thread termination, either
20990         aborted or finished normally. No more xsp hangs!
20991
20992 2004-03-17  Martin Baulig  <martin@ximian.com>
20993
20994         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
20995         `int count_nested' and a `MonoType **nested'.
20996
20997         * reflection.c (mono_reflection_bind_generic_parameters): Moved
20998         most of the functionality into a new static
20999         do_mono_reflection_bind_generic_parameters() and don't take a
21000         `MonoType *nested_in' argument any more.  Don't compute nested
21001         types here.
21002         (mono_reflection_generic_inst_get_nested_types): New public method
21003         to get nested types.
21004
21005         * class.c (mono_class_create_generic): Set `klass->nested_in' if
21006         we're a nested class.
21007
21008         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
21009         mono_reflection_generic_inst_get_nested_types() to compute the
21010         nested types.
21011
21012 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
21013
21014         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
21015         descriptive error message under windows.
21016         
21017 2004-03-17  Martin Baulig  <martin@ximian.com>
21018
21019         * class.c (dup_type): Added `const MonoType *original' argument;
21020         copy the attrs from the original type.
21021
21022 2004-03-17  Martin Baulig  <martin@ximian.com>
21023
21024         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
21025         `m->generic_inst_cache' here.
21026
21027 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
21028
21029         * exception.h exception.c: Add stack_overflow_exception.
21030
21031 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21032
21033         * threadpool.c:
21034         (overlapped_callback): call SetEvent *after* invoking the callback.
21035         No need to call CloseHandle.
21036
21037 2004-03-16  Martin Baulig  <martin@ximian.com>
21038
21039         * reflection.c (mono_image_get_fieldref_token): Take a
21040         `MonoReflectionField *' instead of a `MonoClassField *' and a
21041         `MonoClass *'; store the `MonoReflectionField *' in the hash.
21042
21043 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21044
21045         * appdomain.c: don't add the culture to the filename we're looking for
21046         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
21047
21048 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21049
21050         * locales.c: don't ignore symbols when doing case insensitive compares.
21051         Thanks Dick! Fixes bug #54046.
21052
21053         * threads.c: surround 'threads' usage with enter/leave in
21054         mono_thread_manage.
21055
21056 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
21057
21058         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
21059         implicitly marshalled as [Out]. Fixes #55450.
21060
21061         (mono_marshal_get_runtime_invoke): Zero out the result if there is
21062         an exception.
21063
21064 2004-03-16  Martin Baulig  <martin@ximian.com>
21065
21066         * class.c (mono_class_from_generic_parameter): Use the actual
21067         parameter name. 
21068
21069 2004-03-16  Martin Baulig  <martin@ximian.com>
21070
21071         * reflection.c (type_get_signature_size): New static function.
21072         Compues the size of the type in a method signature.
21073         (method_get_signature_size): New static function; calls
21074         type_get_signature_size() to compute the actual size of the
21075         method's signature.
21076         (method_encode_signature): Use method_get_signature_size() to get
21077         the signature's size rather than using `nparams * 10'.
21078
21079 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21080
21081         * file-io.h: define here WapiOverlapped on windows. I don't want the
21082         regular OVERLAPPED one.
21083
21084         * file-io.c:
21085         * threadpool.c: somehow, BindIoCompletionCallback is not found.
21086         Disabling AIO on windows.
21087
21088 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21089
21090         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
21091         bug #55385.
21092
21093 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21094
21095         * appdomain.c: upgraded corlib version.
21096
21097         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
21098         and BeginWrite. Allow opening files for asynchrnous operations.
21099
21100         * file-io.h: new struct that maps FileStreamAsyncResult.
21101         * icall.c: added new icalls.
21102         * process.[ch]: support setting child process environment variables
21103         and use the SHELL or COMSPEC when UseShellExecute is true.
21104
21105         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
21106         callback for async. IO is here and also BindHandle.
21107
21108         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
21109         from here.
21110
21111 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
21112
21113         * reflection.c (create_custom_attr): Allow len == 0.
21114
21115         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
21116         computation on big-endian machines.
21117
21118 2004-03-13  Martin Baulig  <martin@ximian.com>
21119
21120         * class.h (MonoGenericInst): Added `int count_ifaces'.
21121
21122         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
21123         `ginst->count_ifaces' instead `klass->interface_count' since we
21124         may get called before the vtable is created.
21125
21126         * loader.c (mono_method_get_param_names): If we're a generic
21127         instance, return and don't initialize the class.
21128
21129         * reflection.c (mono_reflection_setup_generic_class): Don't call
21130         ensure_runtime_vtable().
21131         (mono_reflection_bind_generic_parameters): Set
21132         `ginst->count_ifaces'.
21133
21134 2004-03-11  Jackson Harper <jackson@ximian.com>
21135
21136         * icall.c:
21137         * unicode.c:
21138         * unicode.h: Remove unused System.Char icalls.
21139         
21140 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
21141
21142         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
21143         code when we P/Invoke the first library in Windows.Forms, instead
21144         of when we first open the assembly.
21145
21146         * assembly.c: Drop the lookup from here.
21147
21148 2004-03-10  Martin Baulig  <martin@ximian.com>
21149
21150         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
21151         class for properties, fields and events.  Finally fixes #54945.
21152
21153 2004-03-10  Martin Baulig  <martin@ximian.com>
21154
21155         * metadata.c (mono_metadata_class_equal): New static function;
21156         checks whether two generic instances or two generic parameters are
21157         equal.
21158         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
21159         compare classes.        
21160
21161 2004-03-10  Martin Baulig  <martin@ximian.com>
21162
21163         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
21164
21165         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
21166         argument and write it into the `reflection_info' field.
21167
21168         * icall.c
21169         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
21170         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
21171
21172 2004-03-09  Jackson Harper  <jackson@ximian.com>
21173
21174         * char-conversions.h: use 8 bits for numeric data its all we need
21175         * icall.c: numeric data is only 8 bits now.
21176
21177 2004-03-09  Martin Baulig  <martin@ximian.com>
21178
21179         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
21180
21181         * class.c (init_properties, init_events): Initialize the new
21182         `parent' field.
21183
21184         * reflection.c (typebuilder_setup_properties): Likewise.
21185         (typebuilder_setup_events): Likewise.
21186
21187         * reflection.h (MonoEventInfo): Replaced `parent with
21188         `declaring_type' and `reflected_type'.
21189
21190         * icall.c (ves_icall_get_property_info): Distinguish between
21191         declaring and reflected type.
21192         (ves_icall_get_event_info): Likewise.
21193
21194 2004-03-09  Martin Baulig  <martin@ximian.com>
21195
21196         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
21197         (ves_icall_Type_GetField): Correctly set field->klass.
21198
21199 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
21200
21201         * loader.h: Fix warning.
21202
21203 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
21204
21205         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
21206         library routine if present.  Notice that it will still continue
21207         executing even if its missing, for those working on the Gtk#
21208         edition of Windows.Forms.
21209
21210         * assembly.c (do_mono_assembly_open): If loading the
21211         System.Windows.Forms call mono_loader_wini_init.
21212
21213 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
21214
21215         * class.h: Added MonoRemoteClass struct.
21216         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
21217         function for MonoStrings.
21218         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
21219         Added internal call for getting the proxy type.
21220         * marshal.c: Get the type of transparent proxies from its remote_class.
21221         Added methods that generate the IL for type checks and casts:
21222         mono_marshal_get_isinst, mono_marshal_get_castclass, 
21223         mono_marshal_get_proxy_cancast.
21224         * marshal.h: Declaration of the previous new methods.
21225         * object.c: Added new moethods for creating and updating MonoRemoteClass
21226         instances: mono_remote_class, mono_upgrade_remote_class, 
21227         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
21228         * verify.c: FIx transparent_proxy_fields layout.
21229         * appdomain.c: Bump corlib version.
21230
21231 2004-03-04  Jackson Harper  <jackson@ximian.com>
21232
21233         * icall.c: Add icall to access char conversion tables.
21234         * char-conversions.h: Character conversion tables.
21235         * Makefile.am: Add char-conversions.h private header file.
21236         
21237 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
21238
21239         * appdomain.c (unload_thread_main): Increase unloading timeout to
21240         10 sec as a temporary workaround for Nant problems.
21241
21242 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
21243
21244         * gc.c: Add checks for GC_enable and GC_disable.
21245
21246         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
21247         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
21248         (bug #54988).
21249         
21250 2004-02-27  Martin Baulig  <martin@ximian.com>
21251
21252         * reflection.c (mono_reflection_bind_generic_parameters): Take a
21253         `MonoReflectionType *' instead of a `MonoType *'.
21254
21255 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
21256
21257         * gc.c (run_finalize): Avoid finalizing the object representing the
21258         finalizer thread.
21259         (finalizer_thread): Fix warning.
21260
21261 2004-02-25  Martin Baulig  <martin@ximian.com>
21262
21263         * class.c (_mono_class_get_instantiation_name): Added `int offset'
21264         argument for nested types.
21265         (mono_class_create_generic): Added support for nested generictypes.
21266
21267         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
21268         `GList *nested'.
21269
21270         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
21271
21272         * reflection.c (method_encode_signature): Increase the minimum
21273         value of `size' from 10 to 11.
21274         (mono_reflection_bind_generic_parameters): Take `int type_argc'
21275         and `MonoType **types' arguments instead of the `MonoArray
21276         *types'; added `MonoType *nested_in'.  Recursively instantiate
21277         nested classes. 
21278
21279 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
21280
21281         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
21282         stack_overflow_ex members which are used by exception handling.
21283
21284         * appdomain.c (mono_runtime_init): Initialize the new members.
21285
21286         * gc.c (mono_gc_enable): New helper function.
21287         * gc.c (mono_gc_disable): New helper function.
21288
21289 2004-02-23  Martin Baulig  <martin@ximian.com>
21290
21291         * icall.c: I must have been really stupid - make it actually work
21292         this time ;-)
21293
21294 2004-02-23  Martin Baulig  <martin@ximian.com>
21295
21296         * loader.c (method_from_memberref): Only inflate the method if
21297         it's in another klass.
21298
21299 2004-02-23  Martin Baulig  <martin@ximian.com>
21300
21301         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
21302         (mono_class_init): If we're a generic instance and an interface,
21303         compute `class->interface_id'; also create `class->interfaces'
21304         here and inflate them.
21305
21306         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
21307         `ginst->is_open'.
21308         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
21309
21310         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
21311
21312 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
21313
21314         * reflection.c (method_encode_code): Improved the error message
21315         generated by the exception.
21316
21317 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21318
21319         * icall.c: Martin did not do what he said in the ChangeLog for
21320         2004-02-18, but put back the changes for properties and events.
21321         Commenting those changes out again and adding comment to bug #54518.
21322         
21323         * process.c: removed warning.
21324
21325 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
21326
21327         * marshal.c (emit_struct_conv): Print an error message instead of
21328         asserting when a type does not have the StructLayout attribute.
21329
21330 2004-02-20  Martin Baulig  <martin@ximian.com>
21331
21332         * reflection.c (mono_type_get_object): Also use the cache for
21333         generic instances.
21334         (mono_reflection_bind_generic_parameters): Always compute
21335         `ginst->ifaces'.        
21336
21337 2004-02-20  Martin Baulig  <martin@ximian.com>
21338
21339         * class.h (MonoGenericMethod): Removed `klass'.
21340
21341         * class.c (mono_class_inflate_generic_method): Added `MonoClass
21342         *klass' argument.
21343
21344 2004-02-20  Martin Baulig  <martin@ximian.com>
21345
21346         * reflection.c (method_encode_methodspec): Actually use the
21347         uninflated signature for the memberref.
21348
21349 2004-02-20  Martin Baulig  <martin@ximian.com>
21350
21351         * class.h (MonoGenericMethod): Removed `declaring'.
21352
21353         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
21354         is NULL, compute it here.
21355
21356 2004-02-20  Martin Baulig  <martin@ximian.com>
21357
21358         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
21359
21360         * metadata.c (mono_metadata_generic_inst_hash): New method.
21361         (mono_metadata_generic_inst_equal): New method.
21362
21363         * reflection.c (mono_reflection_bind_generic_parameters): Use the
21364         `klass->image->generic_inst_cache' cache to avoid creating
21365         duplicate MonoGenericInst's.
21366
21367         * class.c (mono_class_inflate_generic_type): Use the cache.
21368
21369 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
21370
21371         * object.c: fixed gc descriptor calculation for embedded valuetypes.
21372
21373 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21374
21375         * icall.c: added Socket.WSAIoctl icall.
21376
21377         * socket-io.[ch]: implemented
21378         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
21379
21380 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
21381
21382         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
21383
21384 2004-02-18  Urs C Muff  <umuff@quark.com>
21385
21386         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
21387         this work on PPC and other big-endian architectures.
21388
21389         * debug-mono-symfile.h: Prepended the names of all the `guint32'
21390         fields with an underscore to make sure they're only accessed by
21391         the read32() macro.
21392
21393 2004-02-18  Martin Baulig  <martin@ximian.com>
21394
21395         * icall.c: Put the klass->refclass changes back for methods and
21396         fields, but not for properties and events.  We're currently not
21397         distinguishing between DeclaringType and ReflectedType for
21398         properties and events, that's what caused the regressions.
21399
21400 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21401
21402         * object.c:
21403         (mono_async_result_new): the handle can be NULL.
21404
21405         * threadpool.c: Use an event instead of a semaphore, don't initialize
21406         it until needed. This saves quite a few semaphores from being created
21407         when using the threadpool.
21408
21409 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
21410
21411         * object.c (mono_string_is_interned_lookup): Fix interning of long
21412         strings. Fixes #54473.
21413
21414         * domain.c (ldstr_equal): Optimize if the two strings are equal.
21415
21416         * icall.c: Revert the klass->refclass changes since they introduce
21417         regressions (bug #54518).
21418
21419 2004-02-18  Martin Baulig  <martin@ximian.com>
21420
21421         * class.c (mono_class_init): If we're a generic instance and don't
21422         come from a TypeBuilder, inflate our members here.
21423         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
21424         (mono_class_create_generic): New public method.
21425         (mono_class_initialize_generic): Removed.
21426         (get_instantiation_name): Renamed to
21427         _mono_class_get_instantiation_name() and made it public.
21428
21429 2004-02-18  Martin Baulig  <martin@ximian.com>
21430
21431         * class.c (mono_class_inflate_generic_type): Clear the new
21432         instance's `nginst->klass' when inflating a generic instance.
21433         (mono_class_is_subclass_of): Added (basic) support for generic
21434         instances.
21435
21436 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
21437
21438         * appdomain.h, domain.c: use a MonoCodeManager instead of a
21439         MonoMempool to hold compiled native code.
21440
21441 2004-02-17  Martin Baulig  <martin@ximian.com>
21442
21443         * class.h (MonoDynamicGenericInst): Added `count_properties' and
21444         `properties'.
21445
21446         * reflection.c (mono_reflection_generic_inst_initialize): Added
21447         `MonoArray *properties' argument.
21448
21449         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
21450
21451 2004-02-17  Martin Baulig  <martin@ximian.com>
21452
21453         * icall.c (ves_icall_Type_GetFields): Renamed to
21454         ves_icall_Type_GetFields_internal() and added a
21455         `MonoReflectionType *rtype' argument; pass it to
21456         mono_field_get_object() to set the field's "reflected" type.
21457         (ves_icall_Type_GetConstructors): Likewise.
21458         (ves_icall_Type_GetEvents): Likewise.
21459         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
21460         argument; pass it to mono_method_get_object() to set the method's
21461         "reflected" type.       
21462
21463 2004-02-17  Martin Baulig  <martin@ximian.com>
21464
21465         * class.h (MonoDynamicGenericInst): New type.
21466         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
21467
21468         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
21469         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
21470         (ves_icall_MonoGenericInst_GetFields): New interncall.
21471
21472         * class.c (mono_class_from_generic): Don't call
21473         mono_class_initialize_generic() if this is a dynamic instance;
21474         ie. it's being created from a TypeBuilder.
21475         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
21476         `class->byval_arg.type'.
21477
21478         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
21479         to `inflate_method' and made static.
21480         (mono_reflection_inflate_field): Removed.
21481         (mono_reflection_generic_inst_initialize): New public method.
21482
21483         * reflection.h (MonoReflectionGenericInst): Removed `methods',
21484         `ctors' and `fields'; added `initialized'.
21485
21486 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
21487
21488         * debug-helpers.c (mono_method_full_name): Fix output for empty
21489         namespaces.
21490
21491 2004-02-12  Martin Baulig  <martin@ximian.com>
21492
21493         * class.h (MonoClassField): Added `MonoType *generic_type'.
21494
21495         * reflection.c (mono_image_get_fieldref_token): Added support for
21496         instantiated generic types.
21497         (field_encode_inflated_field): Removed.
21498         (mono_image_get_inflated_field_token): Removed.
21499         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
21500
21501         * reflection.h (MonoReflectionInflatedField): Removed.
21502
21503 2004-02-12  Martin Baulig  <martin@ximian.com>
21504
21505         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
21506         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
21507
21508         * reflection.c (mono_image_get_methodspec_token): Take a
21509         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
21510         (mono_image_create_token): Check whether we have a
21511         `method->signature->gen_method' and call
21512         mono_image_get_methodspec_token() if appropriate.
21513         (inflated_method_get_object): Removed.
21514         (mono_reflection_bind_generic_method_parameters): Return a
21515         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
21516         (mono_reflection_inflate_method_or_ctor): Likewise.
21517
21518         * reflection.h (MonoReflectionInflatedMethod): Removed.
21519
21520 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
21521
21522         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
21523         for custom valuetype marshalling.
21524
21525         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
21526
21527 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21528
21529         * icall.c: fixed WSAGetLastError_internal name.
21530
21531 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
21532
21533         * threads.c (mono_thread_attach): Allow this to be called multiple
21534         times for a thread.
21535         
21536         * threads.c (build_wait_tids): Do not wait for ourselves.
21537
21538         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
21539         appdomain list is empty.
21540
21541         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
21542         memory returned by mono_string_builder_to_utf16, since it points into
21543         managed memory. Thanks to Bernie Solomon for noticing this.
21544
21545         * icall.c: Add AppDomainSetup icalls.
21546
21547         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
21548
21549         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
21550         types.
21551
21552         * reflection.c (reflection_methodbuilder_to_mono_method): Save
21553         custom attributes to the method_aux struct. Also fix array indexes etc.
21554
21555         * loader.c (mono_method_get_param_names): Make dynamic case work again.
21556         
21557 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
21558
21559         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
21560         (both static and runtime) and reduce startup time.
21561
21562 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
21563
21564         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
21565         AsAny marshalling conversion instead of crashing.
21566
21567         * marshal.c: Fix warnings.
21568
21569 2004-02-09  Martin Baulig  <martin@ximian.com>
21570
21571         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
21572
21573         * reflection.h (MonoReflectionInflatedMethod): Removed the
21574         `declaring' field, it's now in the unmanaged MonoGenericMethod.
21575
21576         * reflection.c (method_encode_methodspec): Removed the `method'
21577         argument; we get it from `gmethod->declaring'.
21578         (inflated_method_get_object): Removed the `declaring' argument.
21579
21580 2004-02-09  Martin Baulig  <martin@ximian.com>
21581
21582         * class.h (MonoGenericMethod): New type.
21583         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
21584         `generic_method'.
21585
21586         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
21587         a `MonoGenericMethod *gen_method' one.
21588
21589         * class.c (mono_class_inflate_generic_type): Take an additional
21590         `MonoGenericMethod * argument.  This is only non-NULL if we're
21591         inflating types for a generic method.   
21592         (mono_class_inflate_generic_signature): Renamed to
21593         inflate_generic_signature() and made static; take a
21594         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
21595         (inflate_generic_header): Take a `MonoGenericMethod *' argument
21596         instead of a `MonoGenericInst *' one.
21597         (mono_class_inflate_generic_method): Likewise.
21598
21599         * reflection.c (encode_generic_method_sig): Take a
21600         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
21601         (method_encode_methodspec): Likewise.
21602         (inflated_method_get_object): Likewise. 
21603
21604         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
21605         field with a `MonoGenericMethod *gmethod' one.  
21606
21607 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
21608
21609         * class.h (mono_class_has_parent): add parens to expansion
21610         so you can ! this.
21611
21612 2004-02-08  Martin Baulig  <martin@ximian.com>
21613
21614         * image.h (MonoImage): Removed `generics_cache'.
21615
21616         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
21617         instead of a `MonoType *' argument; removed the `inflate_methods'
21618         argument.  Don't inflate methods here.
21619
21620         * loader.c (find_method): If it's a generic instance, call
21621         mono_class_init() on the `sclass->generic_inst->generic_type'.
21622
21623         * metadata.c (mono_type_size): Make this work on uninitialized
21624         generic instances; call it on the `ginst->generic_type's class.
21625
21626         * reflection.c (mono_reflection_bind_generic_parameters): Call
21627         mono_class_from_generic() to create the `ginst->klass'.
21628
21629 2004-02-08  Martin Baulig  <martin@ximian.com>
21630
21631         * class.h (MonoClass): Changed type of `generic_inst' from
21632         `MonoType *' to `MonoGenericInst *'.
21633
21634 2004-02-08  Martin Baulig  <martin@ximian.com>
21635
21636         * icall.c (ves_icall_Type_BindGenericParameters): Just call
21637         mono_type_get_object(), this is now creating a `MonoGenericInst'
21638         for MONO_TYPE_GENERICINST.
21639         (ves_icall_MonoGenericInst_GetParentType): Likewise.
21640         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
21641
21642         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
21643         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
21644         (inflated_method_get_object): Added `MonoClass *refclass' argument.
21645         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
21646         and reflected type.
21647
21648         * reflection.h (MonoReflectionInflatedMethod): Removed
21649         `declaring_type' and `reflected_type'.
21650
21651 2004-02-08  Martin Baulig  <martin@ximian.com>
21652
21653         * class.h (MonoGenericInst): Added `MonoType *parent' and
21654         `MonoType **ifaces'.
21655
21656         * reflection.h (MonoReflectionGenericInst): Removed `klass',
21657         `parent' and `interfaces'.
21658
21659         * reflection.c (mono_reflection_bind_generic_parameters): Take a
21660         `MonoType *' argument and return a `MonoType *'.
21661
21662         * icall.c
21663         (ves_icall_MonoGenericInst_GetParentType): New interncall.
21664         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
21665
21666 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
21667
21668         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
21669         valuetype marshalling.
21670
21671 2004-02-06  Martin Baulig  <martin@ximian.com>
21672
21673         * class.c
21674         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
21675         (my_mono_class_from_generic_parameter): Likewise.
21676
21677 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
21678
21679         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
21680         contents of the symbol files lazily.
21681
21682         * object.h (MonoThread): Add 'name' and 'name_len' fields.
21683
21684         * threads.h threads.c icall.c: New icalls for getting and setting the
21685         threads name.
21686
21687 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
21688
21689         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
21690         Raise an exception when the domain is not found.
21691
21692 2004-02-03  Martin Baulig  <martin@ximian.com>
21693
21694         * reflection.c (mono_image_get_methodspec_token): Use the
21695         uninflated signature; fixes gen-33.
21696
21697 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
21698
21699         * gc.c threads.c: Make the finalizer thread a normal managed thread so
21700         the finalizer code can use thread functionality.
21701
21702         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
21703         the finalizer thread.
21704
21705         * threads.c: Make some functions more robust.
21706
21707         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
21708
21709         * metadata.h: Add new marshalling conventions.
21710
21711         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
21712         stringbuilder marshalling. Fixes #53700.
21713
21714         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
21715
21716         * reflection.c (mono_image_get_type_info): Save declarative security
21717         info.
21718
21719         * reflection.c (mono_image_get_field_info): Handle uninitialized 
21720         unmanaged fields as well.
21721
21722         * appdomain.c: Bump corlib version.
21723
21724 2004-02-01  Martin Baulig  <martin@ximian.com>
21725
21726         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
21727         method type arguments.  
21728
21729 2004-01-30  Duncan Mak  <duncan@ximian.com>
21730
21731         * marshal.h: Add prototype for
21732         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
21733         and
21734         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
21735         fix the build.
21736
21737 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
21738
21739         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
21740         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
21741
21742 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
21743
21744         * marshal.c (mono_marshal_get_native_wrapper): Add support for
21745         custom marshalling of valuetypes.
21746
21747         * marshal.c: Fix some warnings.
21748
21749 2004-01-29  Martin Baulig  <martin@ximian.com>
21750
21751         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
21752         for generic method parameters.
21753
21754         * reflection.c (method_encode_methodspec): Write the uninflated
21755         signature into the methodspec table.
21756         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
21757         is always the uninflated method.
21758         (reflection_methodbuilder_to_mono_method): Copy the generic
21759         parameters from the MethodBuilder into `header->gen_params'.
21760
21761 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
21762
21763         * class.c (mono_class_from_generic_parameter): Fix warning.
21764
21765 2004-01-27  Martin Baulig  <martin@ximian.com>
21766
21767         * class.c (mono_class_from_generic_parameter): Don't create
21768         `klass->methods' here.  
21769
21770 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
21771
21772         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
21773         extension since it does not work with libraries named lib<FOO>.dll.so.
21774
21775 2004-01-25  Martin Baulig  <martin@ximian.com>
21776
21777         * class.c (mono_class_inflate_generic_type): Added support for
21778         MONO_TYPE_GENERICINST.
21779
21780         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
21781         inflate methods on open constructed types.      
21782
21783 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21784
21785         * object.c: fire ProcessExit event in the root AppDomain after running
21786         Main. Fixes bug #53299.
21787
21788 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
21789
21790         * socket-io.c: include the new socket-wrappers.h header.
21791         Use the wrappers instead of the unix socket functions to make the code
21792         more clear.
21793
21794 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
21795
21796         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
21797
21798         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
21799         Fixes #22532.
21800
21801 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
21802
21803         * reflection.c (mono_image_create_pefile): Handle the case when the
21804         entry point is not a MethodBuilder.
21805
21806         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
21807         field to ReflectionMethod since it is not allways a builder.
21808
21809         * reflection.c (type_get_fully_qualified_name): New helper function to
21810         return the fully qualified name of a type.
21811
21812         * reflection.c (encode_marshal_blob): Always emit the fully qualified
21813         type name for custom marshallers.
21814
21815         * reflection.c (mono_marshal_spec_from_builder): Ditto.
21816
21817         * class.c (mono_class_setup_vtable): If a parent class already 
21818         implements an interface, use the implementing methods from that class.
21819         Fixes #53148.
21820
21821 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21822
21823         * threadpool.c: just return instead of ExitThread to allow for thread
21824         clean up earlier.
21825
21826 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
21827
21828         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
21829         when closing resource modules.
21830
21831         * reflection.c (mono_image_create_pefile): Handle the case when the
21832         entry point is not a MethodBuilder.
21833
21834         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
21835         field to ReflectionMethod since it is not allways a builder.
21836
21837 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
21838
21839         * marshal.c (mono_marshal_get_managed_wrapper): 
21840         mono_marshal_alloc takes native int so CONV_I
21841         the arg for 64bits.
21842
21843 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
21844
21845         * reflection.c (fixup_cattrs): New function to fixup the methoddef
21846         tokens in the cattr table. Fixes #53108.
21847
21848 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21849
21850         * loader.c: don't trim ".dll" before looking up in the config file.
21851         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
21852
21853 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
21854
21855         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
21856         Return the module which contains the resource as well.
21857         (ves_icall_System_Reflection_Module_Close): New icall.
21858
21859         * appdomain.c: Bump corlib version number.
21860
21861         * image.c (mono_image_addref): New public function.
21862
21863         * assembly.c: Call mono_image_addref.
21864
21865         * reflection.c (mono_module_get_object): Increase reference count of 
21866         the image.
21867
21868         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
21869         Fixes #22532.
21870
21871         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
21872         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
21873         proper exceptions on DllImport problems.
21874
21875 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
21876
21877         * class.c, metadata.c: eliminate CSIZE macro.
21878
21879 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
21880
21881         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
21882         * object.h: Added async_callback field in MonoAsyncResult.
21883         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
21884         * verify.c: Added async_callback in MonoAsyncResult layout.
21885
21886 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
21887
21888         * reflection.c (mono_reflection_get_custom_attrs): Add support
21889         for Modules.
21890
21891 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
21892
21893         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
21894         marshalling.
21895         (mono_marshal_method_from_wrapper): Add null pointer check.
21896
21897 2004-01-16  Martin Baulig  <martin@ximian.com>
21898
21899         * debug-mono-symfile.h: Set version number to 36 and reflect
21900         latest symbol writer changes.
21901
21902 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
21903
21904         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
21905         multi-dimensional arrays.
21906         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
21907         (mono_class_from_mono_type): Use bounded_array_class_get.
21908         
21909         * class.c (mono_bounded_array_class_get): New function which takes
21910         a 'bounded' bool argument to distinguish vectors from one dimensional
21911         arrays.
21912
21913         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
21914         bounded_array_class_get if the array has bounds.
21915
21916         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
21917         Search modules loaded using AssemblyBuilder:AddModule as well.
21918
21919 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21920
21921         * appdomain.c: increased corlib version.
21922         * filewatcher.c: removed g_print.
21923         * icall.c:
21924         (get_property_info): only allocate what is actually requested.
21925         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
21926
21927 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21928
21929         * Makefile.am: added filewatcher.[ch]
21930         * filewatcher.[ch]: FileSystemWatcher runtime support.
21931         * icall.c: added new FSW icalls.
21932
21933 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
21934
21935         * string-icalls.c: fix stringbuilder regression as suggested by
21936         Iain McCoy <iain@mccoy.id.au>.
21937
21938 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
21939
21940         * process.c (process_read_stringtable_block): Recognize '007f' as
21941         a language neutral stringtable block.
21942
21943 2004-01-12  Patrik Torstensson
21944
21945         * object.h (MonoStringBuilder) : Changed layout to support our
21946         new stringbuilder class.
21947         * marshal.c: Change marshalling to support the new layout of 
21948         string builder.
21949         * appdomain.c: increased version number because new layout of
21950         string builder.
21951
21952 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
21953
21954         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
21955         assembly name as an string instead of an AssemblyName, since it is
21956         easier to extract info from it.
21957
21958         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
21959         the culture subdirectories too. Fixes #52231.
21960
21961 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21962
21963         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
21964         It takes 2 new parameters with an optional name for the method to look
21965         for and case ignoring info.
21966
21967         * threadpool.c: removed unused variable.
21968
21969 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21970
21971         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
21972         It takes 2 new parameters with an optional name for the property to look
21973         for and case ignoring info.
21974         Fixes bug #52753.
21975
21976 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
21977
21978         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
21979         Fix #52451.
21980
21981 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21982
21983         * appdomain.c:
21984         * assembly.c: escape the uri before passing it to g_filename_from_uri.
21985         Fixes bug #52630.
21986
21987 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
21988
21989         * reflection.c: Add support for more than one unmanaged resource.
21990
21991         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
21992         in field->def_value, as done in all other cases.
21993
21994         * reflection.c (mono_reflection_get_custom_attrs): Add support for
21995         TypeBuilders.
21996
21997         * reflection.c (mono_reflection_create_runtime_class): Remove 
21998         errorneous assignment to klass->element_class, since it is already
21999         done in mono_reflection_setup_internal_class.
22000
22001 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22002
22003         * gc.c: added missing LeaveCriticalSection.
22004         * icall.c: indented a couple of lines.
22005         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
22006         if we call EndInvoke inside a callback. Fixes bug #52601.
22007
22008 2004-01-07  Martin Baulig  <martin@ximian.com>
22009
22010         * mono-debug-debugger.h
22011         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
22012
22013 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
22014
22015         * appdomain.c: Use messages in NotImplementedException.
22016
22017         * exception.c (mono_get_exception_not_implemented): Now this takes
22018         a message argument.
22019
22020         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
22021         exception instead of g_asserting an aborting when something is not
22022         implemented.
22023
22024         Add some inline docs.
22025
22026 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
22027
22028         * reflection.h: Update after changes to object layout.
22029
22030         * reflection.c: Implement saving of unmanaged aka win32 resources.
22031
22032         * appdomain.c: Bump version number.
22033
22034         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
22035         Handle missing domains gracefully.
22036
22037 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
22038
22039         * file-io.c : On Windows, there are much more invalid_path_chars.
22040
22041 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
22042
22043         * class.h, object.c: prepare for GetType () speedup.
22044
22045 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
22046
22047         * profiler.c: workaround for --profile null reference exception on
22048           cygwin. Patch by Patrik Torstensson.
22049
22050 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
22051
22052         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
22053         make work for unaligned access.
22054
22055 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
22056
22057         * class.c: small cleanup (class->fields [i] -> field).
22058         * image.c: check address of metadata is valid.
22059
22060 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
22061
22062         * assembly.h assembly.c (mono_assembly_loaded): New public function to
22063         search the list of loaded assemblies.
22064
22065         * reflection.c (mono_reflection_type_from_name): Use 
22066         mono_assembly_loaded instead of mono_image_loaded.
22067
22068         * reflection.c: Fix warnings.
22069
22070 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
22071
22072         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
22073         is dynamic. This is needed since an assembly can contain both dynamic and
22074         non-dynamic images.
22075
22076         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
22077         assembly->dynamic.
22078
22079         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
22080
22081         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
22082         to store modules loaded using AddModule.
22083
22084         * reflection.c (mono_image_fill_file_table): Generalize this so it works
22085         on Modules.
22086
22087         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
22088
22089         * reflection.c (mono_image_fill_export_table_from_module): New function to
22090         fill out the EXPORTEDTYPES table from a module.
22091
22092         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
22093         into a separate function. Also handle loaded non-dynamic modules.
22094
22095         * reflection.c (mono_image_basic_init): Fix memory allocation.
22096
22097         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
22098
22099         * assembly.c (mono_assembly_load_references): Make this public.
22100
22101 2003-12-19  Martin Baulig  <martin@ximian.com>
22102
22103         * class.c (mono_class_initialize_generic): Made this static, take
22104         a `MonoGenericInst *' instead of a `MonoClass *'.
22105         (mono_class_from_generic): Call mono_class_initialize_generic()
22106         unless we're already initialized or being called from
22107         do_mono_metadata_parse_generic_inst().
22108
22109         * class.h (MonoGenericInst): Added `initialized' and
22110         `init_pending' flags.
22111
22112         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
22113         `mono_class_init (gklass)' or mono_class_initialize_generic()
22114         here; set `generic_inst->init_pending' while parsing the
22115         `type_argv'.
22116
22117 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
22118
22119         * locales.c: include string.h for memxxx prototypes
22120
22121 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
22122
22123         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
22124         constructor when accessing literal fields.
22125
22126 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
22127
22128         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
22129
22130         * reflection.c (assembly_add_resource_manifest): New function to fill
22131         the MANIFESTRESOURCE table.
22132
22133         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
22134
22135         * reflection.h: Update to changes in class layout.
22136
22137         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
22138         Reenable call to mono_runtime_is_shutting_down ().
22139
22140         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
22141         determine if the runtime is shutting down.
22142
22143 2003-12-16  Jackson Harper <jackson@ximian.com>
22144
22145         * icall.c: comment out call to mono_runtime_is_shutting_down to
22146         fix build.
22147         
22148 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
22149
22150         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
22151         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
22152
22153 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
22154
22155         * reflection.c: move definition of swap_with_size
22156         to before its first call
22157
22158 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
22159
22160         * appdomain.c (mono_runtime_is_shutting_down): New public function.
22161
22162         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
22163         icall.
22164
22165         * object.c: Fix warnings.
22166
22167         * icall.c (ves_icall_Type_Get...): Only consider inherited static
22168         members if FlattenHierarchy is set.
22169
22170         * reflection.c (mono_image_add_decl_security): New function to emit
22171         declarative security.
22172
22173         * reflection.h reflection.c: Add support for declarative security.
22174
22175         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
22176         
22177 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
22178
22179         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
22180         
22181         * appdomain.c verify.c: Moved corlib version checking into its own
22182         function in appdomain.c since it needs to create vtables etc.
22183
22184 2003-12-13  Patrik Torstensson <p@rxc.se>
22185
22186         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
22187         instead of unwrapped server.
22188
22189 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
22190
22191         * verify.c (check_corlib): Fix field index.
22192
22193 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
22194
22195         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
22196         GetGacPath icall.
22197
22198 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
22199
22200         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
22201         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
22202         cope with sizeof(size_t) != sizeof(guint32).
22203
22204 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22205
22206         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
22207         in case of failure.
22208
22209 2003-12-10  Mark Crichton <crichton@gimp.org>
22210
22211         * icall.c: removed the GetNonZeroBytes.  We now handle this case
22212         in managed code.
22213
22214         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
22215
22216 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
22217
22218         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
22219         marked as deleted.
22220
22221 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
22222
22223         * verify.c (check_corlib): Handle the case when the version field is 
22224         initialized by a static constructor.
22225
22226 2003-12-08  Patrik Torstensson  <p@rxc.se>
22227
22228     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
22229
22230 2003-12-08  Martin Baulig  <martin@ximian.com>
22231
22232         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
22233         a MonoReflectionGenericParameter, also take the parameter index
22234         and name as arguments.
22235         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
22236         (ves_icall_MonoGenericParam_initialize): New interncall.
22237         (ves_icall_Type_make_byref_type): New interncall.
22238
22239         * reflection.h (MonoReflectionGenericParam): Derive from
22240         MonoReflectionType, not just from MonoObject.  Added `refobj' and
22241         `index' fields.
22242
22243         * reflection.c (mono_reflection_define_generic_parameter): Create
22244         and return a new MonoReflectionGenericParam; don't initialize the
22245         constraints here.
22246         (mono_reflection_initialize_generic_parameter): New public method;
22247         initializes the constraints and creates the `param->pklass'.
22248
22249 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
22250
22251         * reflection.h reflection.c: Use the new fields 'num_types', 
22252         'num_fields' and 'num_methods' to track the number of types etc.
22253
22254         * verify.c (check_corlib): Check corlib version number.
22255
22256 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
22257
22258         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
22259         function works on all methods.
22260
22261 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
22262
22263         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
22264         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
22265         the custom_type_info flag of the transparent proxy.
22266         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
22267         objects that supports IRemotingTypeInfo.
22268         * object.h: Added custom_type_info field in transparent proxy.
22269
22270 2003-12-06  Martin Baulig  <martin@ximian.com>
22271
22272         * class.c (mono_class_create_from_generic): Removed.
22273         (mono_class_from_generic): Check `ginst->klass' before doing
22274         anything else.  This is important to fully support "recursive"
22275         generic types.
22276
22277         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
22278         empty `generic_inst->klass' before doing anything else.
22279
22280 2003-12-06  Dick Porter  <dick@ximian.com>
22281
22282         * verify.c: 
22283         * object.h:
22284         * icall.c:
22285         * locales.c: Use C structs to access class fields.  Don't do a
22286         conversion between MonoString and UChar because both are
22287         platform-endian UTF-16.  Compare now takes startindex and count
22288         parameters.  Add a char overload for IndexOf.  Speed up the
22289         invariant string IndexOf.
22290
22291 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
22292
22293         * Makefile.am (monosn_LDADD): Fix parallel build.
22294
22295 2003-12-04  Martin Baulig  <martin@ximian.com>
22296
22297         * icall.c
22298         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
22299         (ves_icall_Type_make_array_type): New interncall.       
22300
22301 2003-12-04  Martin Baulig  <martin@ximian.com>
22302
22303         * locales.c: also change it in the !HAVE_ICU case.
22304
22305 2003-12-04  Dick Porter  <dick@ximian.com>
22306
22307         * icall.c:
22308         * locales.c: construct_compareinfo is now in CompareInfo, not
22309         CultureInfo.
22310
22311 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
22312
22313         * image.c (mono_image_load_file_for_image): Cache loaded images in the
22314         image->files array.
22315
22316         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
22317         table as well.
22318
22319         * assembly.c (mono_assembly_load_references): Only load references
22320         once.
22321
22322         * class.c (mono_class_from_name): Avoid linear search of the 
22323         EXPORTEDTYPE table.
22324
22325         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
22326
22327 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
22328
22329         * image.h (MonoImage): Add 'field_cache' field.
22330
22331         * loader.c (mono_field_from_token): Cache field lookups.
22332         
22333         * reflection.c (mono_module_get_object): Fix name property.
22334
22335         * icall.c (ves_icall_get_enum_info): Update after changes to 
22336         mono_metadata_get_constant_index ().
22337
22338         * icall.c: Get rid of get_type_info icall, use a separate icall for
22339         each type property to avoid needless memory allocations. Fixes #51514.
22340
22341         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
22342         to avoid needless binary searches.
22343
22344         * class.c (class_compute_field_layout): Move the initialization of
22345         field->def_value to mono_class_vtable ().
22346
22347         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
22348         non-corlib types.
22349
22350         * object.c (mono_object_allocate): Make it inline.
22351
22352         * object.c (mono_object_allocate_spec): Make it inline.
22353         
22354 2003-12-02  Dick Porter  <dick@ximian.com>
22355
22356         * locales.c (create_NumberFormat): NumberFormatInfo construction.
22357         Patch by Mohammad DAMT (mdamt@cdl2000.com).
22358
22359 2003-12-01  Dick Porter  <dick@ximian.com>
22360
22361         * threads.c: Fix signature and call in CreateMutex and
22362         CreateEvent.
22363
22364 2003-12-01  Dick Porter  <dick@ximian.com>
22365
22366         * icall.c: 
22367         * locales.c: Implement string compares and searching
22368
22369         * object.h: Add extra Thread field
22370
22371 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
22372
22373         * reflection.c (fixup_method): Add support for MonoCMethod.
22374
22375 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
22376
22377         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
22378
22379         * reflection.c (assembly_name_to_aname): Allow extra characters in
22380         assembly names. Fixes #51468.
22381
22382 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
22383
22384         * exception.c (mono_exception_from_name_domain): New helper function.
22385
22386         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
22387         exception object in the correct domain.
22388
22389         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
22390         formatting + make a copy a the input data.
22391
22392         * loader.c (mono_get_method_from_token): Methods which contain
22393         native code do not have entries in the ImplMap.
22394
22395         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
22396         Thanks to Gonzalo for spotting this.
22397         
22398         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
22399         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
22400
22401         * assembly.h (mono_assembly_load_from): Split the second part of 
22402         assembly loading into a new public function.
22403
22404         * exception.h (mono_get_exception_bad_image_format): New function.
22405
22406 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
22407
22408         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
22409         Enumerate all modules inside a dynamic assembly. Fixes #51293.
22410         
22411         * icall.c: Add new icall for creating dynamic methods.
22412
22413         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
22414
22415         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
22416
22417         * reflection.c (mono_reflection_create_dynamic_method): New icall to
22418         create a dynamic method.
22419
22420         * reflection.c (resolve_object): New helper function.
22421
22422         * reflection.c: Generalize ReflectionMethodBuilder and the functions
22423         which manipulate it so they can also work on dynamic methods.
22424
22425         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
22426         creating the MonoReflectionMethodAux structure if it is not needed.
22427         
22428         * reflection.h verify.c: Update after changes to object layout.
22429
22430         * reflection.c (method_builder_encode_signature): Fix compilation on
22431         gcc 2.95.x.
22432
22433 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
22434
22435         * appdomain.h: Added support for context static fields. Added static_data
22436           field to MonoAppContext and renamed thread_static_fields to a more
22437           generic special_static_fields in MonoAppDomain, since it can now contain
22438           context static fields.
22439         * domain.c: Updated hashtable name.
22440         * object.c: Replaced field_is_thread_static() for a more generic
22441           field_is_special_static() which also checks for context static attribute.
22442           In mono_class_vtable(), added support for static context fields.
22443         * threads.c: Changed methods that manage thread static fields to more
22444           generic methods so they can be reused both for thread and context static
22445           data.
22446         * threads.h: Declared some new methods.
22447
22448 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
22449
22450         * reflection.h: Update after changes to the managed types.
22451
22452         * reflection.c (encode_custom_modifiers): New helper function.
22453
22454         * reflection.c (method_encode_signature): Emit custom modifiers.
22455
22456         * reflection.c (field_encode_signature): Emit custom modifiers.
22457
22458 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
22459
22460         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
22461
22462         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
22463         implementation.
22464
22465         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
22466         icall.
22467
22468         * object.c (mono_field_get_value_object): New function.
22469
22470         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
22471         specific.
22472
22473 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
22474
22475         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
22476         return a preallocated out-of-memory exception instance.
22477
22478         * object.c (out_of_memory): Use the new function.
22479
22480         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
22481         flag is before the custom modifiers. Fixes #49802.
22482
22483 2003-11-16  Martin Baulig  <martin@ximian.com>
22484
22485         * class.c (mono_class_is_open_constructed_type): Implemented the
22486         MONO_TYPE_GENERICINST case.
22487
22488 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
22489
22490         * assembly.c (mono_assembly_fill_assembly_name): New function to
22491         fill out the MonoAssemblyName structure.
22492         (mono_assembly_open): Use the new function.
22493
22494         * icall.c (fill_reflection_assembly_name): New helper function.
22495
22496         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
22497         new function.
22498
22499         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
22500
22501 2003-11-15  Martin Baulig  <martin@ximian.com>
22502
22503         * class.c (mono_class_is_open_constructed_type): New public
22504         function; checks whether a type is an open constructed type,
22505         ie. whether it still contains type parameters.
22506         (mono_class_inflate_generic_type): If we're a type parameter and
22507         the inflated type is also a MONO_TYPE_(M)VAR, return the original
22508         type.
22509
22510         * class.h (MonoGenericInst): Added `guint32 is_open'.
22511
22512         * loader.c (method_from_methodspec): Check whether we're an open
22513         or closed constructed type and set `ginst->is_open'.
22514
22515         * reflection.c (mono_reflection_bind_generic_parameters): Check
22516         whether we're an open or closed constructed type and set
22517         `ginst->is_open'.
22518         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
22519         from open constructed types.
22520
22521 2003-11-15  Martin Baulig  <martin@ximian.com>
22522
22523         * reflection.c (mono_reflection_bind_generic_parameters): If we're
22524         a generic instance (instead of a generic type declaration) with
22525         unbound generic parameters, bind them to our actual types.
22526
22527 2003-11-14  Martin Baulig  <martin@ximian.com>
22528
22529         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
22530
22531         * reflection.c (mono_reflection_bind_generic_parameters): If we're
22532         an interface type, populate `res->interfaces' with instantiated
22533         versions of all the interfaces we inherit.
22534
22535 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
22536
22537         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
22538         when MONO_PATH is set but doesn't contain the install dir.
22539
22540 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22541
22542         * icall.c:
22543         (ves_icall_Type_GetInterfaces): don't return an interface twice when
22544         it's also implemented in base classes. Fixes bug #50927.
22545
22546 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
22547
22548         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
22549         if this method is called from a finalizer. Fixes #50913.
22550
22551 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
22552
22553         * threads.c: Implement VolatileRead/VolatileWrite
22554
22555         * icall.c: Add new icalls for VolatileRead/VolatileWrite
22556
22557 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
22558
22559         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
22560         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
22561         2.95.3.
22562
22563         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
22564         from Peter Ross (pro@missioncriticalit.com).
22565         
22566 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
22567
22568         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
22569
22570 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
22571
22572         * assembly.c (mono_assembly_load_references): Disable check because it
22573         triggers on older corlibs which lots of people have.
22574
22575 2003-11-12  Jackson Harper  <jackson@ximian.com>
22576
22577         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
22578         load corlib.dll if mscorlib.dll is not found.
22579         * assembly.h: Remove corlib name define.
22580         * class.c:
22581         * domain.c:
22582         * image.c: Change corlib name to mscorlib.
22583         
22584 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
22585
22586         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
22587
22588 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
22589
22590         * appdomain.h: Added loader_optimization here to sync with the C#
22591         code, and add disallow_binding_redirects field.
22592
22593 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
22594
22595         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
22596
22597         * reflection.c (mono_image_build_metadata): Fix crash on modules
22598         with no types.
22599
22600         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
22601
22602         * icall.c (ves_icall_get_method_info): Return callingConvention as
22603         well.
22604
22605         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
22606         namespaces from the EXPORTEDTYPE table as well.
22607
22608         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
22609         from all modules inside the assembly.
22610         
22611 2003-11-11  Martin Baulig  <martin@ximian.com>
22612
22613         * reflection.c (mono_reflection_bind_generic_parameters): Make
22614         this work for interfaces.
22615
22616 2003-11-11  Martin Baulig  <martin@ximian.com>
22617
22618         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
22619
22620 2003-11-11  Martin Baulig  <martin@ximian.com>
22621
22622         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
22623         "MonoInflatedMethod" and "MonoInflatedCtor".
22624
22625 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
22626
22627         * reflection.c (resolution_scope_from_image): Use the assembly table
22628         from the manifest module, since other modules don't have it.
22629
22630         * debug-helpers.c (mono_type_full_name): New helper function.
22631
22632         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
22633
22634         * image.c (mono_image_load_file_for_image): New public function which
22635         is a replacement for the load_file_for_image in class.c.
22636
22637         * assembly.c (mono_assembly_load_module): A wrapper for the function
22638         above which does assembly association and reference loading too.
22639
22640         * class.c (mono_class_from_name): Call mono_assembly_load_module.
22641
22642 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22643
22644         * appdomain.c: not all of the attributes for the full assembly name
22645         are required and the order doesn't matter. Fixes bug #50787.
22646
22647 2003-11-10  Dick Porter  <dick@ximian.com>
22648
22649         * locales.c: Use platform-endian UTF16
22650
22651 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
22652
22653         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
22654         
22655 2003-11-10  Martin Baulig  <martin@ximian.com>
22656
22657         * metadata.c
22658         (mono_metadata_load_generic_params): Make this actually work.
22659
22660         * reflection.c (mono_reflection_bind_generic_parameters): If our
22661         parent is a generic instance, pass all the `types' to it, no
22662         matter whether it has the same number of type parameters or not.
22663
22664 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
22665
22666         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
22667
22668         * assembly.c (mono_assembly_load_references): Move the image<->assembly
22669         assignment code to this function so it gets called recursively for all
22670         modules.
22671
22672         * image.c (load_modules): Remove the assembly assignment since it is
22673         now done by mono_assembly_load_references.
22674         
22675         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
22676         Add 'module' argument.
22677         (mono_module_get_types): New helper function.
22678         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
22679
22680 2003-11-08  Martin Baulig  <martin@ximian.com>
22681
22682         * class.c (mono_class_inflate_generic_method): Interface method
22683         don't have a header.
22684
22685         * reflection.c (mono_image_get_methodspec_token): Take an
22686         additional `MonoGenericInst *' argument instead of reading it from
22687         the header; this is necessary to support interfaces.
22688         (mono_image_create_token): Pass the `MonoGenericInst *' from the
22689         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
22690         (inflated_method_get_object): Take an additional `MonoGenericInst *'
22691         argument.
22692
22693         * reflection.h (MonoReflectionInflatedMethod): Added
22694         `MonoGenericInst *ginst'.
22695
22696 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
22697
22698         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
22699
22700 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
22701
22702         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
22703
22704 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
22705
22706         * reflection.c 
22707         (reflection_methodbuilder_from_method_builder):
22708         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
22709         initialize a ReflectionMethodBuilder structure.
22710         (mono_image_get_methodbuilder_token):
22711         (mono_image_get_ctorbuilder_token): New functions to emit memberref
22712         tokens which point to types in another module inside the same assembly.
22713
22714         * reflection.c: Use the new helper functions.
22715         
22716         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
22717
22718         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
22719         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
22720
22721         * reflection.c (resolution_scope_from_image): Emit a moduleref if
22722         neccesary.
22723
22724         * reflection.c (mono_image_build_metadata): Emit metadata only for the
22725         current module. Emit the manifest only for the main module.
22726
22727         * reflection.c (mono_image_create_token): Add assertion when a 
22728         memberref needs to be created.
22729
22730         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
22731
22732         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
22733         larger buffer for the custom attribute blob. Fixes #50637.
22734         
22735 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22736
22737         * threadpool.c: notify listener on async processing handles after
22738         invoking the async callback. Thanks to Zoltan.
22739
22740 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
22741
22742         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
22743         avoid code duplication.
22744
22745         * reflection.h (MonoDynamicImage): New type which is currently unused,
22746         but will be used through the ref.emit code in place of 
22747         MonoDynamicAssembly.
22748
22749         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
22750         object layout.
22751
22752         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
22753         a MonoDynamicImage instead of just a MonoImage.
22754         
22755         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
22756         icalls to ModuleBuilder but keep their semantics, so they will work
22757         with moduleb->assemblyb. This will change later.
22758         
22759 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
22760
22761         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
22762         object layout.
22763
22764         * reflection.c (mono_image_build_metadata): Avoid creation of a default
22765         main module, since it is now done by the managed code.
22766
22767 2003-11-03  Martin Baulig  <martin@ximian.com>
22768
22769         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
22770         `ginst->klass' here.
22771         (method_encode_methodspec): Don't use the `ginst->generic_method's
22772         klass if it's a generic instance, use `ginst->klass' in this case.
22773
22774 2003-11-03  Martin Baulig  <martin@ximian.com>
22775
22776         * reflection.c (mono_image_get_generic_method_param_info):
22777         Removed, use mono_image_get_generic_param_info() instead.
22778         (mono_image_get_type_info): Write the GenericParam table before
22779         the Method table.  This is neccessary because in the GenericParam
22780         table, type parameters of the class (ie. '!0' etc.) must come
22781         before the ones from its generic methods (ie. '!!0' etc).
22782
22783 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
22784
22785         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
22786
22787 2003-11-02  Martin Baulig  <martin@ximian.com>
22788
22789         * reflection.c (create_generic_typespec): Take a
22790         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
22791         the generic parameters from it.
22792
22793 2003-11-02  Martin Baulig  <martin@ximian.com>
22794
22795         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
22796         instead of a `MonoClassField *' since we just need the type.
22797         (create_generic_typespec): New static function.  Creates a
22798         TypeSpec token for a generic type declaration.
22799         (mono_image_get_generic_field_token): New static function.
22800         (mono_image_create_token): If we're a FieldBuilder in a generic
22801         type declaration, call mono_image_get_generic_field_token() to get
22802         the token.
22803
22804 2003-11-02  Martin Baulig  <martin@ximian.com>
22805
22806         * reflection.h
22807         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
22808         `MonoReflectionGenericInst *declaring_type' and
22809         `MonoReflectionGenericInst *reflected_type' fields.
22810
22811         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
22812         `MonoReflectionGenericInst *declaring_type' and a
22813         `MonoReflectionGenericInst *reflected_type' argument instead of a
22814         single `MonoReflectionGenericInst *type' one.  Set
22815         `res->declaring_type' and `res->reflected_type' from them.
22816         (mono_reflection_inflate_field): Likewise.      
22817
22818 2003-11-02  Martin Baulig  <martin@ximian.com>
22819
22820         * class.c (mono_class_setup_vtable): Don't store generic methods
22821         in the vtable.  
22822
22823 2003-11-02  Martin Baulig  <martin@ximian.com>
22824
22825         * reflection.h (MonoReflectionGenericInst): Added
22826         `MonoReflectionType *declaring_type'.
22827
22828         * reflection.c (mono_reflection_bind_generic_parameters): Use
22829         `if (tb->parent)' instead of `klass->parent'.
22830
22831 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
22832
22833         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
22834         with an empty ASSEMBLY table.
22835
22836         * reflection.c (mono_image_build_metadata): Avoid using the same loop
22837         variable in the inner and outer loops.
22838
22839 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
22840
22841         * metadata.h (mono_metadata_make_token): Put parentheses around macro
22842         argument.
22843
22844         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
22845         
22846         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
22847         icalls. Instead, do everything in managed code. This is needed since
22848         it is hard to restore the original domain etc. in unmanaged code in the
22849         presence of undeniable exceptions.
22850
22851         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
22852         New icalls to push and pop appdomain refs.
22853
22854 2003-10-31  Martin Baulig  <martin@ximian.com>
22855
22856         * class.c (inflate_generic_type): Renamed to
22857         mono_class_inflate_generic_type() and made it public.
22858
22859         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
22860         New interncall.
22861
22862         * loader.c (mono_field_from_memberref): Also set the retklass for
22863         typespecs.
22864
22865         * fielder.c (mono_image_get_inflated_field_token): New static
22866         method; creates a metadata token for an inflated field.
22867         (mono_image_create_token, fixup_method): Added support for
22868         "MonoInflatedField".
22869         (fieldbuilder_to_mono_class_field): New static function.
22870         (mono_reflection_inflate_field): New public function.
22871
22872         * reflection.h
22873         (MonoReflectionGenericInst): Added `MonoArray *fields'.
22874         (MonoReflectionInflatedField): New typedef.     
22875
22876 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
22877
22878         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
22879         for Solaris and other platforms without s6_addr16
22880
22881 2003-10-30  Martin Baulig  <martin@ximian.com>
22882
22883         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
22884         argument instead of two.
22885         (mono_class_inflate_generic_signature): Likewise.
22886         (inflate_generic_header): Likewise.
22887         (mono_class_inflate_generic_method): Likewise.  In addition, if
22888         `ginst->klass' is set, it becomes the new `method->klass'.
22889
22890         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
22891         field.
22892
22893         * reflection.c (encode_generic_method_sig): Write a 0xa as the
22894         first byte. [FIXME]
22895         (method_encode_methodspec): If we have generic parameters, create
22896         a MethodSpec instead of a MethodRef.
22897         (fixup_method): Added support for "MonoInflatedMethod" and
22898         "MonoInflatedCtor".
22899         (mono_image_create_token): Added support for "MonoInflatedMethod"
22900         and "MonoInflatedCtor".
22901         (inflated_method_get_object): New static function; returns a
22902         managed "System.Reflection.MonoInflatedMethod" object.
22903         (mono_reflection_bind_generic_method_parameters): Return a
22904         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
22905         (mono_reflection_inflate_method_or_ctor): Likewise.
22906         (mono_image_get_generic_method_param_info): Initialize unused
22907         fields to zero.
22908         (mono_image_get_generic_param_info): Likewise.
22909
22910         * reflection.h (MonoReflectionInflatedMethod): New public
22911         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
22912         "S.R.MonoInflatedCtor" classes.
22913
22914         * loader.c (method_from_memberref): If we're a TypeSpec and it
22915         resolves to a generic instance, inflate the method.
22916
22917 2003-10-28  Dick Porter  <dick@ximian.com>
22918
22919         * object.c (mono_runtime_run_main): Convert command-line arguments
22920         into utf8, falling back to the user's locale encoding to do so.
22921
22922 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
22923
22924         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
22925         at this time.
22926
22927         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
22928
22929         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
22930         up icalls at method definition time. Partially fixes #33569.
22931
22932 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
22933
22934         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
22935         marshalling of arrays. Fixes #50116.
22936
22937         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
22938
22939         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
22940         points to a vtable in the dying appdomain.
22941
22942         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
22943         listeners into unmanaged code inside the lock.
22944
22945         * object.c (mono_class_vtable): Turn off typed allocation in non-root
22946         domains and add some comments.
22947
22948 2003-10-25  Martin Baulig  <martin@ximian.com>
22949
22950         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
22951
22952         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
22953
22954         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
22955         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
22956         currently parsing.  Create the generic class and store it in
22957         `generic_inst->klass' before parsing the type arguments.  This is
22958         required to support "recursive" definitions; see mcs/tests/gen-23.cs
22959         for an example.
22960         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
22961         to support recursive typespec entries.
22962
22963         * class.c (mono_class_setup_parent): If our parent is a generic
22964         instance, we may get called before it has its name set.
22965         (mono_class_from_generic): Splitted into
22966         mono_class_create_from_generic() and mono_class_initialize_generic().
22967
22968 2003-10-25  Martin Baulig  <martin@ximian.com>
22969
22970         * icall.c (ves_icall_Type_BindGenericParameters): Return a
22971         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
22972         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
22973         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
22974
22975         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
22976         (create_typespec): Likewise.
22977         (mono_reflection_bind_generic_parameters): Return a
22978         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
22979         (mono_reflection_inflate_method_or_ctor): New public function.
22980
22981         * reflection.h (MonoReflectionGenericInst): New typedef.        
22982
22983 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
22984
22985         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
22986         inside the domain lock. Fixes #49993.
22987         
22988         * object.c (mono_class_vtable): When typed allocation is used, 
22989         allocate vtables in the GC heap instead of in the mempool, since the
22990         vtables contain GC descriptors which are used by the collector even
22991         after the domain owning the mempool is unloaded.
22992
22993         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
22994
22995         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
22996         reflect what it does. Also invalidate mempools instead of freeing
22997         them if a define is set.
22998
22999         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
23000         of the appdomain.
23001         
23002         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
23003         hold the finalizable objects in this domain.
23004
23005         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
23006         appdomain.
23007
23008         * appdomain.c (mono_domain_set): New function to set the current
23009         appdomain, but only if it is not being unloaded.
23010
23011         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
23012         appdomain which is being unloaded.
23013         
23014         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
23015         unloading of the root appdomain.
23016
23017         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
23018         icall to execute a method in another appdomain. Intended as a 
23019         replacement for InternalSetDomain, which can confuse the code 
23020         generation in the JIT.
23021
23022         * appdomain.c (mono_domain_is_unloading): New function to determine
23023         whenever an appdomain is unloading.
23024
23025         * appdomain.c (mono_domain_unload): New function to correctly unload
23026         an appdomain.
23027
23028         * assembly.c (mono_assembly_load_references): Check that an assembly
23029         does not references itself.
23030
23031         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
23032         domain manually, it asks the finalizer thread to do it, then waits for
23033         the result. Also added a timeout.
23034
23035         * icall.c: Register the new icalls.
23036
23037         * threads.h threads.c: Export the mono_gc_stop_world and 
23038         mono_gc_start_world functions.
23039         
23040         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
23041         function to fill out the mempool with 0x2a.
23042
23043 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
23044
23045         * reflection.h (MonoReflectionMethodAux): New structure to store
23046         information which is rarely used, thus is not in the MonoMethod
23047         structure.
23048
23049         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
23050         store the aux info.
23051
23052         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
23053         and marshalling info into the aux structure.
23054
23055         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
23056         from the aux structure.
23057
23058         * loader.c (mono_method_get_param_names): Retrieve the param names from
23059         the aux structure.
23060         
23061 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
23062
23063         * exception.h exception.c: Add AppDomainUnloadedException && fix 
23064         warning.
23065
23066 2003-10-21  Dick Porter  <dick@ximian.com>
23067
23068         * socket-io.c
23069         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
23070         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
23071
23072 2003-10-21  Martin Baulig  <martin@ximian.com>
23073
23074         * reflection.c (mono_reflection_bind_generic_parameters):
23075         `klass->parent' is NULL for interfaces.
23076
23077 2003-10-21  Martin Baulig  <martin@ximian.com>
23078
23079         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
23080
23081 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
23082
23083         * exception.c (mono_exception_from_name_msg): New helper function for
23084         creating exceptions and initializing their message field.
23085
23086         * exception.c: Simplify functions using the new helper.
23087
23088         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
23089         New function.
23090
23091         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
23092         mono_raise_exception, since otherwise gcc doesn't generate the function
23093         epilog for raise_exception, confusing the stack unwinding in the JIT.
23094         Fixes #45043.
23095
23096         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
23097         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
23098         Fixes #49499.
23099
23100 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23101
23102         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
23103         utf8.
23104
23105 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
23106
23107         * icall.c: Removed GetUninitializedObject method because
23108           AllocateUninitializedClassInstance does the same.
23109
23110 2003-10-18  Martin Baulig  <martin@ximian.com>
23111
23112         * class.c (inflate_generic_signature): Renamed to
23113         mono_class_inflate_generic_signature() and made it public.
23114         (my_mono_class_from_generic_parameter): New static function; if we
23115         don't already have the generic parameter's MonoClass, create a
23116         very simple one which is just used internally in the runtime and
23117         not passed back to managed code.
23118
23119         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
23120
23121         * metadata.h (MonoMethodSignature): Moved the
23122         `MonoGenericParam *gen_params' to the MonoMethodHeader.
23123         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
23124
23125         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
23126         ves_icall_MonoMethod_GetGenericArguments(); this is now an
23127         interncall on the MonoMethod class, not on MethodInfo.
23128         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
23129         calling mono_reflection_bind_generic_method_parameters() directly.
23130
23131         * loader.c (mono_method_get_signature): If this is a MethodSpec;
23132         return the already computed `method->signature'.
23133         (method_from_methodspec): New static function to load a method
23134         from a MethodSpec entry.
23135         (mono_get_method_from_token): Call the new method_from_methodspec()
23136         for MethodSpec tokens.  
23137         (mono_get_method_from_token): If we're a generic method, load the
23138         type parameters.
23139
23140         * reflection.c (mono_image_get_memberref_token): Allow
23141         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
23142         table.
23143         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
23144         (mono_image_create_token): First check whether it's a generic
23145         method (so we'd need to create a MethodSpec), then do the other
23146         two alternatives.
23147         (mono_reflection_bind_generic_method_parameters): Return a
23148         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
23149         called directly from the interncall.
23150
23151 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
23152
23153         * reflection.c (load_public_key): Move loading of the public key
23154         into managed code.
23155
23156         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
23157
23158         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
23159         fields.
23160
23161         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
23162         culture, hash_alg and public_key. Fixes #49555.
23163
23164 2003-10-17  Martin Baulig  <martin@ximian.com>
23165
23166         * class.h (MonoGenericInst): Moved this declaration here and added
23167         `MonoMethod *generic_method'.
23168
23169         * icall.c
23170         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
23171         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
23172
23173         * metadata.c (mono_metadata_type_equal): Two types of
23174         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
23175         index; ie. don't compare the address of the `MonoGenericParam'
23176         structure.
23177         (mono_metadata_load_generic_params): Removed the `MonoMethod
23178         *method' argument.
23179
23180         * metadata.h (MonoGenericInst): Moved declaration to class.h.
23181         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
23182
23183         * reflection.c (method_encode_signature): Encode the number of
23184         generic parameters.
23185         (encode_generic_method_sig): New static function.
23186         (method_encode_methodspec): New static function; creates an entry
23187         in the MethodSpec table for a generic method.
23188         (mono_image_get_methodspec_token): New static function.
23189         (mono_image_create_token): Call mono_image_get_methodspec_token()
23190         for generic methods.
23191         (mono_reflection_bind_generic_method_parameters): New public
23192         function.  Instantiates a generic method.
23193
23194 2003-10-16  Martin Baulig  <martin@ximian.com>
23195
23196         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
23197         *gen_params' here from MonoMethodHeader.
23198
23199         * metadata.c (mono_metadata_parse_method_signature): If we have
23200         generic parameters, initialize `method->gen_params' and then set
23201         the correct `type->data.generic_param' in all the parameters.
23202
23203 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
23204
23205         * threads.c (mono_threads_get_default_stacksize): New function to 
23206         return the default stacksize.
23207
23208         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
23209         termination of the finalizer thread, since the previous method had
23210         race conditions. Fixes #49628.
23211
23212         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
23213         as for the other managed threads.
23214
23215 2003-10-16  Martin Baulig  <martin@ximian.com>
23216
23217         * class.c (inflate_generic_signature): Copy `generic_param_count'
23218         and `gen_params'.
23219
23220         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
23221         New interncall.
23222
23223         * metadata.c (mono_metadata_parse_method_signature): Actually set
23224         the `method->generic_param_count' here.
23225         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
23226
23227 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
23228
23229         * object.h: Add a new field to TypedRef to simplify the implementation
23230         of the REFANY opcodes in the JIT.
23231
23232         * icall.c: Make use of the new field.
23233
23234         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
23235         dynamically.
23236
23237 2003-10-15  Martin Baulig  <martin@ximian.com>
23238
23239         * class.c (mono_class_from_gen_param): Renamed to
23240         mono_class_from_generic_parameter() and moved most of the
23241         functionality from mono_reflection_define_generic_parameter()
23242         here; ie. we create a "real" class here.
23243         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
23244         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
23245         previously been called.
23246
23247         * class.h (MonoGenericParam): Moved the declaration of this struct
23248         here from metadata.h and added `MonoMethod *method'.
23249
23250         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
23251         interncall.
23252
23253         * loader.c (mono_get_method_from_token): If we have any generic
23254         parameters, call mono_metadata_load_generic_params() to read them
23255         from the MONO_TABLE_GENERICPAR.
23256
23257         * metadata.c (mono_metadata_load_generic_params): Added
23258         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
23259
23260         * metadata.h (MonoMethodSignature): Replaced
23261         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
23262         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
23263
23264         * reflection.c (mono_reflection_define_generic_parameter): Moved
23265         most of the functionality into the new
23266         mono_class_from_generic_parameter(); set the `method' field if
23267         we're a method parameter.       
23268
23269 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
23270
23271         * marshal.c (emit_struct_conv): if native size is 0
23272         emit no code.
23273
23274 2003-10-14  Martin Baulig  <martin@ximian.com>
23275
23276         * icall.c: The generics API has changed in the spec since it was
23277         added to System.Type; these modifications make it match the spec
23278         again.
23279         (ves_icall_Type_GetGenericParameters): Renamed to
23280         `ves_icall_Type_GetGenericArguments'.
23281         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
23282         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
23283         `ves_icall_MonoType_get_HasGenericArguments'.
23284         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
23285         `ves_icall_MonoType_get_IsGenericParameter'.
23286         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
23287         this is no interncall anymore.
23288         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
23289         `ves_icall_TypeBuilder_get_IsGenericParameter'.
23290
23291 2003-10-14  Martin Baulig  <martin@ximian.com>
23292
23293         * reflection.c (mono_reflection_bind_generic_parameters): Also
23294         inflate generic methods if we're reading the class from IL.
23295
23296 2003-10-13  Martin Baulig  <martin@ximian.com>
23297
23298         * reflection.c (mono_reflection_define_generic_parameter): This
23299         method isn't called directly from the icall anymore; take a
23300         `MonoReflectionAssemblyBuilder *' so we can use this for type and
23301         method generic parameters.
23302         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
23303         (method_builder_encode_signature): Encode generic parameters.
23304         (mono_image_get_method_info): Write generic params to the
23305         MONO_TABLE_GENERICPARAM table.
23306
23307         * reflection.h (MonoReflectionMethodBuilder): Added
23308         `MonoArray *generic_params'.
23309
23310         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
23311
23312         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
23313         wrapper for mono_reflection_define_generic_parameter().
23314         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
23315
23316 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
23317
23318         * marshal.h: Add missing function to fix build.
23319
23320         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
23321         the SetLastError pinvoke attribute.
23322
23323         * marshal.c (mono_marshal_set_last_error): New helper function called
23324         by the generated code.
23325         
23326         * marshal.c (mono_mb_emit_branch): New helper function.
23327
23328         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
23329
23330         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
23331         classes as parameters and return values of delegates. Fixes #29256. 
23332
23333 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
23334
23335         * locales.c: use gint32 in non HAVE_ICU case
23336
23337 2003-10-11  Martin Baulig  <martin@ximian.com>
23338
23339         * mono-debug.c (mono_debug_add_method): Added a workaround for
23340         bug #48591.
23341
23342 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
23343
23344         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
23345         delegates passed to native code must use the STDCALL calling 
23346         convention. Fixes #35987.
23347
23348 2003-10-10  Martin Baulig  <martin@ximian.com>
23349
23350         * class.c (inflate_generic_type): If we're inflating for a generic
23351         type instance (and not for a generic method), return
23352         MONO_TYPE_MVAR unchanged.
23353
23354 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23355
23356         * string-icalls.c: Join ignores null strings in the source array.
23357         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
23358         * threads.c: GetAvailableTheads is slightly more accurate.
23359
23360 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
23361
23362         * threads.h threads.c : add mono_threads_set_default_stacksize
23363         and pass default to CreateThread calls.
23364
23365 2003-10-09  Dick Porter  <dick@ximian.com>
23366
23367         * icall.c:
23368         * locales.h:
23369         * locales.c: Internal calls for constructing CultureInfo and
23370         related objects from libicu (if its available.)
23371
23372 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
23373
23374         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
23375
23376 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23377
23378         * threadpool.c: added an argument to async_invoke_thread that is the
23379         item to process, pass the MonoAsyncResult to the thread start function
23380         when creating a new thread. This way we don't need to acquire any lock
23381         when we're creating a new thread. Readded a semaphore for faster
23382         response times (instead of that Sleep i added).
23383
23384 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
23385
23386         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
23387         get daylight change dates better on Windows, fix handling
23388         of platforms without tm_gmtoff.
23389
23390 2003-10-06  Martin Baulig  <martin@ximian.com>
23391
23392         * class.c (inflate_generic_method): Renamed to
23393         mono_class_inflate_generic_method() and made public.
23394         (mono_class_init): Don't inflate the generic methods here.
23395         (mono_class_from_generic): Added `gboolean inflate_methods'
23396         argument.  Inflate the methods here.
23397
23398         * loader.c (mono_method_get_param_names): Ignore instances of
23399         generic types for the moment.
23400
23401         * reflection.c (fixup_method): Added support for inflated methods.
23402         (mono_image_create_token): Use mono_image_get_methodref_token()
23403         for inflated methods.
23404         (mono_custom_attrs_from_param): Ignore instances of generic types
23405         for the moment.
23406         (mono_reflection_bind_generic_parameters): New public function.
23407         Moved all the functionality from
23408         ves_icall_Type_BindGenericParameters() here and added support for
23409         dynamic types.
23410         (mono_reflection_define_generic_parameter): Initialize
23411         `klass->methods' here.
23412
23413         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
23414         functionality into mono_reflection_define_generic_parameter().
23415         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
23416         TypeBuilder, return that TypeBuilder.
23417
23418 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23419
23420         * appdomain.c: removed mono_delegate_semaphore.
23421
23422         * threadpool.c:
23423         (mono_thread_pool_add): moved hash table creation inside and the thread 
23424         creation outside of the critical region.
23425         (mono_thread_pool_finish): removed obsolete code.
23426         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
23427         continue or exit the thread depending on the queue.
23428
23429 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
23430
23431         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
23432         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
23433         handle more bool marshalling options
23434
23435 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
23436
23437         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
23438         arrays of structs. Also add a more descriptive error message when
23439         a structure member is marshalled as LPArray.
23440
23441 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
23442
23443         * marshal.c (mono_marshal_get_native_wrapper): Add support for
23444         marshalling arrays of complex types. Fixes #29098. Also remove an
23445         usused and incomplete function.
23446
23447 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
23448
23449         * gc.c: report heap_size - free_bytes as total memory allocated
23450         (bug#49362).
23451
23452 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
23453
23454         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
23455         fix timezone handling problems on Windows.
23456         
23457         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
23458         asserts when the year is outside the range handled by ms the functions.
23459
23460         * class.c (setup_interface_offsets): If the class is an interface,
23461         fill out its interface_offsets slot.
23462
23463 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23464
23465         * threadpool.c: mark threadpool threads as background.
23466
23467 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
23468
23469         * decimal.c - define DECINLINE to nothing if not using GCC
23470
23471 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
23472
23473         * assembly.c: More refcount fixes.
23474
23475 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23476
23477         * string-icalls.c: if we're not trimming, return the same string.
23478         When not splitting, don't create a new string.
23479
23480 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23481
23482         * image.c:
23483         (mono_image_open): increment the ref_count inside the critical section.
23484
23485 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
23486
23487         * image.c (mono_image_open): Fix reference counting bug.
23488
23489 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
23490
23491         * marshal.c (mono_marshal_type_size) struct alignment changed for 
23492         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
23493         64bits. Avoid leak in mono_marshal_get_native_wrapper when
23494         mono_lookup_pinvoke_call throws.        
23495
23496 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
23497
23498         * reflection.c (mono_reflection_parse_type): Fix #49114.
23499
23500         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
23501         temporary workaround for cygwin header problem.
23502
23503         * object.c (mono_object_isinst): Synchronize this with the code
23504         generated by the JIT for casts.
23505
23506 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
23507
23508         * reflection.c (encode_type): Fix #38332.
23509
23510 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
23511
23512         * marshal.c (mono_marshal_method_from_wrapper): New function to return
23513         the original method from the wrapper method.
23514
23515 2003-09-25  Martin Baulig  <martin@ximian.com>
23516
23517         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
23518         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
23519         (ves_icall_Type_get_IsGenericInstance): New interncall.
23520
23521 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
23522
23523         * object.c: fix cast warning in big endian code.
23524
23525 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
23526
23527         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
23528         
23529 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23530
23531         * assembly.c: don't call check_env from mono_assembly_load. It's
23532         already done once in mono_assemblies_init and may cause headaches when
23533         multiple threads are loading assemblies.
23534
23535 2003-09-19  Martin Baulig  <martin@ximian.com>
23536
23537         * reflection.c (mono_reflection_define_generic_parameter): Don't
23538         allocate `klass->methods', set `klass->flags' to
23539         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
23540
23541 2003-09-18  Martin Baulig  <martin@ximian.com>
23542
23543         * class.c (mono_class_init): Don't create `class->methods' if it's
23544         already initialized.
23545
23546         * metadata.c (mono_metadata_load_generic_params): Make this
23547         actually work.
23548
23549         * reflection.c (mono_reflection_define_generic_parameter): Set
23550         parent class and interfaces from the constraints.
23551
23552         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
23553         to keep this struct in sync with the declaration in TypeBuilder.cs.
23554
23555 2003-09-17  Martin Baulig  <martin@ximian.com>
23556
23557         * metadata.h (MonoType): Replaced the data's `int type_param'
23558         field with `MonoGenericParam *generic_param'.
23559         (MonoGenericParam): Added `MonoClass *klass'.
23560
23561         * class.c (mono_class_from_gen_param): Removed the
23562         `MonoImage *image' and `int type_num' arguments.
23563
23564         * metadata.c (mono_metadata_parse_generic_param): New static
23565         method; creates a MonoGenericParam which just contains the index.
23566         (do_mono_metadata_parse_type): Call
23567         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
23568         MONO_TYPE_MVAR.
23569
23570         * reflection.c (mono_image_typedef_or_ref): Generic type
23571         parameters may be in the same assembly, but never use a typedef
23572         for them.
23573         (mono_reflection_define_generic_parameter): We're now creating a
23574         "real" class for the type parameter; it's now safe to call
23575         mono_class_from_mono_type() on the class'es type, it'll do the
23576         right thing.
23577
23578 2003-09-16  Martin Baulig  <martin@ximian.com>
23579
23580         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
23581         `symfile->range_entry_size' and `symfile->class_entry_size' here;
23582         the `symfile' data structure must be fully initialized before it
23583         gets added to the table.
23584
23585 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
23586
23587         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
23588
23589         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
23590         class init trampolines.
23591
23592 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
23593
23594         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
23595         to the built-in profiler to turn off time and allocation profiling
23596         respectively.
23597
23598 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
23599
23600         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
23601         g_direct_equal.
23602
23603         * debug-helpers.c (mono_method_full_name): Print the wrapper type
23604         in human readable form.
23605
23606 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
23607
23608         * reflection.c icall.c: Fixed warnings.
23609
23610         * image.c (load_class_names): Use a temporary hash table to hold the
23611         namespaces in order to avoid doing many string comparisons.
23612
23613         * image.h: Fix typo.
23614
23615         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
23616         Pass NULL instead of g_direct_equal to the GHashTable constructor 
23617         since the NULL case is short-circuited inside g_hash_table_lookup, 
23618         leading to better performance.  
23619
23620         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
23621         obtain the first custom attribute for a given index. Depends on the
23622         CustomAttribute table being sorted by the parent field.
23623
23624         * reflection.c (mono_custom_attrs_from_index): Use the new function 
23625         for better performance.
23626
23627 2003-09-07  Martin Baulig  <martin@ximian.com>
23628
23629         * class.c (mono_class_init): If we're a generic instance, inflate
23630         all our methods instead of loading them from the image.
23631         (mono_class_from_generic): Set `class->methods = gklass->methods'.
23632
23633 2003-09-07  Martin Baulig  <martin@ximian.com>
23634
23635         * mono-debug-debugger.c: Added support for constructors.
23636
23637 2003-09-06  Martin Baulig  <martin@ximian.com>
23638
23639         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
23640         New interncall.
23641
23642         * reflection.c (mono_reflection_setup_generic_class): Call
23643         ensure_runtime_vtable() to create the vtable.
23644
23645 2003-09-05  Martin Baulig  <martin@ximian.com>
23646
23647         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
23648         MONO_TYPE_MVAR.
23649
23650 2003-09-04  Martin Baulig  <martin@ximian.com>
23651
23652         * reflection.c (mono_reflection_define_generic_parameter): Generic
23653         parameters start with zero.
23654
23655 2003-09-04  Martin Baulig  <martin@ximian.com>
23656
23657         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
23658
23659         * reflection.h (MonoReflectionGenericParam): New typedef.
23660         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
23661         the generic parameters from the managed TypeBuilder.
23662
23663         * reflection.c (mono_reflection_define_generic_parameter): New function.
23664         (mono_reflection_create_runtime_class): Encode generic parameters.
23665         (mono_reflection_setup_generic_class): New function; this is
23666         called after adding adding all generic params to the TypeBuilder.
23667         (encode_type): Added MONO_TYPE_VAR.
23668
23669 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
23670
23671         * class.h class.c (mono_class_needs_cctor_run): Moved this method
23672         here from the JIT.
23673
23674         * assembly.h assembly.c: Moved the AOT loading code into an assembly
23675         load hook.
23676
23677 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
23678
23679         * reflection.h reflection.c class.h class.c: Delete duplicate 
23680         definition of mono_type_get_name () from reflection.c and export the
23681         one in class.c.
23682
23683         * class.c: Class loading fixes from Bernie Solomon 
23684         (bernard@ugsolutions.com).
23685
23686         * reflection.c: Endianness fixes from Bernie Solomon 
23687         (bernard@ugsolutions.com).
23688         
23689 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
23690
23691         * assembly.h assembly.c: Define a file format version for AOT
23692         libraries.
23693         
23694         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
23695
23696         * appdomain.h (MonoJitInfo): New field to determine whenever the
23697         code is domain neutral.
23698         
23699 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
23700
23701         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
23702
23703 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
23704
23705         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
23706         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
23707         Avoid caching the result since strings must be domain specific. Fixes
23708         #48050.
23709
23710 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
23711
23712         * marshal.c (mono_marshal_init): Make this callable multiple times
23713         since it is hard to find a correct place to call it.
23714
23715         * object.c (mono_runtime_class_init): Execute static constructors in
23716         the correct appdomain.
23717
23718         * image.c (build_guid_table): Handle the case when multiple images have
23719         the same GUID.
23720
23721 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23722
23723         * icall.c: added a couple of icalls for System.Web.
23724
23725 2003-08-28  Martin Baulig  <martin@ximian.com>
23726
23727         * icall.c (ves_icall_Type_BindGenericParameters): Use
23728         `klass->generic_inst' instead of `&klass->byval_arg' in the
23729         mono_type_get_object() call.  The returned type must be
23730         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
23731
23732 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
23733
23734         * NOTES: New file.
23735
23736         * object.c (mono_class_proxy_vtable): Make it thread safe.
23737
23738         * pedump.c: Fix warning.
23739
23740         * object.c appdomain.h: Get rid of metadata_section. 
23741         It is no longer needed and it was causing deadlocks with domain->lock.
23742
23743         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
23744
23745 2003-08-26  Martin Baulig  <martin@ximian.com>
23746
23747         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
23748
23749 2003-08-26  Martin Baulig  <martin@ximian.com>
23750
23751         * pedump.c (main): Call mono_metadata_init(),
23752         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
23753         and mono_loader_init().
23754
23755 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
23756
23757         * loader.h: Add missing include to fix build.
23758
23759         * image.h: mono_image_load_references is no more.
23760
23761         * assembly.c: Reworked assembly loading to make it really thread safe.
23762         After these changes, the assembly returned by mono_assembly_open is
23763         fully initialized, i.e. all its references assemblies are loaded.
23764
23765         * assembly.c (mono_image_load_references): Renamed to 
23766         mono_assembly_load_references, and made private, since clients no
23767         longer need to call it.
23768
23769         * class.c: Removed calls to mono_assembly_load_references, since it was
23770         a source of deadlocks.
23771
23772         * loader.h loader.c class.h class.c: Protect data structures using a 
23773         new lock, the loader lock.
23774
23775         * class.c (mono_class_setup_vtable): Create temporary hash tables and
23776         GPtrArrays only when needed.
23777
23778         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
23779         into empty structures by mcs. Fixes pinvoke7.cs.
23780         
23781         * domain.c (mono_init): Call a new initialization function.
23782
23783         * appdomain.c (mono_runtime_init): Call the new initializer function
23784         of the marshal module.
23785
23786         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
23787         inserted into empty structures by mcs. Fixes pinvoke7.cs.
23788
23789         * marshal.h marshal.c: Added locks around the wrapper caches to make
23790         this module thread safe.
23791
23792         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
23793         this argument. Fixes pinvoke1.exe.
23794
23795 2003-08-25  Lluis Sanchez <lluis@ximian.com>
23796
23797         * object.h: Added call_type field to MonoMethodMessage and the corresponding
23798         enumeration of values. Removed fields to store remote call output values in
23799         MonoAsyncResult. Not needed any more.
23800         * object.c: Initialize call_type and async_result fields in mono_message_init.
23801         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
23802         dispatching the message.
23803         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
23804         async call to finish. To do it use a message with EndInvoke call type.
23805
23806 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
23807
23808         * loader.h loader.c (mono_method_hash_marhal_info): New function which
23809         determines whenever a method has marshalling info.
23810
23811 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23812
23813         * assembly.c: fix the build on windows.
23814
23815 2003-08-22 Lluis Sanchez <lluis@ximian.com>
23816
23817         * object.cs: Fixed bug #47785.
23818
23819 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
23820
23821         * string-icalls.c (StringReplace): If their are no occurances of
23822         the old string found return a reference to the supplied
23823         string. This saves some memory and matches MS behavoir.
23824         
23825 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23826
23827         * socket-io.c: fixed compilation for systems that define AF_INET6
23828         and don't define SOL_IP/SOL_IPV6.
23829
23830 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
23831
23832         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
23833         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
23834
23835         * rawbuffer.c rawbuffer.h: Make this module thread safe.
23836
23837         * domain.c: Make this module thread safe.
23838
23839         * domain.c (mono_init): Call new initialization function.
23840
23841         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
23842         reference types too. Fixes #38812.
23843
23844         * image.c (mono_image_init): Fixed warnings.
23845
23846         * class.c (mono_class_from_typeref): Handle assembly load failure
23847         correctly.
23848
23849         * appdomain.c (add_assemblies_to_domain): Handle the case when
23850         the references of an assembly are not yet loaded.
23851
23852         * metadata.c image.c assembly.c: Moved initialization of global
23853         variables to a separate function called at startup since lazy 
23854         initialization of these variables is not thread safe.
23855         
23856         * image.c assembly.c: Made this module thread safe by adding locks in 
23857         the appropriate places.
23858
23859         * domain.c (mono_init): Call the new initialization functions of the
23860         three modules.
23861
23862 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
23863
23864         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
23865           make a direct call. It is proxy's work to make the call asynchronous.
23866           mono_delegate_end_invoke(): If the targe is a proxy, just collect
23867           the return values.
23868         * object.cs: mono_method_call_message_new(): read AsyncResult and
23869           state object from parameters list, if this info is requested.
23870         * object.h: Added fields to store remote call output values in
23871           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
23872
23873 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
23874
23875         * object.h: add needed fields to MonoThread.
23876         * threads.c, threads.h: allow registering a function to cleanup data
23877         allocated per thread by the JIT.
23878
23879 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
23880
23881         * loader.h: portability fix by Bernie Solomon
23882         * <bernard@ugsolutions.com>.
23883
23884 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
23885
23886         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
23887         return a MonoArray. This simplifies the code and also ensures that
23888         the cache allways contains an object reference as a value.
23889
23890         * icall.c (ves_icall_get_parameter_info): Simplified using the new
23891         function.
23892
23893 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23894
23895         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
23896         fixes a problem with byte ordering when getting the address family for
23897         a socket.
23898
23899 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
23900
23901         * .cvsignore: Added monosn.
23902
23903         * reflection.h reflection.c loader.c: Added support for parameter
23904         marshalling to dynamically created types. Fixes #47295.
23905
23906 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
23907
23908         * rand.c: remove useless warnings.
23909
23910 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
23911
23912         * class.c: implemented ldtoken for methods and fieldrefs.
23913
23914 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23915
23916         * threadpool.c: when mono_async_invoke was called, no one took care of
23917         monitoring the queue. So if the method invoked took some time and we
23918         got new async invoke requests after 500 ms (the thread created waited
23919         that long in WaitForSingleObject), the new async invoke was not called
23920         until the previous one finished.
23921
23922         This is fixed now. Thanks to Totte for helping with it.
23923
23924 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23925
23926         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
23927
23928 2003-08-11  Martin Baulig  <martin@ximian.com>
23929
23930         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
23931
23932 2003-08-06  Martin Baulig  <martin@ximian.com>
23933
23934         * mono-debug-debugger.c: Added support for static fields,
23935         properties and methods.
23936
23937 2003-08-06  Martin Baulig  <martin@ximian.com>
23938
23939         * mono-debug-debugger.c: Don't store the MonoString's vtable to
23940         make this work for applications with multiple application domains.
23941
23942 2003-08-04  Martin Baulig  <martin@ximian.com>
23943
23944         * mono-debug-debugger.c: Completely reworked the type support; the
23945         most important thing is that we're now just using one single
23946         `MonoType' instance per type.
23947
23948 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
23949
23950         * mono-endian.h, mono-endian.c, icall.c: Added icall
23951         ves_icall_System_Double_AssertEndianity to assert double word endianity
23952         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
23953
23954 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
23955
23956         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
23957         support, icalls and fixes.
23958
23959 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
23960
23961         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
23962         classes that are a punctuation character in .NET is not the same a
23963         g_unichar_ispunct.
23964
23965 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
23966
23967         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
23968
23969 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
23970
23971         * icall.c: Add new MemCopy internalcall.
23972         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
23973         Simplified code; It is not necessary to handle all the cases here,
23974         as the C# code takes care of it.  Only handle the case of the name
23975         resource embedded into the assembly.
23976
23977         Changed signature to return the data pointer and the size of the
23978         data. 
23979
23980 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
23981
23982         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
23983         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
23984
23985 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
23986
23987         * socket-io.c: ignore EINTR error in select.
23988
23989 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
23990
23991         * class.h, class.c: removed unused subclasses field in MonoClass.
23992
23993 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
23994
23995         * icall.c: improve fix of get_base_definition(). If the parent class
23996           doesn't have the mehod, look at the parent of the parent.
23997         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
23998           to check if a parameter is an in or out parameter
23999           (PARAM_ATTRIBUTE_IN is not set by default).
24000           mono_method_return_message_restore(): Use mono_class_value_size to
24001           get the size of a value type. mono_type_stack_size (parameterType)
24002           does not return the correct value if parameterType is byRef.
24003           mono_load_remote_field(), mono_load_remote_field_new(),
24004           mono_store_remote_field(), mono_store_remote_field_new():
24005           raise exception if the remote call returns an exception.
24006
24007 2003-07-28  Martin Baulig  <martin@ximian.com>
24008
24009         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
24010         method.  This is a wrapper around mono_runtime_invoke() which
24011         boxes the instance object if neccessary.
24012
24013 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
24014
24015         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
24016         metadata.h, row-indexes.h, verify.c: first cut of generics support.
24017
24018 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
24019
24020         * icall.c: disable mcs bug workaround.
24021
24022 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
24023
24024         * object.c (mono_runtime_class_init): Take the metadata_section
24025         mutex before obtaining the domain mutex.
24026
24027         * appdomain.h: Added definition of metadata_section mutex here. 
24028
24029         * object.c: define metadata_mutex here.
24030
24031 2003-07-24  Ravi Pratap  <ravi@ximian.com>
24032
24033         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
24034         fixed.
24035
24036 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
24037
24038         * reflection.c: Fix bug #46669
24039
24040 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24041
24042         * exception.c:
24043         * exception.h:
24044         * icall.c:
24045         * object.h: fill in the type name for TypeLoadException.
24046
24047 2003-07-23  Ravi Pratap  <ravi@ximian.com>
24048
24049         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
24050         relationship between TypeBuilders while compiling corlib) and bug
24051         45993 (Array types returned from the runtime while compiling
24052         corlib were from the loaded corlib).
24053
24054 2003-07-22  Martin Baulig  <martin@ximian.com>
24055
24056         * mono-debug-debugger.c: Reworked the type support a bit more;
24057         distinguish between types and classes.
24058
24059 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
24060
24061         * icall.c: add IsArrayImpl icall.
24062
24063 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
24064
24065         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
24066         initializing real_size only once. Also fix bug #46602.
24067
24068 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
24069
24070         * object.c: Renamed mono_metadata_section to metadata_section.
24071
24072 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
24073
24074         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
24075           empty array if the type is an array. Fixed.
24076           ves_icall_MonoMethod_get_base_definition: if the base method
24077           is abstract, get the MethodInfo from the list of methods of
24078           the class.
24079         * reflection.c: ParameterInfo.PositionImpl should be zero-based
24080           and it was 1-based. Fixed in mono_param_get_objects.
24081
24082 2003-07-20  Martin Baulig  <martin@ximian.com>
24083
24084         * mono-debug.h: Set version number to 31.
24085         (mono_debug_init): Added `MonoDomain *' argument.
24086
24087         * mono-debug-debugger.c: Reworked the type support; explicitly
24088         tell the debugger about builtin types; pass the `klass' address to
24089         the debugger.
24090
24091 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
24092
24093         * image.c: Allow new metadata tables to be loaded without a
24094         warning. Also update the warning message to give the new constant value.
24095                 
24096 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
24097
24098         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
24099         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
24100         array type representation changes.
24101
24102 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
24103
24104         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
24105         on Environment.Exit () call.
24106
24107 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
24108
24109         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
24110         requires a matching corlib.
24111
24112 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
24113
24114         * Changelog: My editor decided to add a CR to each line. Sorry about that.
24115           Committed again without the CRs.
24116         
24117 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
24118
24119         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
24120           getting it from the "this" socket instance. Did not work
24121           if the socket is a subclass of Socket.
24122           Also fixed bug #35371.
24123
24124 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
24125
24126         * metadata.c: fixed size for TypedByRef.
24127         * loader.c: when searching for a method, consider the vararg amrker.
24128         * unicode.c, decimal.c: constify some arrays.
24129
24130 2003-07-15  Dick Porter  <dick@ximian.com>
24131
24132         * socket-io.c: Fixed compilation for gcc < 3.2.
24133
24134         Fixed compilation for machines that don't have AF_INET6 (thanks to
24135         Bernie Solomon <bernard@ugsolutions.com> for that part.)
24136
24137         Fixed compile warnings.
24138         
24139         Fixed formatting and line endings.
24140
24141 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
24142
24143         * socket-io.h:
24144         * socket-io.c: Added IPv6 support.
24145
24146 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
24147
24148         * class.c (mono_class_is_assignable_from): New function to implement
24149         the is_assignable_from logic. Used by mono_object_isinst, 
24150         Type::IsAssignableFrom () and the interpreter.
24151
24152         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
24153         Object, even interfaces.
24154         
24155         * object.c (mono_object_isinst): Implement in terms of 
24156         is_assignable_from.
24157
24158         * icall.c (ves_icall_type_is_assignable_from): New icall.
24159
24160 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
24161
24162         * domain.c (foreach_domain): fix compiler warning.
24163
24164 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
24165
24166         * image.c (load_metadata_ptrs): use g_strndup because strndup is
24167         not available on all plattforms
24168
24169 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
24170
24171         * image.h image.c: Store the metadata version string in MonoImage.
24172         * icall.c: New icall to retrieve the image version.
24173         * reflection.c (create_dynamic_image): Fill in the image version field
24174         * reflection.c (build_compressed_metadata): Use the image version
24175         from the image structure.
24176
24177 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24178
24179         * appdomain.c: modified comment.
24180         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
24181         That will be its last iteration when mono_gc_cleanup is called from
24182         mono_runtime_cleanup and before the domain is unloaded.
24183
24184         Fixes bug #45962.
24185
24186 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
24187
24188         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
24189         attributes.
24190
24191 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
24192
24193         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
24194         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
24195         Bernie Solomon <bernard@ugsolutions.com>.
24196
24197 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
24198
24199         * object.c, object.h: provide mono_object_new_fast() for faster
24200         allocation in some special cases.
24201
24202 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
24203
24204         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
24205         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
24206
24207 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
24208
24209         * threadpool.c: fix leaks.
24210
24211 2003-07-01  Dick Porter  <dick@ximian.com>
24212
24213         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
24214         using MonoGHashTables.  Fixes threadpool bug posted to list.
24215
24216 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
24217
24218         * image.h, image.c: added support to load an assembly from a byte array.
24219         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
24220         assembly bundle support.
24221
24222 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
24223
24224         * threadpool.c (mono_thread_pool_add): keep a reference to the
24225         AsyncResult to prevent GC
24226
24227 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
24228
24229         * class.c: leak fix.
24230
24231 2003-06-25  Dick Porter  <dick@ximian.com>
24232
24233         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
24234         for the async object, the WaitHandle object will close the handle.
24235         Fixes bug 45321.
24236
24237 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
24238
24239         * class.c: in mono_array_class_get (), lookup from the hash with the
24240         same type we insert: this works around a bug in
24241         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
24242         lluis. The real fix will have to wait for after the release.
24243
24244 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
24245
24246         * icall.c: fix memory leak when getting type members.
24247
24248 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
24249
24250         * reflection.c: added more pubtoken special cases.
24251
24252 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
24253
24254         * class.c: handle field offset correctly when class size
24255         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
24256
24257 2003-06-20  Martin Baulig  <martin@ximian.com>
24258
24259         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
24260         *image' field.
24261
24262 2003-06-20  Martin Baulig  <martin@ximian.com>
24263
24264         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
24265
24266 2003-06-20  Martin Baulig  <martin@ximian.com>
24267
24268         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
24269         just distinguish between variables in registers and variables at
24270         an offset relative to a register.
24271
24272 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24273
24274         * icall.c: #ifdef out latest changes until mcs is fixed.
24275
24276 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
24277
24278         * icall.c: return members in metadata order.
24279
24280 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
24281
24282         * icall.c: avoid infinite loop in GetTimeZoneData.
24283
24284 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
24285
24286         * icall.c: added Marshal.Prelink/All icalls.
24287
24288 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
24289
24290         * object.c, object.h: fix warnings and do some overflow checking
24291         when creating arrays.
24292
24293 2003-06-17  Dick Porter  <dick@ximian.com>
24294
24295         * file-io.h:
24296         * file-io.c: File attributes need to be tweaked slightly when
24297         passed from the managed to the w32 world.
24298
24299 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
24300         * profiler.h profiler-private.h profiler.c: Rework last patch
24301         based on suggestion by Paolo.
24302         
24303 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
24304
24305         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
24306         instruction level coverage data collection.
24307         * profiler.h profiler.c (: Added new callback function which can be
24308         used by the profiler to limit which functions should have coverage
24309         instrumentation.
24310         * profiler.c (mono_profiler_load): Call g_module_build_path to
24311         generate the file name of the profiler library.
24312
24313 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
24314
24315         * profiler.c, profiler.h, profiler-private.h: added basic block 
24316         coverage profiling API.
24317
24318 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
24319
24320         * reflection.c (mono_reflection_create_runtime_class): Add support
24321         for events in dynamically generated code.
24322
24323         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
24324         not allocated.
24325
24326 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
24327
24328         * icall.c: when getting timezone info, return reasonable values if we
24329         can't get the actual data.
24330
24331 2003-06-14  Dick Porter  <dick@ximian.com>
24332
24333         * threads.c (start_wrapper): Remove the reference to the thread
24334         object in the TLS data, so the thread object can be finalized.
24335         This won't be reached if the thread threw an uncaught exception,
24336         so those thread handles will stay referenced :-( (This is due to
24337         missing support for scanning thread-specific data in the Boehm GC
24338         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
24339
24340 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
24341
24342         * reflection.c: ensure streams and tables are first allocated with
24343         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
24344
24345 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
24346
24347         * icall.c: fixed GetElementType for byrefs (bug# 44792).
24348
24349 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
24350
24351         * reflection.c (mono_reflection_create_runtime_class): Add support for
24352         properties to dynamically created classes.
24353         * reflection.c: Fix a few places where non-MonoObjects were inserted
24354         into the tokens hashtable.
24355
24356 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
24357
24358         * object.c: some support to handle out of memory exceptions.
24359
24360 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
24361
24362         * marshal.c (mono_marshal_get_native_wrapper): support reference
24363         return types
24364
24365 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
24366
24367         * object.h, object.c: more portability stuff from Bernie Solomon.
24368         Unexport mono_object_allocate(). Added mono_object_unbox ().
24369         Set exitcode when an unhandled exception is thrown.
24370
24371 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
24372
24373         * marshal.c (mono_marshal_get_native_wrapper): use custom
24374         marshaler for return types.
24375
24376 2003-06-10  Dick Porter  <dick@ximian.com>
24377
24378         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
24379         ip_mreq is available
24380
24381 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
24382
24383         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
24384         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
24385         by Bernie Solomon <bernard@ugsolutions.com>.
24386
24387 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
24388
24389         * gc.c (mono_gc_init): Avoid error message on shutdown when
24390         GC_DONT_GC=1 is used.
24391
24392         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
24393         New icall to return the GUID of a module.
24394
24395 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
24396
24397         * class.c: ensure instance size always includes the parent's size
24398         even whem class size is set explicitly (fixes bug#44294).
24399
24400 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
24401
24402         * profiler.h, profiler.c: made the simple profiler thread-safe,
24403         get more accurate timing info. Allow the loading of an
24404         externally-developed profiler module.
24405
24406 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
24407
24408         * marshal.c (mono_marshal_get_native_wrapper): improved
24409         class/byref arguments.
24410         (mono_marshal_get_native_wrapper): better string marshaling support.
24411
24412 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
24413
24414         * class.c: ensure .pack and .size are handled correctly and
24415         simplified layout of static fields.
24416
24417 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
24418
24419         * appdomain.c
24420         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
24421
24422         * loader.c (mono_lookup_pinvoke_call): look for modules in the
24423         current directory (fix bug 44008)
24424
24425 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
24426
24427         * marshal.c (mono_marshal_get_native_wrapper): started support for
24428         custom marshalers.
24429         (mono_delegate_to_ftnptr): consider marshalling specifications
24430
24431 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
24432
24433         * reflection.c, reflection.h: emit custom marshal info.
24434
24435 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24436
24437         * object.c: free the GError.
24438         * icall.c: added CloseEvent_internal.
24439         * threads.[ch]:
24440         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
24441         call.
24442
24443 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
24444
24445         * loader.c (mono_method_get_signature): Add support for dynamic
24446         assemblies.
24447
24448 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
24449
24450         * reflection.c: fixed bug #43905.
24451
24452 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
24453
24454         * class.c, domain.c, icall.c, metadata.h, object.h: support for
24455         handling TypedReference and ArgIterator.
24456         * loader.c, loader.h: added function to get signature at call site.
24457
24458 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
24459
24460         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
24461         data readonly. Buglets and warning fixes. Some MethodSpec support.
24462
24463 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
24464
24465         * class.h, class.c, object.c: remove relative numbering support.
24466
24467 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
24468
24469         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
24470         free the string, until we get a chance to fix Gtk#
24471
24472 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24473
24474         * marshal.c: revert last patch.
24475
24476 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
24477
24478         * icall.c: updates for new mono_class_vtable() not calling
24479         the type constructor anymore.
24480
24481 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
24482
24483         * object.h, object.c: separate vtable creation from type
24484         initialization. Make running the .cctor thread safe.
24485
24486 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
24487
24488         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
24489
24490 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
24491
24492         * loader.c (mono_get_method): consider calling convention
24493
24494 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
24495
24496         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
24497         to return the invisible global type for a module.
24498
24499         * reflection.c (mono_image_build_metadata): Emit global fields too.
24500
24501 2003-05-20  Peter Williams  <peterw@ximian.com>
24502
24503         * loader.c (mono_lookup_internal_call): Add a few newlines.
24504
24505 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
24506
24507         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
24508         literal strings.
24509
24510         * appdomain.c (set_domain_search_path): Recalculate search path when
24511         AppDomainSetup.PrivateBinPath changes.
24512
24513         * object.c (mono_class_compute_gc_descriptor): It turns out some
24514         parts of the class libs (like System.Thread) holds pointers to
24515         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
24516         to treat native int a pointer type here.
24517         
24518 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
24519
24520         * appdomain.h, domain.c: add hashtable for jump target resolution.
24521
24522 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
24523
24524         * reflection.h reflection.c icall.c: Added new icalls 
24525         GetManifestResourceInfoInternal, GetModulesInternal and support
24526         infrastructure.
24527
24528 2003-05-16  Dick Porter  <dick@ximian.com>
24529
24530         * icall.c:
24531         * file-io.h:
24532         * file-io.c: Implement System.IO.MonoIO::GetTempPath
24533
24534 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
24535
24536         * object.c: mono_store_remote_field: little fix to previous patch.
24537
24538 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
24539
24540         * class.c: add constructors to array classes.
24541         * icall.c: special case array construction for InternalInvoke (),
24542
24543 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
24544
24545         * class.h class.c reflection.c object.c: Added support for field
24546         defaults in dynamically generated classes.
24547
24548 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
24549
24550         * reflection.c: properly encode charset for ddlimport.
24551
24552 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
24553
24554         * threads.c: allow compiling without GC.
24555
24556 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
24557
24558         * appdomain.h, object.c, object.h, threads.c, threads.h: added
24559         handling of thread static data.
24560
24561 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
24562
24563         * reflection.h, reflection.c: added mono_custom_attrs_free ().
24564
24565 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
24566
24567         * class.c (mono_array_class_get): always set the serializable flags
24568         (mono_array_class_get): always set the SEALED attribute for array types
24569
24570 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
24571
24572         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
24573         attributes (fix for bug 42021).
24574
24575 2003-05-12  Dick Porter  <dick@ximian.com>
24576
24577         * gc.c: Don't run finalizers when the finalizer thread is
24578         finishing up, because the default domain has already been
24579         destroyed.
24580
24581 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
24582
24583         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
24584         value is null, we should throw an exception.   This is slightly
24585         different than the other conventions used for the constructor.
24586
24587 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24588
24589         * socket-io.c: fixed windows build.
24590
24591 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24592
24593         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
24594
24595 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
24596
24597         * object.c (mono_string_new_wrapper): Compatibility fix for MS
24598         compilers.
24599
24600 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
24601
24602         * class.c (mono_class_layout_fields): Add experimental GC aware
24603         auto layout facility. Requires class library changes to work correctly.
24604
24605         (mono_class_setup_vtable): Avoid overriding explicit interface
24606         method implementations. Fixes iface3.exe test.
24607
24608         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
24609         object reference.
24610         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
24611         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
24612
24613         * metadata.h: Add new type classification macro which determines
24614         whenever the type holds an object reference.
24615
24616 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
24617
24618         * marshal.c (mono_marshal_get_native_wrapper): cleanups
24619
24620 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
24621
24622         * gc.c (finalizer_thread): Work around a GC bug.
24623
24624 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
24625
24626         * marshal.c (emit_struct_conv): allow unions
24627
24628         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
24629
24630 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
24631
24632         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
24633
24634 2003-05-06  Martin Baulig  <martin@ximian.com>
24635
24636         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
24637
24638 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24639
24640         * socket-io.c:
24641         (Select_internal): allow NULLs, don't create arrays if not needed.
24642         Coupled with Socket.cs changes.
24643
24644         * threadpool.c:
24645         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
24646         register a finalizer for it that will close the semaphore handle. This
24647         fixes the leak and make Lupus' test run with > 4080 loops.
24648
24649 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
24650
24651         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
24652         Jerome Laban (bug #42287)
24653
24654 2003-05-02  Martin Baulig  <martin@ximian.com>
24655
24656         * debug-mono-symfile.h
24657         (MonoSymbolFile): Moved declaration into mono-debug.h.
24658         (MonoDebugMethodJitInfo): Likewise.
24659         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
24660         argument.
24661         (_mono_debug_address_from_il_offset): Take a
24662         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
24663
24664         * mono-debug.h
24665         (MonoDebugDomainData): New struct.
24666         (mono_debug_get_domain_data): New function.
24667         (mono_debug_add_method): Take an additional `MonoDomain *'
24668         argument.
24669         (mono_debug_source_location_from_address): Likewise.
24670         (mono_debug_il_offset_from_address): Likewise.
24671         (mono_debug_address_from_il_offset): Likewise.
24672
24673 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
24674
24675         * reflection.c: one more check for null type in custom attrs.
24676
24677 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24678
24679         * reflection.c: avoid warning (comparison is always false due to limited
24680         range of data type).
24681
24682 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24683
24684         * icall.c: throw an exception in Type.GetField if the argument 'name'
24685         is NULL.
24686
24687 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
24688
24689         * reflection.c: fixed handling of enums in named arguments to custom
24690         attributes (bug #42123).
24691
24692 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
24693
24694         * reflection.c: use the right array element type and handle
24695         a null for a Type argument, too.
24696
24697 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
24698
24699         * reflection.c: handle arrays as arguments to custom attributes.
24700
24701 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
24702
24703         * reflection.c: handle a string value in a custom attr
24704         ctor that takes an object.
24705
24706 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
24707
24708         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
24709         (fix bug #42063)
24710
24711 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
24712
24713         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
24714
24715 2003-04-27  Martin Baulig  <martin@ximian.com>
24716
24717         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
24718         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
24719         MONO_DEBUGGER_EVENT_BREAKPOINT.
24720         (mono_breakpoint_trampoline_code): Removed.
24721         (mono_debugger_event_handler): The last argument is now a
24722         `guint32'.
24723         (mono_debugger_insert_breakpoint_full): Removed the
24724         `use_trampoline' argument.
24725         (mono_debugger_method_has_breakpoint): Likewise.
24726         (mono_debugger_trampoline_breakpoint_callback): Renamed to
24727         mono_debugger_breakpoint_callback(); take the method and
24728         breakpoint number as arguments.
24729
24730 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
24731
24732         * metadata.c: fix off by one when loading parameters attributes.
24733
24734 2003-04-24  Martin Baulig  <martin@ximian.com>
24735
24736         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
24737
24738 2003-04-24  Martin Baulig  <martin@ximian.com>
24739
24740         * mono-debug-debugger.c: Moved all code which interacts with the
24741         Mono Debugger here.
24742
24743         * debug-mono-symfile.c: This code now just deals with the symbol
24744         file itself, the debugger code is now in mono-debug-debugger.c.
24745
24746 2003-04-23  Martin Baulig  <martin@ximian.com>
24747
24748         * mono-debug.c (mono_debug_source_location_from_il_offset):
24749         New method; like mono_debug_source_location_from_address(), but
24750         takes an IL offset instead of a machine address.
24751
24752 2003-04-23  Martin Baulig  <martin@ximian.com>
24753
24754         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
24755         `line' field; this is now computed by the debugger.
24756
24757 2003-04-23  Martin Baulig  <martin@ximian.com>
24758
24759         * mono-debug.[ch]: New files.  This is the new debugging interface.
24760
24761         * mono-debug-debugger.[ch]: New files.  Moved all code which
24762         interacts with the Mono Debugger here.
24763
24764 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
24765
24766         * domain.c (mono_init): initialize mono_defaults.monitor_class
24767
24768 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
24769
24770         * reflection.c (method_encode_code): Add a spicy exception to help
24771         future compiler authors.
24772
24773 2003-04-21  Martin Baulig  <martin@ximian.com>
24774
24775         * icall.c
24776         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
24777         Make this work with relative pathnames; g_filename_to_uri() needs
24778         an absolute filename.
24779
24780 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
24781
24782         * icall.c: Track name changes in Object and ValueType.
24783
24784 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
24785
24786         * metadata.c (mono_type_stack_size): size should be a multiple of
24787         sizeof (gpointer)
24788
24789 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24790
24791         * gc.c:
24792         (internal_domain_finalize): moved into mono_domain_finalize. No need
24793         to create another thread because the finalizers will be run in the
24794         finalizer thread.
24795         
24796         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
24797         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
24798         to be run (MS does this too).
24799
24800 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
24801
24802         * object.c (mono_class_compute_gc_descriptor): Update comment.
24803
24804         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
24805
24806         * image.h: Add synchronized wrapper cache.
24807
24808         * image.c (do_mono_image_open): Initialize cache.
24809
24810         * reflection.c (create_dynamic_mono_image): Initialize cache.
24811
24812 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24813
24814         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
24815         ves_icall_System_Buffer_ByteLengthInternal.
24816
24817 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
24818
24819         * reflection.c: setup klass->nested_in earlier. Allow
24820         a dash in the assembly name.
24821
24822 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
24823
24824         * metadata.c (mono_type_to_unmanaged): dont access
24825         type->data.klass for MONO_TYPE_OBJECT
24826         (mono_type_to_unmanaged): consider System.Delegate class
24827
24828 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
24829
24830         * class.c: just setup supertypes in the proper place instead of
24831         initializing the full element class for arrays.
24832
24833 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
24834
24835         * class.c: ensure the element class of arrays is initialized.
24836         Setup the supertype info for array classes, too.
24837
24838 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
24839
24840         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
24841
24842 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24843
24844         * Makefile.am: re-added -m option when running cygpath. This way,
24845         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
24846         separator.
24847         * mono-config.c: same codepath for locating mono config file for WIN32
24848         and the rest.
24849         * assembly.c: if mono_assembly_setrootdir is called, don't override
24850         the value set.
24851
24852 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24853
24854         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
24855         MONO_ASSEMBLIES variable.
24856
24857 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
24858
24859         * icall.c: added Assembly::GetNamespaces() icall.
24860
24861 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24862
24863         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
24864
24865 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
24866
24867         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
24868         * object.c: fixed bug in the construction of vtable for proxies
24869
24870 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
24871
24872         * object.c (mono_array_new): Mark mono_array_new as an icall.
24873
24874 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24875
24876         * class.c: fixed test for public method when overriding interfaces.
24877         Closes bug #40970.
24878
24879 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
24880
24881         * appdomain.h, domain.c: added mono_domain_foreach() to
24882         be able to access the currently loaded appdomains.
24883         * object.c: make string interning work across sppdomains.
24884         Mark some functions for use as icalls.
24885
24886 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
24887
24888         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
24889
24890         * reflection.h reflection.c: Allocate long living data using 
24891         GC_MALLOC_ATOMIC so the collector does not need to scan it.
24892
24893         * reflection.c: Double the allocation size in streams instead of
24894         increasing it, to prevent unneccesary copying on large assemblies.
24895         
24896         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
24897         creation if the assembly does not have the Run flag set.
24898
24899 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
24900
24901         * class.h: avoid the C++ keywords in header files (Jerome Laban
24902         spotted and fixed this).
24903
24904 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24905
24906         * object.c:
24907         (mono_unhandled_exception): fill in the arguments for the
24908         UnhandledException event. Only trigger that event for the default
24909         domain (as MS does).
24910
24911 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
24912
24913         * object.c: Improve typed allocation stuff based on suggestions from
24914         Paolo. Also turn it on if the GC library supports it.
24915
24916 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
24917
24918         * object.c object.h class.h: Added experimental typed allocation
24919         facility using the interfaces in gc_gcj.h.
24920
24921         * os/gc_wrapper.h: Added new include files.
24922         
24923 2003-04-03  Martin Baulig  <martin@ximian.com>
24924
24925         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
24926         which is not yet enabled by default.
24927
24928         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
24929         functions.
24930         (mono_gc_lock, mono_gc_unlock): New static functions.
24931
24932         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
24933         functions; stop/start the world for the garbage collector.  This
24934         is using the windows API; we need to complete the SuspendThread()/
24935         ResumeThread() implementation in the io-layer to make this work on Unix.
24936         (mono_gc_push_all_stacks): New public function; tells the garbage
24937         collector about the stack pointers from all managed threads.
24938
24939 2003-04-03  Martin Baulig  <martin@ximian.com>
24940
24941         * object.h (MonoThread): Added `gpointer stack_ptr'.
24942
24943         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
24944
24945 2003-04-03  Martin Baulig  <martin@ximian.com>
24946
24947         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
24948
24949 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
24950
24951         * reflection.c (typebuilder_setup_fields): Initialize field.first and
24952         field.last.
24953
24954 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
24955
24956         * loader.c (mono_lookup_internal_call): Report the corlib that is
24957         out of sync.
24958
24959 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
24960
24961         * icall.c (ves_icall_type_GetTypeCode): fixed check for
24962         System.DBNull (it's class not valuetype).
24963
24964 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
24965
24966         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
24967         if the array method was already assigned a token (fixes bug#40646).
24968
24969 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
24970
24971         * reflection.c (mono_reflection_get_type): Attempt type resolve even
24972         if no assembly is given.
24973
24974 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
24975
24976         * metadata.h: Added the new tables.
24977
24978         * row-indexes.h: Added definitions for new tables.
24979
24980         * metadata.c: Add schemas for new tables, and add support for
24981         computing the sizes of them.
24982
24983         * class.c: Update for handling the new type cases.
24984
24985 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
24986
24987         * metadata.h (MONO_TYPE_IS_VOID): new macro
24988
24989 2003-03-31  Martin Baulig  <martin@ximian.com>
24990
24991         * threads.h (MonoThreadCallbacks): Added `thread_created'.
24992
24993         * threads.c (mono_thread_new_init): Call `thread_created' in the
24994         mono_thread_callbacks.
24995
24996 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
24997
24998         * loader.h: added marshalbyrefobject_class to mono_defaults
24999         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
25000         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
25001           generation of output parameters.
25002           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
25003         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
25004           contextbound and the target object belongs to the context of the caller.
25005         * object.h: added context and unwrapped_server variables in MonoRealProxy.
25006         * object.c: Implemented support for interfaces and abstract classes
25007           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
25008           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
25009
25010 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
25011
25012         * class.h class.c (mono_class_is_subclass_of): New function.
25013         
25014         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
25015         routines for most common case (calls from ArrayList::ToArray).
25016
25017         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
25018         routine so programs which call Environment::Exit() can be profiled.
25019
25020         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
25021         Added MONO_ARCH_SAVE_REGS.
25022
25023         * icall.c (ves_icall_type_is_subtype_of): Use new function.
25024
25025 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
25026
25027         * blob.h: Add a couple of new MonoType types definitions.
25028
25029         * tabledefs.h: Add a couple of new call convs.
25030
25031 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
25032
25033         * reflection.h (MonoReflectionDynamicAssembly): track changes in
25034         the layout of the class.
25035
25036         * reflection.c (alloc_table): double the size on overflow to avoid
25037         unnecessary copying.
25038
25039         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
25040         avoid filling out metadata tables and blobs. Also set mb->ilgen to
25041         null so it can be garbage collected.
25042         
25043 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
25044
25045         * reflection.c (mono_reflection_get_type): Return the resolved type
25046         only if it is in the assembly we searched.
25047
25048         * reflection.c (ensure_runtime_vtable): Initialize method slots.
25049
25050         * class.c (mono_class_setup_vtable): Set the slot of the overriding
25051         method.
25052
25053 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25054
25055         * appdomain.c:
25056         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
25057         the right one is 'file:///blah', but MS allows it.
25058         * assembly.c:
25059         (mono_assembly_open): allow 'file://blah'
25060
25061         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
25062
25063 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
25064
25065         * socket-io.c: fixes bug #40310.
25066
25067 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
25068
25069         * reflection.c (mono_reflection_parse_type): handle deeply nested
25070         types correctly.
25071
25072         * reflection.c (mono_image_create_token): Use unique token values
25073         since they will be put into a hash table.
25074
25075         * class.c (mono_class_setup_vtable): If a method occurs in more than
25076         one place in the vtable, and it gets overriden, then change the
25077         other occurances too.
25078
25079         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
25080         object as return type.
25081
25082 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
25083
25084         * icall.c: Deleted "ToString" implementation for double and float
25085         because they are full implemented in managed code.
25086
25087 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
25088
25089         * reflection.c, reflection.h: implemented and exported functions
25090         to retrieve info about custom attributes.
25091
25092 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25093
25094         * appdomain.c: moved Uri handling to assembly.c
25095         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
25096         work when using a file Uri in *nix and windows.
25097
25098         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
25099         GetReferencedAssemblies.
25100
25101 2003-03-18  Dick Porter  <dick@ximian.com>
25102
25103         * icall.c: Rename a couple of internal calls
25104
25105         * threads.c: Set the thread state to Stopped when a thread exits.
25106         Fixes bug 39377.
25107
25108 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
25109
25110         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
25111         New icall.
25112
25113         * object.c (mono_class_vtable): fix warning.
25114
25115 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
25116
25117         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
25118
25119         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
25120         memory.
25121         (method_encode_clauses): Create exception info structures in the right
25122         order.
25123         (mono_reflection_setup_internal_class): Initialize supertypes field.
25124
25125         * class.c object.c: Handle interfaces which implement other interfaces 
25126         correctly.
25127
25128         * class.h class.c: Move the supertypes array initialization code into 
25129         a separate function so it can be used for dynamic types too. Also call
25130         it earlier, in mono_class_init(), since it can be used before the
25131         type is initialized.
25132
25133 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25134
25135         * Makefile.am:
25136         * assembly.c:
25137         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
25138
25139         * appdomain.c:
25140         * appdomain.h:
25141         * marshal.c:
25142         * object.c: remove warnings.
25143
25144 2003-03-13  Martin Baulig  <martin@ximian.com>
25145
25146         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
25147         (MonoDebugLexicalBlockEntry): New types.
25148
25149         * debug-mono-symfile.c
25150         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
25151
25152 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25153
25154         * process.c: ret can be any non-zero value accroding to MS doc.
25155
25156 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
25157
25158         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
25159         fixing a warning for a miss-used prototype, would have cause
25160         random memory corruption.
25161
25162 2003-03-07  Martin Baulig  <martin@ximian.com>
25163
25164         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
25165         getting really annoying ....
25166
25167 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
25168
25169         * reflection.c (fixup_method): added support for array methods.
25170
25171 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
25172
25173         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
25174         (pointed out by Michael Adams).
25175
25176 2003-03-04  Dick Porter  <dick@ximian.com>
25177
25178         * icall.c: Temporarily reverted the Double and Single ToString()
25179         change, because it broke nunit.
25180
25181 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
25182
25183         * object.h, threads.h: make include files compatible with C++
25184         (patch by Jerome Laban <jlaban@wanadoo.fr>).
25185
25186 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
25187
25188         * icall.c: Erased ToString helper functions for Double and Single.
25189         Now, that implementations ar all in managed code (Double and Single
25190         Formatters).
25191
25192 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
25193
25194         * appdomain.c: Added method for initializing the default context of
25195         a domain. Added internal call for getting the default context.
25196         * appdomain.h: Added context variable in MonoDomain struct.
25197         * domain.c: mono_domain_set also sets the default context of the domain
25198         * icall.c: Mapped internal method InternalGetDefaultContext.
25199         * object.c: mono_object_get_virtual_method returns always a remoting
25200         wrapper if the object is a transparent proxy.
25201         mono_runtime_invoke_array: when creating an object by calling the
25202         constructor, if the created object is a proxy, then the constructor should
25203         be called using the a remoting wrapper.
25204
25205 2003-03-03  Dick Porter  <dick@ximian.com>
25206
25207         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
25208         variable so it compiles on solaris.  Problem spotted by
25209         Christopher Taylor <ct@cs.clemson.edu>
25210
25211 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25212
25213         * appdomain.c:
25214         (get_info_from_assembly_name): don't leak value.
25215
25216         * icall.c:
25217         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
25218         result.
25219
25220 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
25221
25222         * assembly.c: export mono_image_load_references ().
25223         * class.c: handle function pointers. mono_class_from_name() now
25224         supports nested type names directly.
25225
25226 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
25227
25228         * reflection.h reflection.c: Encode already created dynamic methods 
25229         and fields correctly as a DEF instead of a REF.
25230
25231         * reflection.c: Get rid of the force_ref argument to 
25232         mono_image_typedef_or_ref since it was wrong in the first place.
25233
25234         * string-icalls.c: add error checking to string constructors according
25235         to the MSDN docs.
25236
25237         * reflection.c: Emit types in the order their TypeBuilders were 
25238         created. Previously, a new table index was assigned to each type before
25239         the tables were emitted. This was wrong because the signature blob
25240         might already refer to a type by its original table index.
25241
25242 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
25243
25244         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
25245         change.
25246         
25247 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25248
25249         * Makefile.am: make assemblies dir have \ instead of / on windows.
25250
25251 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
25252
25253         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
25254         iterate over the NESTEDCLASS table using a linear search since the
25255         table is not guaranteed to be sorted by the secondary key.
25256
25257         * class.c (mono_class_create_from_typedef): fixed up call to
25258         mono_metadata_nesting_typedef.
25259         
25260 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
25261
25262         * marshal.c (mono_string_to_byvalstr): clear the memory as
25263         suggested by Jerome Laban <jlaban@wanadoo.fr>
25264
25265 2003-02-26  Dick Porter  <dick@ximian.com>
25266
25267         * process.c: Cope with padding in .rsrc blocks
25268
25269 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
25270
25271         * metadata.h: reverted the filter_len change, it breaks reflection
25272         
25273 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
25274
25275         * metadata.h: added a new field to store the filter_len
25276         
25277
25278 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
25279
25280         * reflection.c: handle custom attributes for types and members
25281         created with Reflection.Emit (bug#38422).
25282
25283 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
25284
25285         * reflection.c: define RTSpecialName automatically for constructors for
25286         compatibility with MS.NET.
25287
25288         * reflection.c (mono_reflection_create_runtime_class): initialize
25289         nested_in field of dynamically created classes.
25290
25291 2003-02-22  Martin Baulig  <martin@ximian.com>
25292
25293         * debug-mono-symfile.h: Incremented version number.
25294
25295 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
25296
25297         * object.h icall.c process.c: fix warnings.
25298
25299 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
25300
25301         * appdomain.h appdomain.c:
25302         (mono_domain_try_type_resolve): split the 
25303         name_or_tb argument into a name and a tb argument.
25304         (mono_domain_has_type_resolve): new function to check whenever the
25305         application has registered a TypeResolve event handler.
25306         
25307         * icall.c reflection.h reflection.c: move the type resolve logic into
25308         mono_reflection_get_type () so it will be invoked when 
25309         Assembly::GetType () is called.
25310
25311         * reflection.c:
25312         (mono_reflection_get_type): renamed to get_type_internal.
25313         (mono_reflection_get_type): fixed type name generation so it works 
25314         for nested types too.
25315         (mono_reflection_get_type): call has_type_resolve () to avoid the 
25316         costly type name generation if there is no resolve event handler.
25317
25318 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
25319
25320         * class.c, image.c: load exported types from file references.
25321
25322 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
25323
25324         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
25325           used to cache the managed methods used to create proxies and make 
25326           remote invocation of methods.
25327         * class.h: Added in MonoVTable a flag to indicate that a class needs 
25328           to be remotely created.
25329         * object.c: Modified the method mono_class_vtable(). It now initializes 
25330           the remote flag of the vtable. Modified mono_object_new_specific(), 
25331           so now it checks the remote flag.
25332         * icall.c: Added a couple of internal methods, one for enabling instance 
25333           creation interception for a type, and one for creating objects bypassing
25334           the remote check.
25335
25336 2003-02-18  Martin Baulig  <martin@ximian.com>
25337
25338         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
25339         New interncall to get a method's metadata token.
25340
25341         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
25342         New interncall for the debugger.
25343
25344 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
25345
25346         * class.c (mono_class_setup_vtable): allocate supertype array
25347
25348 2003-02-18  Martin Baulig  <martin@ximian.com>
25349
25350         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
25351
25352 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25353
25354         * reflection.c:
25355         (assembly_name_to_aname): jump over unknown properties (i've found
25356         something like: 'type, assembly, version=xxx, custom=null, public...',
25357         so now will ignore custom=null and still get the rest of the values).
25358
25359 2003-02-17  Dick Porter  <dick@ximian.com>
25360
25361         * threads.c: Have Thread.Start() wait for a semaphore to signal
25362         that the thread has set up all its local data.  This fixes bug
25363         34323, where Abort() raced the new thread's TLS data.
25364
25365         Also removes the handle_store() call from start_wrapper, because
25366         threads are now always created suspended and there is no longer a
25367         race between the parent and child threads to store the info.
25368
25369 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
25370
25371         * image.c: explain the #- heap issue in a message, hopefully
25372         avoiding FAQs on mono-list.
25373
25374 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25375
25376         * icall.c:
25377         (GetEntryAssembly): if the domain has not invoked
25378         AppDomain.ExecuteAssembly yet, return the assembly of the default
25379         AppDomain.
25380
25381 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
25382
25383         * class.c (mono_ldtoken): make it work in dynamic assemblies.
25384
25385 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
25386
25387         * metadata.c, reflection.c: simple speedup to type hash
25388         and equals code.
25389
25390 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
25391
25392         * image.c, image.h, class.c, assembly.c: move module loading
25393         to MonoImage. When loading metadata, consider alignemnet from
25394         the start of metadata, not from the metadata address in memory.
25395
25396 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
25397
25398         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
25399         AssemblyBuilder objects. Factored out custom attribute creation into
25400         a separate function.
25401         (create_custom_attr): new function to create custom attributes.
25402
25403 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
25404
25405         * Makefile.am: Got tired of typing the full pathname to pedump.
25406         Until there is another option, am installing this.
25407
25408 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
25409
25410         * class.c (class_compute_field_layout): always set field->parent 
25411         (mono_ldtoken): use mono_defaults.fieldhandle_class;
25412
25413 2003-02-11  Dick Porter  <dick@ximian.com>
25414
25415         * threads-types.h:
25416         * monitor.c: Rewrote Monitor, making lock much faster and
25417         Pulse/Wait work as specified.  Also uses much fewer handles, and only
25418         creates them as needed.
25419
25420         * exception.c: Added SynchronizationLockException
25421
25422         * threads.c: Deleted old Monitor implementation.  The new one is
25423         in a new file.
25424
25425 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
25426
25427         * class.c: handled TypedReference type code. Set the correct size for
25428         class data. Setup interface_offsets for interface classes, too.
25429
25430 2003-02-09  Martin Baulig  <martin@ximian.com>
25431
25432         * debug-mono-symfile.h: Reflect latest symbol writer changes.
25433
25434 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
25435
25436         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
25437         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
25438         * object.c: fixed mono_object_get_virtual_method () for interfaces.
25439         * verify.c: check for code that runs after the end of the method.
25440
25441 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
25442
25443         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
25444         "System.Math::Round2".
25445         * sysmath.h: Added Floor, Round and Round2 definitions.
25446         * sysmath.c: Modified certain functions that were not 100% compliant
25447         with MS.NET (math precision) and added the implementation of Floor,
25448         Round and Round2.
25449
25450 2003-02-07  Martin Baulig  <martin@ximian.com>
25451
25452         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
25453
25454 2003-02-07  Martin Baulig  <martin@ximian.com>
25455
25456         * debug-mono-symfile.c: Reflected latest symwriter changes.
25457         (mono_debug_create_mono_symbol_file): Removed.
25458         (mono_debug_open_mono_symbol_file): Take an argument which
25459         specifies whether to create a dynamic symbol file.
25460
25461 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
25462
25463         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
25464
25465 2003-02-05  Martin Baulig  <martin@ximian.com>
25466
25467         * reflection.c (mono_image_build_metadata): Make this public,
25468         protect it against being called multiple times, don't create
25469         resources and don't build the compressed metadata here.
25470         (mono_image_create_pefile): Do this here.
25471
25472         * icall.c
25473         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
25474
25475 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25476
25477         * socket-io.c: fixed bug #36322.
25478
25479 2003-02-06  Piers Haken <piersh@friskit.com>
25480
25481         * appdomain.[ch]:
25482         * class.h:
25483         * debug-mono-symfile.c:
25484         * icall.c:
25485         * loader.c:
25486         * mono-config.c:
25487         * monosn.c:
25488         * reflection.c:
25489         * socket-io.c: warning cleanups
25490
25491 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
25492
25493         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
25494         function. works like remoting invoke, but does a check for the Proxy first.
25495
25496 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
25497
25498         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
25499
25500 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
25501
25502         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
25503         array of pointers.
25504         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
25505         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
25506
25507         * object.c (mono_store_remote_field_new): used by the new jit
25508         instead of mono_store_remote_field
25509         (mono_load_remote_field_new): used by the new jit
25510         instead of mono_load_remote_field
25511
25512 2003-02-05  Patrik Torstensson
25513
25514         * appdomain.c: changed unload to take the domain id instead
25515         of domain
25516         
25517         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
25518
25519
25520 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25521
25522         * appdomain.c: don't look for assemblies in ApplicationBase if
25523         PrivateBinPathProbe is set.
25524
25525 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25526
25527         * object.c: make the first argument in main_args contain the absolute
25528         path to the assembly. Fixes bug #37511.
25529
25530 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25531
25532         * icall.c: get correct UTC offset for countries not using daylight
25533         time saving. Fixes bug #30030.
25534
25535 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25536
25537         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
25538         and 1 are the family).
25539
25540 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
25541
25542         * icall.c (ves_icall_InternalExecute): removed wrong assertion
25543
25544         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
25545
25546 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
25547
25548         * reflection.c: added support for SignatureHelper tokens, which is
25549         needed by the Calli opcode.
25550
25551         * reflection.h: track changes to SignatureHelper class.
25552
25553         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
25554
25555 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25556
25557         * appdomain.c: fixed loading assemblies from PrivateBinPath.
25558
25559 2003-02-03  Patrik Torstensson
25560         * appdomain.[c|h], domain.c : 
25561          - Added support for getting a domain via domain id
25562          - Support for setting and getting domain from System.AppDomain 
25563            (used in cross appdomain channel)
25564          - Added support for get/set for a MonoAppContext on a thread 
25565            (Context class in System.Runtime.Remoting.Contexts),
25566          - Removed hack in Get/SetData and ExecuteAssembly.
25567         
25568         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
25569         the managed world to get control when a proxy is created.
25570
25571         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
25572         
25573 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
25574
25575         * icall.c
25576         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
25577         Populate the codebase field as well.
25578
25579 2003-02-02  Martin Baulig  <martin@ximian.com>
25580
25581         * debug-mono-symfile.c
25582         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
25583         (mono_debug_symfile_add_method): Allow interncalls.
25584
25585 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25586
25587         * icall.c: throw parse exception if strtod fails or the string is empty.
25588
25589 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
25590
25591         * marshal.c: handle object type separately from defined
25592         class types.
25593
25594 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
25595
25596         * marshal.c: handle NATIVE_LPSTR for strings when it's
25597         explicitly specified.
25598
25599 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
25600
25601         * reflection.c, reflection.h, icall.c: setup the reflection
25602         handle cache for ModuleBuilders and AssemblyBuilders.
25603
25604 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
25605
25606         * reflection.c (reflection_methodbuilder_to_mono_method): set
25607         pinvoke flag
25608
25609 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25610
25611         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
25612
25613 2003-01-29  Dick Porter  <dick@ximian.com>
25614
25615         * threads.c: No need for the fake_thread kludge now that Thread
25616         doesn't run a class constructor
25617         
25618 2003-01-29  Dick Porter  <dick@ximian.com>
25619
25620         * threads.c: Use g_direct_hash instead of the rather bogus
25621         g_int_hash
25622
25623 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
25624
25625         * marshal.c (mono_marshal_get_native_wrapper): add check for null
25626         (fix pinvoke12.exe)
25627         (mono_marshal_get_struct_to_ptr): generate valid IL code
25628         (mono_marshal_get_ptr_to_struct): generate valid IL code
25629         (*): correctly set sig->pinvoke, we need to memdup the signature
25630         to do that
25631
25632 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
25633
25634         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
25635         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
25636
25637 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
25638
25639         * profiler.c: provide more callers information.
25640
25641 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
25642
25643         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
25644
25645         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
25646
25647         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
25648
25649 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25650
25651         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
25652         exception instead of going into an infinite loop on dates which it 
25653         can't yet handle.
25654
25655         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
25656         out-of-range exception if needed.
25657
25658         * class.c (mono_class_setup_vtable): allow a virtual method to provide
25659         an implementation for an interface method and to override an inherited
25660         method at the same time. 
25661         Imagine a scenario when a virtual method is used to override a
25662         virtual abstract method in a parent class, and this same method 
25663         provides an implementation for an method inherited from an interface. 
25664         In this case, the interface resolution code will set im->slot, which 
25665         means that the virtual method override pass will skip this method 
25666         which means a pointer to the abstract method inherited from the parent
25667         will remain in the vtable of this non-abstract class.
25668
25669         * class.c: (mono_class_setup_vtable): continue search for a real 
25670         method if only an abstract method is found.     
25671
25672 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
25673
25674         * reflection.c: add size to encoding for ByValStr and ByValArray
25675         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
25676
25677 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25678
25679         * class.c (mono_class_setup_vtable): pass the override info as an
25680         argument.
25681
25682         * class.c (mono_class_setup_vtable): set the slot of overriding methods
25683         correctly.
25684         
25685         * reflection.c (ensure_runtime_vtable); add support for method 
25686         overrides.
25687         
25688 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25689
25690         * reflection.c (resolution_scope_from_image): Hack to work to work with
25691         dynamic assemblies.
25692
25693         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
25694         added a 'force_ref' argument to force this function to allways return 
25695         a TypeRef. This is needed by mono_image_get_memberref_token ().
25696         
25697 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25698
25699         * reflection.c (mono_image_get_type_info): interfaces really don't have
25700         a parent.
25701
25702         * reflection.c (mono_image_basic_init): fill out missing fields of
25703         image structure.
25704
25705         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
25706         dynamic assemblies. This is required so dynamic assemblies show up in
25707         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
25708         Type::GetType() etc. This is consistent with MS behaviour.
25709
25710         * image.c image.h reflection.c: add newly created classes to the name 
25711         cache so mono_class_get () will find them.      
25712
25713 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
25714
25715         First part of changes to get IKVM.NET running under mono.
25716         
25717         * appdomain.h, appdomain.c: added new function 
25718         mono_domain_try_type_resolve() which will emit TypeResolve events. 
25719         This function will call AppDomain::DoTypeResolve to do the actual work.
25720
25721         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
25722         moved existing code dealing with dynamic tokens to a new function 
25723         called mono_reflection_lookup_dynamic_token (). This function will 
25724         raise TypeResolve events when appropriate. Since reflection.c is not 
25725         part of libmetadata, a new hook function called 
25726         mono_lookup_dynamic_token() is added to class.c which will call this.
25727
25728         * assembly.h assembly.c: make the invoke_load_hook function public,
25729         so it can be called for dynamic assemblies.
25730
25731         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
25732
25733         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
25734         type isn't found.
25735
25736         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
25737         MonoGHashTable, since it contains pointers to objects which the GC 
25738         needs to track.
25739
25740         * assembly.c (search_loaded): remove unused variable.
25741         
25742 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
25743
25744         * object.c: fixed issue exposed by gcc-generated IL programs
25745         that use RVA data for pointers.
25746
25747 2003-01-25  Martin Baulig  <martin@ximian.com>
25748
25749         * threads.c (start_wrapper): Moved the initialization of
25750         `start_func' above the mono_new_thread_init() call to which we
25751         pass it as argument.
25752
25753 2003-01-24  Martin Baulig  <martin@ximian.com>
25754
25755         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
25756         the MonoThread pointer.
25757
25758 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
25759
25760         * icall.c: Rename `PowImpl' to Pow.
25761
25762 2003-01-23  Dick Porter  <dick@ximian.com>
25763
25764         * threads.c (start_wrapper): Create a Thread object if needed, so
25765         the Main() thread can do the class initialisation in a subthread
25766         that has been set up to allow managed code execution.
25767
25768         Pass the thread ID instead of the MonoThread pointer to the thread
25769         start and attach callbacks.  This change is required, because the
25770         jit thread start callback must be called _before_ the Thread
25771         object can be created.
25772         
25773         (mono_thread_init): Removed much object creation code that is no
25774         longer needed.  No managed code is called from here now.
25775
25776         * object.c (mono_runtime_exec_managed_code): Create a subthread
25777         for Main, and call back to the runtime to use it.
25778         Set the exit code when Main exits.
25779
25780         * gc.c: Make sure domain finalisation happens in a subthread.
25781         Re-enable threaded GC, fixing bug 31333 (again).
25782
25783         * environment.c: System.Environment internall calls (so far just
25784         ExitCode is here, the others are still in icall.c)
25785
25786         * appdomain.c (mono_runtime_cleanup): All threads running managed
25787         code should have finished before mono_runtime_cleanup() is
25788         reached, so no need to clean up threads.
25789
25790 2003-01-22  Martin Baulig  <martin@ximian.com>
25791
25792         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
25793         `gpointer func' arguments.      
25794         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
25795         but added `MonoThread *thread' argument.
25796         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
25797
25798         * threads.c (mono_new_thread_init): Added `gpointer func' argument
25799         and pass it to the mono_thread_start_cb callback.
25800         (mono_install_thread_callbacks): New public function to install a
25801         set of callbacks which are set by the debugger.
25802         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
25803
25804 2003-01-22  Martin Baulig  <martin@ximian.com>
25805
25806         * Makefile.am: Install debug-mono-symfile.h.
25807
25808 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
25809
25810         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
25811
25812 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
25813
25814         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
25815         * class.c (mono_ptr_class_get): correctly set access levels of pointers
25816         (mono_array_class_get): correctly set access levels of arrays
25817
25818 2003-01-20      Patrik Torstensson
25819         * image.h (MonoAssemblyName): changed major, minor, build, revision
25820         from signed to unsigned.
25821
25822 2003-01-20  sean kasun <skasun@azstarnet.com>
25823
25824         * reflection.c (load_cattr_value): Now this handles
25825         MONO_TYPE_SZARRAY.  Fixes bug #35629
25826
25827 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
25828
25829         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
25830         integer value
25831
25832 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25833
25834         * decimal.c: fixed bug #26056.
25835
25836 2003-01-17  Martin Baulig  <martin@ximian.com>
25837
25838         * gc.c: Raise an ExecutionEngineException instead of using g_error().
25839
25840 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25841
25842         * exception.[ch]:
25843         (mono_get_exception_type_initialization): new function.
25844
25845         * object.c: throw a TypeInitializationException when an exception is
25846         thrown invoking the class constructor.
25847
25848 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25849
25850         * reflection.c: fixed attribute reading.
25851
25852 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25853
25854         * icall.c:
25855         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
25856         provided, look for the type in the calling assembly and then in
25857         mscorlib; if the assembly name is provided, only try that one.
25858
25859 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
25860
25861         * object.c: register the vtable before there is a chance it's
25862         queried again recursively.
25863
25864 2003-01-13  Duncan Mak  <duncan@ximian.com>
25865
25866         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
25867         gc-internal.h. 
25868         
25869 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
25870
25871         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
25872
25873 2003-01-11  Martin Baulig  <martin@ximian.com>
25874
25875         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
25876         this to 20 for the release.
25877
25878 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
25879
25880         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
25881
25882         * loader.c (mono_method_get_marshal_info): bug fix
25883
25884         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
25885         structures with explicit layout
25886
25887 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
25888
25889         * profiler.c: made the output more readable (and sorted). 
25890         Added caller information for the allocation profiler.
25891
25892 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
25893
25894         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
25895
25896 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25897
25898         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
25899         to get value types.
25900         
25901 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
25902
25903         * object.c, profiler.h, profiler.c, profiler-private.h:
25904         Added object allocation profiler.
25905
25906 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
25907
25908         * reflection.h, reflection.c: handle global methods.
25909         Compress blob entries.
25910
25911 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
25912
25913         * marshal.c: fix compilation.
25914
25915 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
25916
25917         * loader.c (mono_method_get_marshal_info): impl.
25918
25919         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
25920
25921 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25922
25923         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
25924         for reference types.
25925
25926 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
25927
25928         * loader.c: fixed off by one error in loaded parameter names.
25929
25930 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
25931
25932         * marshal.c (mono_marshal_get_icall_wrapper): like
25933         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
25934         instead of a MonoMethod.
25935
25936 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25937
25938         * decimal.c: fixed bug #36537.
25939
25940 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
25941
25942         * marshal.c: throw a missing method exception if a
25943         P/Invoke method is not found.
25944
25945 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
25946
25947         * icall.c: allow a null this for constructors.
25948
25949 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
25950
25951         * icall.c: raise the proper exceptions if the arguments to the
25952         internal Invoke are incorrect.
25953
25954 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
25955
25956         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
25957
25958 2003-01-03  Martin Baulig  <martin@ximian.com>
25959
25960         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
25961
25962 2002-12-31  Martin Baulig  <martin@ximian.com>
25963
25964         * debug-mono-symfile.c: Completely rewrote the type section.
25965         Instead of using individual malloc()ed fields, we use one big
25966         continuous memory area and offsets into this area.
25967         See the comments in the source code for details.
25968
25969 2002-12-30  Martin Baulig  <martin@ximian.com>
25970
25971         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
25972
25973 2002-12-30  Martin Baulig  <martin@ximian.com>
25974
25975         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
25976         line number table in this data blob instead of using an external
25977         pointer.
25978
25979 2002-12-28  Martin Baulig  <martin@ximian.com>
25980
25981         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
25982
25983 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
25984
25985         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
25986         as a boxed return type.
25987
25988 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
25989
25990         * appdomain.c
25991         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
25992         g_build_filename to properly get separators on the filename created.
25993
25994         * object.h: Small change, introduce MonoMarshalByRefObject to
25995         track the layout of that structure in the C# universe as we make
25996         changes there.
25997
25998 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
25999
26000         * object.c: removed assert to allow static fields on interfaces.
26001         * loader.c: a TypeSpec may be used for any type, not just arrays.
26002
26003 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
26004
26005         * class.c, class.h: added mono_class_array_element_size ().
26006         Ignore static methods in interfaces.
26007
26008 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26009
26010         * threads.c: fixed the build under cygwin.
26011
26012 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
26013
26014         * reflection.c: handle nullref constants. Allocate keys for
26015         reflection handles with the GC.
26016
26017 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
26018
26019         * threads.c, threads.h: added mono_thread_get_abort_signal()
26020         to get a suitable signal for thread abort.
26021
26022 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
26023
26024         * metadata.c: fix handling of ExportedType table.
26025
26026 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26027
26028         * icall.c: added WriteWindowsDebugString internal call.
26029
26030 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26031
26032         * reflection.h: added fields to match C# implementation.
26033
26034 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26035
26036         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
26037
26038 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
26039
26040         * gc.h, gc-internal.h: Rename header for GC internal calls to
26041         gc-internal.h from gc.h as to not clash with Boehm GC having its
26042         header installed as <gc.h> in outside include paths.
26043         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
26044         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
26045
26046 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26047
26048         * icall.c: assign minor, build and revision in FillName.
26049
26050 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
26051
26052         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
26053         Added support for running code generated by Reflection.Emit.
26054
26055 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26056
26057         * appdomain.c: check for NULL argument in LoadFrom.
26058
26059 2002-12-10  Dick Porter  <dick@ximian.com>
26060
26061         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
26062
26063 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26064
26065         * appdomain.c: fix buglet when building exe file name.  Handle full
26066         assembly name (needed after latest changes to AssemblyName).
26067         * image.c:
26068         (mono_image_close): free some hashtables.
26069
26070 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
26071
26072         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
26073         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
26074         on some systems (redhat 7.3) 
26075
26076 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26077
26078         * threads.c: delete the critical section of a sync block,
26079         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
26080
26081 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
26082
26083         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
26084
26085 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26086
26087         * appdomain.[ch]: handle the assembly preload event to try loading the
26088         assemblies using the paths we have in the current domain.
26089
26090         * assembly.[ch]: created an assembly preload hook that is called to try
26091         loading the assembly by other means that the ones provided here.
26092
26093         * domain.c: initialize the domain search path.
26094
26095         From now on, assemblies (TODO: except corlib and System) are loaded
26096         according to these rules when using mono_assembly_load ():
26097
26098                 1. It tries to load the assembly from the ApplicationBase
26099                 of the current domain appending .dll and .exe (TODO: have to
26100                 try loading from name/name.dll and name/name.exe).
26101
26102                 2. It tries the search path specified in PrivateBinPath for the
26103                 current domain (if any).
26104
26105                 3. Previous behavior.
26106
26107 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
26108
26109         * icall.c: implemented GetInterfaceMap() related icall.
26110         * domain.c, loader.h: load MethodInfo in mono_defaults.
26111
26112 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
26113
26114         * gc.c: disable the finalizer thread for now, untill all the issues
26115         with it are resolved.
26116
26117 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
26118
26119         * string-icalls.c: handle embedded nulls in string ctor when the
26120         length is specified.
26121
26122 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
26123
26124         * class.c: look for explicit interface implementation in parent
26125         classes, too.
26126
26127 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
26128
26129         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
26130
26131 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
26132
26133         * gc.c: protect handles with a critical section.
26134
26135 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26136
26137         * icall.c:
26138         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
26139         parameters. If no assembly specified, try getting the type from all
26140         the assemblies in the current domain, else, load the assembly and get
26141         the type from it.
26142
26143 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26144
26145         * marshal.c: applied patch from Aleksey Demakov that fixes
26146         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
26147
26148 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26149
26150         * icall.c: fixed get_location.
26151
26152 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
26153
26154         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
26155         declarations to make it work with older gcc. 
26156
26157         * loader.c (mono_get_method): set signature->pinvoke for native calls
26158
26159 2002-11-20  Dick Porter  <dick@ximian.com>
26160
26161         * threads.c (mono_thread_init): Set the main thread's handle
26162
26163 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
26164
26165         * gc.c: allow compilation without GC support. Changed to match the
26166         mono coding style.
26167
26168 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
26169
26170         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
26171
26172 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
26173
26174         * reflection.c: set a public key token on the core assemblies.
26175
26176 2002-11-18  Dick Porter  <dick@ximian.com>
26177
26178         * threads.c: Split out some thread initialisation so that other
26179         files can set the start callback function.
26180
26181         * gc.c: Run finalisers in a separate thread, to avoid stack
26182         overflow.  Fixes bug 31333.
26183
26184         * appdomain.c: Set up GC finalisation thread.
26185
26186         * reflection.c: 
26187         * object.c: 
26188         * domain.c: Use gc.h macros for GC_malloc
26189         
26190 2002-11-15  Dick Porter  <dick@ximian.com>
26191
26192         * threadpool.c: 
26193         * threads.c:
26194         * appdomain.c: Removed mono_runtime_init_with_attach(),
26195         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
26196         merging the extra parameter with the existing function.  Removed
26197         unneeded code in mono_thread_attach().
26198
26199 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
26200
26201         * image.c (mono_image_loaded_by_guid): a method to get loaded
26202         images by guid. 
26203         (load_metadata_ptrs): we store the guid as string.
26204
26205 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
26206
26207         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
26208
26209         * metadata.c (mono_guid_to_string): imported method form Zoltan
26210         Varga (slightly modified)
26211
26212         * assembly.c (mono_assembly_open): load precompiled code
26213
26214         * loader.h (MonoMethod): we store the method token for use in the
26215         aot compiler. 
26216
26217 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26218
26219         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
26220         the hook function called when an assembly is loaded.
26221         
26222         * domain.c: Modified file.
26223         (mono_domain_assembly_load): removed hash table insertion of assemblies.
26224
26225         Fixes bug #33196.
26226
26227 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
26228
26229         * reflection.c: Map PEFileKind to the value expected by the WinNT
26230         image loader. 
26231
26232 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26233
26234         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
26235         Read until the buffer is filled completely.
26236
26237 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26238
26239         * icall.c: implemented MonoType.InternalGetEvent ().
26240
26241 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26242
26243         * appdomain.c: implemented InitAppDomainSetup. Delayed
26244         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
26245         the entry_assembly.
26246
26247         * assembly.c: base_dir is now an absolute path ending with
26248         G_DIR_SEPARATOR.
26249
26250         * icall.c: modified get_location according to the above changes.
26251
26252         * object.c: init AppDomain.SetupInformation for the default domain after
26253         we have the entry assembly.
26254
26255         * domain.c: when unloading a domain, setup = NULL.
26256
26257 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
26258
26259         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
26260
26261 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
26262
26263         * object.h, object.c: introduced mono_object_get_virtual_method ()
26264         to lookup the method invoked on an object when a callvirt is done on
26265         a method.
26266         * icall.c: make MethodInfo::Invoke() always do a virtual call.
26267
26268 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26269
26270         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
26271         current domain when loaded an assembly and failed to load it.
26272
26273         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
26274
26275 2002-10-31  Dick Porter  <dick@ximian.com>
26276
26277         * icall.c: 
26278         * file-io.h: 
26279         * file-io.c: Return the error status in a parameter, as the
26280         GetLastError() value has long since been blown away if we try and
26281         look it up in a subsequent internal call invocation.  Delete the
26282         GetLastError() internal call, because it's useless.
26283
26284 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
26285
26286         * class.[ch]: added cast_class to fix bug 29517
26287
26288 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
26289
26290         * marshal.c: create valid IL code in the filter clause:
26291         the new JIT is less forgiving:-)
26292
26293 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26294
26295         * icall.c: removed get_property internal call.
26296
26297 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
26298
26299         * appdomain.h domain.c: Added an ID to appdomains.
26300         
26301         * threads.c threads.h icall.c: Implement icall
26302         Thread:GetDomainID(), and remove unused icall 
26303         CurrentThreadDomain_internal.
26304
26305 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26306
26307         * icall.c: Don't recurse through the base types in GetConstructor.
26308         Fixes bug #32063. 
26309
26310 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
26311
26312         * mempool.h, mempool.c: added mono_mempool_empty() and
26313         mono_mempool_stats().
26314
26315 2002-10-23  Dick Porter  <dick@ximian.com>
26316
26317         * file-io.c: 
26318         * file-io.h: 
26319         * icall.c: Added MonoIO.GetFileType internal call
26320
26321 2002-10-17  Dick Porter  <dick@ximian.com>
26322
26323         * appdomain.c (mono_runtime_cleanup): Don't signal the async
26324         delegate semaphore before waiting for all threads to finish,
26325         because new threads can also call async delegates.  Fixes bug
26326         32004.
26327
26328         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
26329         of 3 seconds, in case another async job is queued.  (This part is
26330         needed because the bug fix reintroduced the 3s exit lag.)  This
26331         makes the mono_runtime_shutdown flag superfluous.
26332
26333 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
26334
26335         * reflection.c: include ehader size in method section headers.
26336         Really check for suplicated modules entries.
26337
26338 2002-10-17  Martin Baulig  <martin@gnome.org>
26339
26340         * debug-mono-symfile.c: Added back support for locals.
26341
26342 2002-10-14  Martin Baulig  <martin@gnome.org>
26343
26344         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
26345         MONO_TYPE_VOID.
26346
26347 2002-10-14  Martin Baulig  <martin@gnome.org>
26348
26349         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
26350         mono_class_get() instead of looking in the class cache. 
26351
26352 2002-10-13  Martin Baulig  <martin@gnome.org>
26353
26354         * debug-mono-symfile.c: Set version number to 28, include the
26355         signature in method names.
26356
26357 2002-10-13  Martin Baulig  <martin@gnome.org>
26358
26359         * debug-mono-symfile.h: Set version number to 27.
26360
26361 2002-10-11  Martin Baulig  <martin@gnome.org>
26362
26363         * gc.c: Don't register/unregister NULL pointers as disappearing links.
26364
26365 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
26366
26367         * metadata.c, metadata.h: added helper function to allocate signatures.
26368
26369 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26370
26371         * icall.c: added internal call to get the location of machine.config.
26372
26373 2002-10-08  Martin Baulig  <martin@gnome.org>
26374
26375         * debug-mono-symfile.c: Ignore classes with a pending init for the
26376         moment.
26377
26378 2002-10-03  Dick Porter  <dick@ximian.com>
26379
26380         * threads.c: Freebsd pthread_t is a pointer
26381
26382 2002-10-03  Dick Porter  <dick@ximian.com>
26383
26384         * socket-io.c: Implemented GetHostName_internal
26385
26386 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26387
26388         * mono-config.c:
26389         (mono_config_parse_file): don't leak the text.
26390
26391 2002-10-02  Martin Baulig  <martin@gnome.org>
26392
26393         * debug-mono-symfile.c: Added support for methods.
26394
26395 2002-10-01  Martin Baulig  <martin@gnome.org>
26396
26397         * debug-mono-symfile.c: Don't emit methods and line numbers for
26398         the dynamic symbol file, just write the type table.  We can easily
26399         have an external helper program which creates a symbol file for an
26400         IL file.        
26401
26402 2002-10-01  Dick Porter  <dick@ximian.com>
26403
26404         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
26405         Only add the handle to the cleanup array when we're about to
26406         launch the thread.  Bug 31425 deadlocked when the test was run on
26407         mono under w32.
26408
26409 2002-10-01  Martin Baulig  <martin@gnome.org>
26410
26411         * debug-mono-symfile.c: Added support for properties.
26412
26413 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
26414
26415         * reflection.c: unaligned store fix from Mark Crichton
26416         <crichton@gimp.org>.
26417
26418 2002-09-27  Martin Baulig  <martin@gnome.org>
26419
26420         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
26421         New interncall.
26422
26423 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
26424
26425         * assembly.h, assembly.c: use a sane API to hook into the assembly
26426         loading process instead of a useless special-purpouse hack
26427         (ngen needs a hook, too, for example).
26428
26429 2002-09-27  Dick Porter  <dick@ximian.com>
26430
26431         * threads.c (mono_thread_init): Call GetCurrentProcess() so
26432         io-layer can set up some process handle info.  Not needed on w32,
26433         but doesn't hurt either.
26434
26435         * process.c: Pass the program name in the second parameter to
26436         CreateProcess, so the path is searched.  Include the working
26437         directory. Implemented process name, process enumeration, and some
26438         process detail internal calls.
26439         
26440         * icall.c: Added internal calls for process lookup, and some
26441         process details
26442
26443 2002-09-26  Martin Baulig  <martin@gnome.org>
26444
26445         * assembly.c (mono_install_open_assembly_hook): New global
26446         function to install a function to be invoked each time a new
26447         assembly is loaded.
26448         (mono_assembly_open): Run this callback function if set.
26449
26450         * debug-mono-symfile.c: Put back line numbers for the dynamic
26451         symbol file and also record the .il file as source file.  This
26452         allows us to install the temporary symbol file as `file.dbg' just
26453         like a compiler-generated one.
26454
26455 2002-09-26  Nick Zigarovich <nick@chemlab.org>
26456
26457         * Corrected typo in gc.c (BOHEM vs BOEHM).
26458
26459 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26460
26461         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
26462         GetProperties. Also avoid calling g_slist_length in GetProperties and
26463         GetMethods.
26464
26465 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26466
26467         * reflection.c: avoid unaligned stores (bug spotted by
26468         Mark Crichton  <crichton@gimp.org>).
26469
26470 2002-09-25  Martin Baulig  <martin@gnome.org>
26471
26472         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
26473         instead of guint64 for addresses and added prologue/epilogue info.
26474
26475 2002-09-25  Martin Baulig  <martin@gnome.org>
26476
26477         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
26478         store line number info.  For the dynamic symbol file, we only need
26479         to provide the JIT generated dynamic line number info for the dynamic
26480         symbol file.
26481
26482 2002-09-25  Martin Baulig  <martin@gnome.org>
26483
26484         * debug-mono-symfile.h: Incremented version number.
26485
26486 2002-09-24  Martin Baulig  <martin@gnome.org>
26487
26488         * class.c (mono_debugger_class_init_func): New global function
26489         pointer variable.
26490         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
26491         call it.
26492
26493         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
26494         function.  This is called via the mono_debugger_class_init_func
26495         hook to add all types to the dynamic type table.
26496         (ves_icall_MonoDebugger_GetType): New interncall to get a class
26497         from its metadata token.
26498
26499         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
26500         New interncall for the debugger.
26501
26502 2002-09-24  Nick Drochak <ndrochak@gol.com>
26503
26504         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
26505         before using it in case it is null.
26506         
26507 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26508
26509         * metadata.c: allow custom modifiers in local var signatures
26510         (bug spotted by Zoltan Varga).
26511
26512 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
26513
26514         * class.c: deal with the <Module> class that may have a NULL vtable.
26515         Eliminate warnings.
26516
26517 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26518
26519         * image.c, image.h: more strong name helpers.
26520         * monosn.c: more work: convert pem keys to cryptoapi format.
26521
26522 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
26523
26524         * string-icalls.c: speedup IndexOf.
26525
26526 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
26527
26528         * icall.c: updates from Zoltan.2.Varga@nokia.com.
26529
26530 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
26531
26532         * icall.c: cleanup: use mono_object_domain ().
26533
26534 2002-09-23  Martin Baulig  <martin@gnome.org>
26535
26536         * debug-mono-symfile.c: Improved type support.
26537
26538 2002-09-22  Martin Baulig  <martin@gnome.org>
26539
26540         * debug-mono-symfile.c: Added support for reference types and strings.
26541
26542 2002-09-22  Martin Baulig  <martin@gnome.org>
26543
26544         * debug-mono-symfile.c: Started to work on the type table.
26545
26546 2002-09-21  Martin Baulig  <martin@gnome.org>
26547
26548         * debug-mono-symfile.c: Largely reworked the symbol table format.
26549         The symbol table is now incrementally updated each time a new
26550         method is added.  We're now also using our own magic and version
26551         so that you don't need to recompile all your classes if the
26552         dynamic table changes.
26553         (mono_debug_update_mono_symbol_file): Removed.
26554         (mono_debug_symfile_add_method): New function to add a method.
26555
26556 2002-09-21  Martin Baulig  <martin@gnome.org>
26557
26558         * icall.c
26559         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
26560         New interncall.
26561
26562         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
26563         New interncall to get a method from its metadata token.
26564
26565 2002-09-21  Martin Baulig  <martin@gnome.org>
26566
26567         * debug-mono-symfile.c: Create type table.
26568
26569 2002-09-20  Martin Baulig  <martin@gnome.org>
26570
26571         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
26572
26573 2002-09-20  Martin Baulig  <martin@gnome.org>
26574
26575         * debug-mono-symfile.c: Provide information about params and locals.
26576
26577 2002-09-20  Martin Baulig  <martin@gnome.org>
26578
26579         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
26580         New interncall.
26581
26582         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
26583         interncall to get a method from its metadata token.
26584
26585 2002-09-20  Martin Baulig  <martin@gnome.org>
26586
26587         * debug-mono-symfile.c: Added a few checks for method->header
26588         being non-NULL.  This should never happen, but for the moment
26589         let's use a g_warning() rather than a g_assert().
26590
26591 2002-09-19  Mark Crichton  <crichton@gimp.org>
26592
26593         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
26594         even if support for it isn't present.  Added an #ifdef to fix this.
26595
26596         * socket-io.c: Added checks back for Solaris support.
26597
26598 2002-09-19  Martin Baulig  <martin@gnome.org>
26599
26600         * debug-mono-symfile.c (read_string, write_string): Reflect latest
26601         changes in the symbol file format.
26602
26603 2002-09-18  Martin Baulig  <martin@gnome.org>
26604
26605         * debug-mono-symfile.c: Set version number to 21.
26606
26607 2002-09-18  Dick Porter  <dick@ximian.com>
26608
26609         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
26610         on netbsd.  Fixes bug 30051.
26611
26612 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26613
26614         * reflection.c:
26615         (set_version_from_string): little fix.
26616
26617 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
26618
26619         * monosn.c, Makefile.am: added strong name utility.
26620         * reflection.h, reflection.c: implemented delayed signing,
26621         locale, version and hash id assembly attributes.
26622
26623 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26624
26625         * loader.c, metadata.c: load param attributes in signatures.
26626
26627 2002-09-16  Martin Baulig  <martin@gnome.org>
26628
26629         * debug-mono-symfile.c: Added string table with all method names.
26630
26631 2002-09-14  Martin Baulig  <martin@gnome.org>
26632
26633         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
26634         fast method lookup.
26635
26636 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
26637
26638         * reflection.c: record the public key token of referenced assemblies.
26639
26640 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26641
26642         * image.c, image.h: added functions to get the strong name and the
26643         public key of an assembly.
26644         * pedump.c: use them.
26645
26646 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
26647
26648         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
26649
26650 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
26651
26652         * marshal.c (mono_marshal_get_managed_wrapper): Added
26653         MONO_TYPE_BOOLEAN 
26654
26655 2002-09-11  Martin Baulig  <martin@gnome.org>
26656
26657         * gc.c: Call GC_unregister_disappearing_link() on all links when
26658         finalizing them, this is necessary to aviod a crash in boehm's
26659         finalize handler.
26660
26661 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26662
26663         * gc.c: handle GetTarget for finalized objects spotted and fixed by
26664         nick@chemlab.org.
26665
26666 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
26667
26668         * icall.c: implemented MonoType::Module.
26669         * reflection.c, reflection.h: mono_module_get_object () from
26670         Tomi Pakarinen <tomi.pakarinen@welho.com>.
26671
26672 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
26673
26674         * icall.c: ignore overridden methods in GetMethods ().
26675         Fix for FieldInfo::SetValue().
26676         * object.c: handle float/double in runtime invoke.
26677
26678 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26679
26680         * object.c: allow a constructor to be called again on an object.
26681
26682 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26683
26684         * class.h, class.c: move field layout code to it's own function and
26685         export it. Get an interface id earlier. Move fields in MonoClass
26686         so they are more cache friendly and align the bitfields.
26687         * loader.c: temporary handle get_param_names() for a runtime method.
26688         * reflection.c, reflection.h: more code to handle runtime creation of
26689         types.
26690
26691 2002-09-09  Martin Baulig  <martin@gnome.org>
26692
26693         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
26694         signature with the pinvoke field being set for the actual call.
26695
26696 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26697
26698         * icall.c: removed some unused icalls. Start of map of glib charsets
26699         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
26700
26701 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
26702
26703         * debug-helpers.c: break infinite loop (found and fixed by
26704         Holger Arnold <harnold@gmx.de>).
26705
26706 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
26707
26708         * icall.c: target may be null in create_delegate.
26709
26710 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
26711
26712         * marshal.c: handle a boolean return type.
26713
26714 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26715
26716         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
26717
26718 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
26719
26720         * gc.c: fix weakreferences.
26721
26722 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
26723
26724         * icall.c: added icall to get default codepage.
26725
26726 2002-09-03  Dick Porter  <dick@ximian.com>
26727
26728         * threads.h: 
26729         * threads.c: Use MonoThread instead of MonoObject where
26730         apropriate.
26731
26732         Store running thread objects in a hash table, so that we have all
26733         the info to hand when waiting for them to finish
26734         (means we don't need OpenThread() any more, so mingw builds should
26735         be fully functional again.)
26736
26737         * verify.c:
26738         * object.h: Added thread ID to MonoThread
26739
26740 2002-09-03  Martin Baulig  <martin@gnome.org>
26741
26742         * icall.c (System.Reflection.Assembly::get_location): New interncall.
26743
26744 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26745
26746         * icall.c: fixed leak in get_temp_path. Thanks lupus.
26747
26748 2002-09-03  Martin Baulig  <martin@gnome.org>
26749
26750         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
26751         argument to store the end address of the disassembled instruction.
26752
26753         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
26754         here from debug-symfile.h.
26755         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
26756         JIT into this struct.
26757         (MonoSymbolFile): Added `char *image_file' field.
26758         (MonoDebugGetMethodFunc): Removed.
26759         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
26760         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
26761         (mono_debug_find_method): New method.
26762
26763         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
26764         create a full symbol file.
26765         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
26766         and static symbol files.
26767         (mono_debug_find_method): The symbol file keeps an internal method hash,
26768         call this to get a MonoDebugMethodInfo from a MonoMethod.
26769
26770         * debug-symfile.[ch]: Removed.
26771
26772 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
26773
26774         * image.c (do_mono_image_open): Remove linker version check.
26775
26776 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
26777
26778         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
26779         wrappers for instance methods.
26780         
26781 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26782
26783         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
26784
26785 2002-08-28  Dick Porter  <dick@ximian.com>
26786
26787         * Makefile.am: Export HOST_CC for w32 builds
26788
26789 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
26790
26791         * file-io.c process.c: MonoString are null terminated, no
26792         need for mono_string_to_utf16() anymore.
26793
26794 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26795
26796         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
26797
26798 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26799
26800         * icall.c, reflection.h: speedup System.MonoType.
26801
26802 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
26803
26804         * reflection.c: allow null as the value of a string argument in
26805         custom attributes constructors.
26806
26807 2002-08-27  Martin Baulig  <martin@gnome.org>
26808
26809         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
26810         `trampoline_address' field.
26811
26812 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
26813
26814         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
26815         check (fixes bug #29486) 
26816
26817 2002-08-27  Martin Baulig  <martin@gnome.org>
26818
26819         * debug-mono-symfile.c: Changed the file format in a way that allows us
26820         open it read-only and to use a specially malloced area for all the
26821         dynamic data.  We can now also generate a symbol file on-the-fly if we're
26822         debugging IL code and there is no MCS generated symbol file for it.
26823
26824 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26825
26826         * object.c: added a define for a good string and array
26827         creation speedup (not enabled by default because we need to deal with
26828         the synch stuff).
26829
26830 2002-08-26  Martin Baulig  <martin@gnome.org>
26831
26832         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
26833         function to create a dynamic symbol file.  This is used by the
26834         debugger to create a symbol file for IL code on-the-fly.
26835
26836 2002-08-26  Martin Baulig  <martin@gnome.org>
26837
26838         * loader.c (mono_lookup_pinvoke_call): Include the error message
26839         from g_module_error() in the error message.
26840
26841 2002-08-24  Martin Baulig  <martin@gnome.org>
26842
26843         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
26844         function to update the symbol file.  The symbol file is mmap()ed
26845         writable, but private.  This allows us to install the symbol file
26846         together with the assembly.
26847
26848 2002-08-24  Martin Baulig  <martin@gnome.org>
26849
26850         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
26851         but they can read the new symbol file format which mcs is now creating.
26852
26853         * debug-symfile.c (mono_debug_find_source_location): Moved to
26854         debug-mono-symfile.c; this is now operating on the new symbol file.
26855
26856 2002-08-23  Martin Baulig  <martin@gnome.org>
26857
26858         * debug-helpers.c (mono_method_desc_from_method): New function to get
26859         a MonoMethodDesc from a MonoMethod.
26860
26861 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
26862
26863         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
26864         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
26865
26866 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
26867
26868         * string-icalls.[ch]: make helper methods static.
26869
26870 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26871
26872         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
26873         types to it and to SetValueInternal.
26874
26875         * object.c: Moved handle_enum label to its proper place. This was the
26876         f... bug! ;-)
26877
26878         This time i compiled mcs and gtk-sharp and they both work.
26879
26880 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26881
26882         * icall.c: reverted partially my previous patch until 
26883         object.c:set_value handles enums correcly.
26884
26885 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26886
26887         * icall.c:
26888         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
26889         (ves_icall_System_Environment_get_MachineName): removed warning when
26890         compiling under cygwin.
26891
26892 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
26893
26894         * object.c: fixed field_get_value() for reference types.
26895
26896 2002-08-22  Dick Porter  <dick@ximian.com>
26897
26898         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
26899         Don't free a buffer while it's still needed.  Patch from Jonathan
26900         Liger <Jonathan.liger@wanadoo.fr>
26901
26902 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
26903
26904         * icall.c (ves_icall_System_Environment_get_Platform): Add new
26905         internal call.
26906
26907 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
26908
26909         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
26910         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
26911
26912         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
26913         we call unmanaged code which throws exceptions.
26914
26915 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26916
26917         * appdomain.h: added per-domain entry_assembly.
26918         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
26919         arguments.
26920         * icall.c: Assembly::GetEntryAssembly icall.
26921         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
26922         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
26923
26924 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
26925
26926         * appdomain.h, gc.c: added mono_domain_finalize ().
26927
26928 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26929
26930         * object.c:
26931         (mono_print_unhandled_exception): changed g_warning by g_printerr
26932         because g_log has a 1024 characters limit (yeah, i got a big stack
26933         trace). Don't print exception name, that should be in ToString 
26934         returned string.
26935
26936 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26937
26938         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
26939         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
26940
26941 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26942
26943         * object.c:
26944         (mono_print_unhandled_exception): after previous commit, i realized
26945         that MS calls ToString on the exception. I changed this function to
26946         do that. This way we get stack_trace for free.
26947
26948 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26949
26950         * object.c:
26951         (mono_print_unhandled_exception): invoke Message property instead of
26952         getting 'message' field from Exception. Don't allocate memory for
26953         'trace' and 'message' if not needed.
26954
26955 2002-08-18  Dick Porter  <dick@ximian.com>
26956
26957         * unicode.c: Fix asserts to match Encoder.cs checks
26958
26959 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26960
26961         * marshal.c: fix unaligned store issue and a few wrong
26962         opcode argument types.
26963
26964 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26965
26966         * icall.c: added GetUninitializedObjectInternal internal call.
26967
26968 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
26969
26970         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
26971         to the right domain.
26972
26973 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
26974
26975         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
26976
26977         * class.c (class_compute_field_layout): set blittable to false for Strings
26978
26979         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
26980
26981 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26982
26983         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
26984         first chunk of code to create types at runtime. Code to
26985         handle ReflectedType/DeclaringType. Make reflection handles
26986         domain specific.
26987
26988 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
26989
26990         * class.c: set correct name in arrays.
26991
26992 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
26993
26994         * appdomain.c (mono_domain_transfer_object): make it work with
26995         valuetypes. bug fixes.
26996
26997 2002-08-12  Dick Porter  <dick@ximian.com>
26998
26999         * object.h: Rename some parameters to avoid c++ keywords (Patch
27000         from Joseph Wenninger <kde@jowenn.at>)
27001
27002 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
27003
27004         * icall.c: added icall to implement Assembly.GetFile*.
27005
27006 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
27007
27008         * reflection.h, reflection.c: code to embed managed resources.
27009
27010 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
27011
27012         * class.c: move all the type size stuff into
27013         class_compute_field_layout().
27014
27015 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
27016
27017         * class.c: ensure enums have always the correct instance size.
27018         * unicode.c: remove wrong assert.
27019
27020 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
27021
27022         * assembly.c: fix mem corruption issue.
27023         * image.h, image.c: added mono_image_get_resource () to access
27024         managed resources.
27025         * icall.c: implemented Assembly.EntryPoint property and some
27026         Managed Resources related internalcalls.
27027
27028
27029 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
27030
27031         * image.c, image.h: impemented mono_image_get_entry_point ().
27032         * appdomain.c: use mono_image_get_entry_point.
27033
27034 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
27035
27036         * reflection.c: support the object type argument when loading
27037         custom attributes.
27038
27039 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
27040
27041         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
27042         String as return type.
27043
27044 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
27045
27046         * reflection.c: fix encoding of named args for custom attrs to match
27047         the ms implementation. Read them back when instantiating custom
27048         attributes.
27049
27050 2002-08-02  Radek Doulik  <rodo@ximian.com>
27051
27052         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
27053         by Dietmar as quick fix
27054         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
27055         16 as stack size, used on more places as quick fix before Dietmar
27056         will fix it properly
27057
27058 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
27059
27060         * object.h, object.c: added accessors for fields and properties.
27061
27062 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
27063
27064         * class.c, class.h: made mono_class_get_field_from_name ()
27065         loop on parent types.
27066         Added mono_class_get_property_from_name ().
27067
27068 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
27069
27070         * class.c, class.h: move the code to setup the type vtable in its own
27071         function so that it can be reused also for types created at runtime.
27072         Eliminate the "class" identifier from the header file.
27073         * reflection.c: setup the vtable for enums so that we can create
27074         objects for use in SetConstant ().
27075
27076 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
27077
27078         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
27079         instead of the delegate itself as this pointer (bug #28383)
27080
27081 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
27082
27083         * marshal.c (mono_marshal_get_managed_wrapper): added return type
27084         conversions.
27085
27086 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27087
27088         * loader.c: don't set the pinvoke bit on icalls.
27089
27090 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
27091
27092         * debug-helpers.c (mono_method_full_name): only print a number to
27093         indicate wrapper type (so that the output is more readable in traces).
27094
27095 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
27096
27097         * class.c (mono_class_init): include method override patch from Paolo
27098
27099 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
27100
27101         * icall.c: fixed GetTypeCode().
27102
27103 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
27104
27105         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
27106         use real delegate invoke function to make it work with multicast
27107         delegates (fix bug# 28291).
27108
27109 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
27110
27111         * object.c: load constant strings.
27112
27113 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27114
27115         * reflection.c: no magic numbers.
27116         * tabledefs.h: security action enum.
27117
27118 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
27119
27120         * assembly.c: fix possible memory corruption.
27121
27122 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
27123
27124         * reflection.h, reflection.c: added support for linking resources.
27125         * verify.c: check we have an updated corlib.
27126
27127 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
27128
27129         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
27130         string arrays.
27131         (mono_marshal_string_array): null terminate unmanaged string arrays.
27132         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
27133
27134 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27135
27136         * icall.c: Type.GetType () can now return also types from the
27137         calling assembly.
27138
27139 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
27140
27141         * loader.h, loader.c: stack walking support.
27142         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
27143         GetCallingAssembly.
27144
27145 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
27146
27147         * marshal.c: added optimisations for blittable types 
27148
27149         * class.c (mono_array_class_get): do not set blittable attribute on arrays
27150         (mono_class_setup_mono_type): set blittable attribute for single
27151         and double.
27152
27153         * marshal.c (mono_string_utf8_to_builder): impl.
27154         (mono_string_builder_to_utf8): impl.
27155         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
27156
27157 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
27158
27159         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
27160         (mono_marshal_get_managed_wrapper): impl. byref types
27161
27162 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27163
27164         * icall.c:
27165         (search_method): don't display debug message. 
27166
27167 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
27168
27169         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
27170
27171 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
27172
27173         * appdomain.c: set the missing filename when throwing exception.
27174
27175 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
27176
27177         * metadata.c (mono_type_size): code cleanup
27178         (mono_type_stack_size): removed some test code
27179
27180 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
27181
27182         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
27183         mono_get_exception_file_not_found now.
27184
27185         * exception.c (mono_exception_from_name_two_strings): New version
27186         that will call a constructor with two string arguments. 
27187         (mono_get_exception_file_not_found): New helper routine, used to
27188         report file-not-found errors.
27189
27190 2002-07-20  Dick Porter  <dick@ximian.com>
27191
27192         * process.h:
27193         * process.c: Pass file handles to CreateProcess
27194         
27195         * icall.c:
27196         * file-io.h:
27197         * file-io.c: Implemented CreatePipe
27198
27199 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
27200
27201         * metadata.c (mono_get_param_info): set alignment for value types
27202
27203 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
27204
27205         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
27206         Constify mono_domain_assembly_open().
27207         * loader.c: handle null namespace in icalls.
27208
27209 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
27210
27211         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
27212         (emit_str_to_ptr_conv): marshal object as structs
27213
27214         * metadata.c (mono_type_to_unmanaged): marshal object as structs
27215
27216         * marshal.c (mono_marshal_get_runtime_invoke): support value types
27217
27218 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
27219
27220         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
27221         (mono_marshal_get_native_wrapper): we an now return value types
27222
27223 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27224
27225         * verify.c: more checks implemented.
27226
27227 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
27228
27229         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
27230         (fix bug #27695)
27231         (mono_marshal_get_native_wrapper): allow byref arguments
27232         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
27233         impl. PtrToStringXXX methods
27234         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
27235         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
27236         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
27237         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
27238         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
27239
27240 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
27241
27242         * reflection.c: fix buglet in parsing an assembly name.
27243
27244 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
27245
27246         * marshal.c (emit_ptr_to_str_conv): first impl.
27247
27248 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
27249
27250         * object.c, class.h: cache the vtable in the class as suggested by
27251         vargaz@freemail.hu (Zoltan Varga).
27252
27253 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
27254
27255         * class.h, loader.c: added mono_field_from_token().
27256         * verify.c: first cut of type checking code.
27257
27258 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
27259
27260         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
27261
27262 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
27263
27264         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
27265         (fix bug #27782)
27266         (mono_marshal_get_remoting_invoke): impl.
27267         (mono_delegate_begin_invoke): impl.
27268         (mono_mb_emit_save_args): impl.
27269         (mono_delegate_end_invoke): impl.
27270         (mono_marshal_get_delegate_begin_invoke):
27271         (mono_marshal_get_delegate_end_invoke):
27272         (mono_marshal_get_delegate_invoke): generate a special name for
27273         those methods (including the signature) and associate them whith
27274         the delegate class. 
27275
27276 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
27277
27278         * reflection.[ch]: 
27279         (mono_reflection_type_from_name): now it has a MonoImage parameter
27280         which is used as the default image to search the type in. If the image
27281         is NULL or getting the type from it fails, it defaults to corlib.
27282
27283         * icall.c: changed 1 call to mono_reflection_type_from_name to match
27284         new parameter.
27285
27286 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27287
27288         * reflection.c: update the parameter table index.
27289
27290 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
27291
27292         * domain.c: don't include the mark byte in the string hash.
27293
27294 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
27295
27296         * icall.cs: icall for Type.GetTypeCode ().
27297         * verify: a couple of fixes and disabled local initialization checks.
27298
27299 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
27300
27301         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
27302
27303         * debug-helpers.c (mono_method_full_name): print the type of the
27304         runtime wrapper
27305
27306         * metadata.c (mono_signature_hash): a hash function for signatures
27307         (mono_signature_hash): better hash algorithm
27308
27309         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
27310
27311         * debug-helpers.c (mono_method_full_name): this can now generate
27312         method names with signatures
27313
27314         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
27315         method dont have this pointers.
27316
27317 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
27318
27319         * reflection.c: fixup typebuilder tokens.
27320         * image.c: fix buglet.
27321         * marshal.h: remove whitespace.
27322         * metadata.h, metadata.c: reinstate code that was removed.
27323         * verify.c: handle catch directives and fix another couple of bugs.
27324
27325 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
27326
27327         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
27328         (mono_marshal_get_native_wrapper): make it comp. with the old code
27329         (mono_marshal_get_native_wrapper): support boolean
27330         (mono_marshal_get_managed_wrapper): support more types
27331
27332 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
27333
27334         * class.c (class_compute_field_layout): compute class->blittable attribute.
27335
27336 2002-07-09  Dick Porter  <dick@ximian.com>
27337
27338         * threads.c: Make the thread cleaning up cope with threads that
27339         call ExitThread()
27340
27341 2002-07-08  Radek Doulik  <rodo@ximian.com>
27342
27343         * reflection.c (method_encode_code): use non-translated values to
27344         compute finally_start, this fixes exception handling on ppc, yay!
27345
27346         * decimal.h (struct signscale): fix endianess
27347
27348 2002-07-07  Radek Doulik  <rodo@ximian.com>
27349
27350         * reflection.c: swap box_val and not val
27351
27352 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
27353
27354         * reflection.c, reflection.h: handle full assembly info in type name.
27355         Handle Type arguments when loading custom attributes.
27356         * icall.c: updated to use new mono_reflection_type_from_name () method.
27357
27358 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27359
27360         * loader.c:
27361         (method_from_memberref): also print assembly name when method not found.
27362
27363 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27364
27365         * icall.c:
27366         (ves_icall_TypeGetProperties): fixed bug #27473. 
27367
27368 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27369
27370         * reflection.c: display image name and token when cannot find the
27371         .ctor for an attribute.
27372
27373 2002-07-05  Martin Baulig  <martin@gnome.org>
27374
27375         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
27376
27377 2002-07-04  Dick Porter  <dick@ximian.com>
27378
27379         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
27380         compile on mingw.  This will cause mingw builds to not wait for
27381         subthreads to terminate after the main thread does.  I've lodged a
27382         bug with the mingw developers for them to wrap OpenThread().
27383
27384 2002-07-03  Dick Porter  <dick@ximian.com>
27385
27386         * threads.c: Store thread IDs instead of handles, because
27387         GetCurrentThread() returns a pseudohandle and therefore stores
27388         useless values.  mono_thread_cleanup() continues checking the
27389         array of threads until it is empty, to cope with subthreads
27390         spawning new threads after the main thread has finished.
27391
27392         * profiler.h:
27393         * profiler.c:
27394         * profiler-private.h: Pass the thread ID to thread profiler
27395         functions, instead of a handle
27396
27397 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
27398
27399         * verify.c: fixes to make it more usable.
27400         * pedump.c: added --verify code to verify IL code in an assembly.
27401
27402 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27403
27404         * reflection.c: turn errors into warnings to allow compiling corlib.
27405
27406 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
27407
27408         * reflection.c: add special cases to compile corlib.
27409
27410 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
27411
27412         * reflection.c: handle properties with only a set method.
27413
27414 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
27415
27416         * opcodes.h: add enum with opcodes in opval order.
27417
27418 2002-07-01  Dick Porter  <dick@ximian.com>
27419         
27420         * object.h:
27421         * object.c (mono_runtime_run_main): Removed unneeded argument
27422
27423 2002-06-28  Martin Baulig  <martin@gnome.org>
27424
27425         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
27426
27427 2002-06-27  Dick Porter  <dick@ximian.com>
27428
27429         * threads.c: Store the handle in both the parent thread and in the
27430         subthread, to minimise the time between starting a new thread and
27431         storing its ID.
27432
27433 2002-06-26  Dick Porter  <dick@ximian.com>
27434
27435         * appdomain.c (mono_runtime_cleanup): Close the socket library
27436         after all the threads have finished, not before
27437
27438 2002-06-26  Martin Baulig  <martin@gnome.org>
27439
27440         * debug-symfile.c (mono_debug_find_source_location): Added
27441         `guint32 *line_number' argument.  If it's not NULL, store the line number
27442         there and return the file name without the line number.
27443
27444 2002-06-25  Dick Porter  <dick@ximian.com>
27445
27446         * icall.c:
27447         * process.h:
27448         * process.c: Process forking and other support functions
27449
27450 2002-06-25  Dick Porter  <dick@ximian.com>
27451
27452         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
27453         things dont happen when the image is closed.
27454         (mono_image_lookup_resource): Walk the resource section looking
27455         for a particular entry
27456
27457         * cil-coff.h: PE resource section decoding
27458
27459 2002-06-25  Dick Porter  <dick@ximian.com>
27460         
27461         * assembly.h:
27462         * assembly.c: 
27463         (mono_assembly_foreach): Accessor functions to walk the list of
27464         loaded assemblies
27465         (mono_assembly_set_main):
27466         (mono_assembly_get_main): Process methods need to know which
27467         assembly is the "main" one
27468
27469         * object.c (mono_runtime_run_main): Record the main assembly
27470
27471         * debug-helpers.c: Fix typo
27472
27473 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
27474
27475         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
27476         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
27477
27478 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
27479
27480         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
27481
27482 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
27483
27484         * image.c (do_mono_image_open): Initialize reference count,
27485         otherwise we leak the MonoImage.
27486
27487 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
27488
27489         * reflection.c: small tweak to handle self-hosting.
27490
27491 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
27492
27493         * reflection.c: fix type name parse code.
27494
27495 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
27496
27497         * reflection.c: break out of the loop.
27498         * image.c: special case corlib.
27499
27500 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27501
27502         * reflection.c: add all the custom attrs at the end to ensure the
27503         ctors have been properly initialized when the attributes are defined
27504         in the current assembly.
27505
27506 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
27507
27508         * reflection.c: handle correctly multiple-nested types.
27509
27510 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
27511
27512         * row-indexes.h: fix typos.
27513         * reflection.c: adjust for typos and fix method_def_or_ref
27514         encoding in MethodImpl table.
27515
27516 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27517
27518         * reflection.c: fix entry point patching (thanks Serge!).
27519
27520 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
27521
27522         * verify.c: add check for System.Exception
27523
27524 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
27525
27526         * image.c, class.c: minifix for code just c&p'ed.
27527         * reflection.c: warning fix.
27528         * object.h, loader.h, domain.c: load also StringBuilder.
27529
27530 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
27531
27532         * marshal.h, marshal.c: some support code to handle complex marshaling.
27533
27534 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27535
27536         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
27537         Better signatures with vtable error dump.
27538
27539 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
27540
27541         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
27542
27543 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
27544
27545         * icall.c (ves_icall_Type_GetField): impl.
27546
27547 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27548
27549         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
27550         to retrieve a marshal description blob for a field or param.
27551
27552 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
27553
27554         * reflection.h, reflection.c: change order of nested type emission
27555         to avoid table corruption. The NestedTypes table is sorted.
27556         * icall.c: change order of GetConstructor results to workaround mcs bug.
27557
27558 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27559
27560         * reflection.h, reflection.c: handle field and param marshal
27561         information.
27562
27563 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
27564
27565         * icall.c, marshal.c marshal.h: more Marshal class implementation.
27566
27567 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27568
27569         * reflection.c: fix call convention.
27570
27571 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27572
27573         * reflection.h, reflection.c: mono_image_get_memberref_token()
27574         takes a type instead of a class, now. Added
27575         mono_image_get_array_token() to create tokens for the special
27576         multi-dim array methods.
27577
27578 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
27579
27580         * assembly.c: handle modules (no assembly table). Split
27581         loading references in its own function.
27582         * class.c: handle moduleref resolution scope.
27583         * image.c, image.h: cache module name in image.
27584
27585 2002-06-07  Martin Baulig  <martin@gnome.org>
27586
27587         * reflection.c (mono_image_get_type_info): Only add a class layout entry
27588         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
27589
27590 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
27591
27592         * icall.c: more signature fixes that used uint instead of int.
27593
27594 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27595
27596         * reflection.c: fixed signature of field refs.
27597
27598 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27599
27600         * class.c, reflection.c: handle typerefs of nested types
27601         (both on read and when writing files).
27602
27603 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27604
27605         * icall.c: fix method signatures that tried to workaround the previous
27606         typo, d'oh!
27607
27608 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
27609
27610         * debug-helpers.c: fix typo.
27611
27612 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
27613
27614         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
27615         rewrote the PE/COFF writing code (our programs are understood by the
27616         ms runtime, now).
27617
27618 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
27619
27620         * gc.c, gc.h, icall.c: weakreference support.
27621
27622 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
27623
27624         * Makefile.am, mono-config.c: use $(sysconfdir).
27625
27626 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
27627
27628         * icall.c: changed default precision of Double.ToString() to 15.
27629         Fixed memory leak. Unified with Single.ToString.
27630
27631 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
27632
27633         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
27634
27635 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
27636
27637         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
27638         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
27639         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
27640         and myself.
27641
27642 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27643
27644         * debug-symfile.c, sysmath.c: yet more compilation fixes.
27645
27646 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27647
27648         * reflection.c, socket-io.c: more compilation fixes.
27649
27650 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
27651
27652         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
27653         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
27654         unicode.c: warning and compiler compatibility fixes.
27655
27656 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
27657
27658         * class.h, metadata.c: fixed warnings/compilation errors.
27659
27660 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
27661
27662         * Makefile.am, mono-config.c, mono-config.h: configuration file
27663         support routines.
27664         * loader.c, loader.h: make Dll mapping configurable at runtime in the
27665         config file. Export methods to insert and lookup mappings.
27666
27667 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
27668
27669         * reflection.c: handle types and boxed objects in custom attr
27670         constructors.
27671
27672 2002-05-30  Martin Baulig  <martin@gnome.org>
27673
27674         * debug-symfile.c
27675         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
27676
27677 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
27678
27679         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
27680         to lookup the implmap row for a P/Invoke method.
27681         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
27682         P/Invoke method from the runtime on an as needed basis.
27683
27684 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
27685
27686         * metadata.c (mono_metadata_parse_signature): impl.
27687
27688 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27689
27690         * class.c: handle .pack directive.
27691
27692 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
27693
27694         * object.c: initialize static fields with RVA data.
27695
27696 2002-05-25  Martin Baulig  <martin@gnome.org>
27697
27698         * debug-symfile.c
27699         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
27700
27701 2002-05-24  Martin Baulig  <martin@gnome.org>
27702
27703         * debug-symfile.c
27704         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
27705         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
27706         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
27707
27708 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
27709
27710         * object.c: special case string ctros in invoke.
27711         * gc.c: silly whitespace changes.
27712
27713 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
27714
27715         * threadpool.[ch]: impl. a threadpool that can
27716         be used by mint and mono.
27717
27718 2002-05-22  Martin Baulig  <martin@gnome.org>
27719
27720         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
27721         The first argument is now a `MonoReflectionModuleBuilder *', the return
27722         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
27723         `methods' field to get the method builder.  The `token' argument is the
27724         unfixed token.
27725
27726         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
27727         invalid characters instead of g_assert_not_reached()ing.  This seems
27728         to be the behaviour of mscorlib.
27729
27730 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
27731
27732         * object.c (mono_runtime_invoke_array): applied patch from Rachel
27733         Hestilow to fix bug #25104
27734
27735 2002-05-21  Martin Baulig  <martin@gnome.org>
27736
27737         * debug-symfile.c (mono_debug_find_source_location): New function.
27738         Looks up an IL offset in the line number table and returns the source
27739         location as a string.
27740
27741 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27742
27743         * icall.c:
27744         (mono_double_ToStringImpl): changed %f by %g until we have something
27745         better.
27746
27747 2002-05-21  Nick Drochak  <ndrochak@gol.com>
27748
27749         * icall.c : Use different name for Math.Pow's icall.  Needed to check
27750         parameters first in C#.
27751
27752 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27753
27754         * icall.c, reflection.h: added icall to get info about an event.
27755
27756 2002-05-20  Radek Doulik  <rodo@ximian.com>
27757
27758         * object.c (mono_value_box): don't use memcpy for boxing on BIG
27759         endian
27760         (mono_value_box): don't use memcpy for small sizes on
27761         architectures with unaligned access
27762
27763 2002-05-20  Martin Baulig  <martin@gnome.org>
27764
27765         * reflection.c (mono_reflection_setup_internal_class): Don't crash
27766         if `tb->parent == NULL'.
27767         (mono_reflection_create_internal_class): New function.  This is
27768         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
27769         for enum types.
27770
27771         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
27772         New interncall.
27773
27774 2002-05-19  Martin Baulig  <martin@gnome.org>
27775
27776         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
27777         argument to get the length, don't default to the array length.
27778
27779 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
27780
27781         * assembly.c (mono_assembly_setrootdir): New function used to
27782         override the MONO_ASSEMBLIES directory.
27783
27784 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
27785
27786         * icall.c: ValueType_GetHashCode() initialize local var.
27787
27788 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
27789
27790         * reflection.c: sort custom attributes table.
27791
27792 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
27793
27794         * reflection.c: support named args in custom attributes (write support).
27795
27796 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
27797
27798         * reflection.c: fix finally position calculation.
27799
27800 2002-05-15  Radek Doulik  <rodo@ximian.com>
27801
27802         * reflection.c: fixed endianess at many places
27803
27804         * icall.c (ves_icall_InitializeArray): comment out debug msg
27805
27806 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
27807
27808         * object.c (mono_unhandled_exception): new function to handle
27809         unhandled exceptions.
27810         (mono_unhandled_exception): call the UnhandledException event.
27811         (mono_runtime_delegate_invoke): impl.
27812
27813 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
27814
27815         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
27816         returns the RVA, not the direct pointer to the data. Handle the case
27817         when the class size is fixed.
27818
27819 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
27820
27821         * reflection.c: fix some endianess issues.
27822
27823 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
27824
27825         * object.c (mono_runtime_invoke): is now able to catch exceptions.
27826
27827         * threads.c (mono_thread_init): added a callback which is invoked
27828         at thread start.
27829
27830 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
27831         
27832         * icall.c: make GetHashCode return non-negative values.
27833
27834 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
27835
27836         * object.c, icall.c, gc.c: revert to address-based hashcode.
27837
27838 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
27839
27840         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
27841
27842 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27843
27844         * icall.c, class.c: special case <Module>.
27845
27846 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
27847
27848         * icall.c: fix bug in GetNow().
27849
27850 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
27851
27852         * object.c (mono_runtime_class_init): make sure that we call all
27853         static class constructors.
27854
27855 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
27856
27857         * reflection.c: sort methodsemantics table.
27858
27859 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
27860
27861         * reflection.h, reflection.c: honour init locals setting.
27862
27863 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
27864
27865         * icall.c: copied Double ToStringImpl for Single ToStringImpl
27866
27867 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
27868
27869         * reflection.c: support ContructorBuilders in attribute blob creation.
27870
27871 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27872
27873         * reflection.c: some changes to build a binary that can be run
27874         directly in windows.
27875
27876 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
27877
27878         * loader.c: print a big message when an icall can't be found.
27879
27880 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27881
27882         * string-icalls.c: fix bug 24248.
27883
27884 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
27885
27886         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
27887         icall.c, reflection.h: separate assembly loading by pathname and by
27888         assembly name. Use the MONO_PATH env var to search for assemblies.
27889
27890 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
27891
27892         * assembly.c, image.h: add some support for assemblies
27893         with multiple modules.
27894         * class.c, class.h: export mono_class_from_typeref().
27895         * loader.c: remove duplicated code and use mono_class_from_typeref(),
27896         instead.
27897
27898 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
27899
27900         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
27901         documentation says (the ECMA one is correct).
27902
27903 2002-05-02  Dick Porter  <dick@ximian.com>
27904
27905         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
27906         Don't name the synchronisation mutex.
27907
27908 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
27909
27910         * rand.c
27911         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
27912         Make the prototypes match.
27913         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
27914         Same.
27915
27916         * icall.c
27917         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
27918         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
27919         all systems have tm.tm_zone, so use strftime() with %Z to print
27920         the timezone abreviation into a temp string.
27921
27922         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
27923         rather than mono_array_addr() on a MonoString on Big Endian
27924         machines.
27925
27926 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
27927
27928         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
27929         fix bug 24041
27930
27931 2002-04-30  Dick Porter  <dick@ximian.com>
27932
27933         * socket-io.c: Cope with SOCKET being an integer rather than a
27934         pointer now.
27935
27936         * threads.c: Added Thread_free_internal, to deal with thread
27937         handle cleanup.  Moved calls to handle_store() and handle_remove()
27938         to start_wrapper(), so each can only be called once.  Allocate
27939         synchronisation blocks with GC_malloc(), and use GC finalisation
27940         to close the handles.
27941
27942         * icall.c: added System.Threading.Thread::Thread_free_internal
27943
27944 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
27945
27946         * icall.c: support Environment.Exit, CommandLineArgs().
27947
27948 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
27949
27950         * object.c, object.h: added mono_runtime_run_main () and
27951         mono_runtime_get_main_args () for use in System.Environment.
27952
27953 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
27954
27955         * gc.c: fix thinko, enable actual finalization since the jit is now
27956         fixed.
27957
27958 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27959
27960         * gc.c, object.c: take into account that an object may be offset wrt the address
27961         returned by GC_malloc().
27962
27963 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
27964
27965         * image.c: handle files without entries in the assembly table (modules).
27966
27967 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
27968
27969         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
27970         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
27971         allowed to be null when it's System.Object class setup.
27972
27973 2002-04-27  Martin Baulig  <martin@gnome.org>
27974
27975         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
27976         if `tb->parent == NULL' rather than crashing.
27977
27978 2002-04-28  Nick Drochak  <ndrochak@gol.com>
27979
27980         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
27981         calling acos() where asin() should have been called.
27982
27983 2002-04-26  Martin Baulig  <martin@gnome.org>
27984
27985         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
27986         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
27987         there's a subdirectory called `System', but we don't want to read that
27988         subdirectory as an assembly.
27989
27990 2002-04-25  Martin Baulig  <martin@gnome.org>
27991
27992         * debug-symfile.c: Reflect latest MonoString changes.
27993
27994 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
27995
27996         * rand.c, rand.h: instance method icalls need to have an explicit
27997         this pointer as first argument in the C implementation.
27998
27999 2002-04-25  Nick Drochak <ndrochak@gol.com>
28000
28001         * icall.c: Fix typo in map for GetNonZeroBytes
28002
28003 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
28004
28005         * string-icalls.c : String does now passes unit tests without any 
28006         errors, the following changes has been made:
28007         
28008         Implemented replace methods.
28009         Renaming of methods to (try) follow the standard.
28010         Fixed compare ordinal
28011         Made all memory allocated directly to function instead of via icall function.
28012         Small performance fix in is_in_array function
28013                         
28014  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
28015
28016         c (mono_string_Internal_ctor_charp_int_int):
28017         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
28018         sindex < 0, throw ArgumentOutOfRangeException instead of
28019         ArgumentNullException.
28020
28021         Added new check for length == 0, however
28022         I need to make it return String.Empty from the C code.
28023         
28024         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
28025         that calculate the length for us here.
28026         
28027         (mono_string_Internal_ctor_sbytep_int_int): Replaced
28028         mono_string_new_utf16 with mono_string_new, since value is utf8.
28029
28030 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
28031
28032         * object.c: register the object for finalization if needed.
28033         Allocate one more char in the string for the terminating 0 char.
28034
28035 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
28036
28037         * class.c, class.h, image.c: check if a type implemenst a destructor.
28038         Use the proper key for array class lookups.
28039         * icall.c: register the icalls in the System.GC class.
28040         * gc.c, gc.h: GC-related functions and icalls.
28041
28042 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28043
28044         * icall.c:
28045         * socket-io.c:
28046         * unicode.c: free some strings gotten from mono_string_to_utf8 and
28047         changed a couple of free () by g_free ().
28048
28049         * decimal.c: one-liner in the comments for decimal2string ().
28050
28051 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
28052
28053         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
28054
28055 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
28056
28057         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
28058         * object.c (mono_runtime_invoke_array) : handle null in params
28059
28060 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
28061
28062         * string-icalls.c: fixed bug in split (one off bug)
28063
28064 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
28065
28066         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
28067         * icalls.c: added String::Equals as internal method
28068
28069 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
28070
28071         * threads.c: fixed bug in the double interlocked functions
28072
28073 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
28074
28075         * threads.c: implemented all of the new interlocked icalls.
28076         * string-icalls.c: fix a bug in insert.
28077         * icalls.c: added the icalls for interlocked, removed old string functions.
28078         
28079 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
28080
28081         * loader.c: fix off-by-one error when reading argument names.
28082
28083 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
28084
28085         * profiler.c: win32 counter implementation (untested).
28086         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
28087         (the latter needs testing and more complete impl. from win32 folks).
28088
28089 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
28090
28091         * object.c: mono_array_new_full workaround mono_array_class_get
28092         problem.
28093
28094 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
28095
28096         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
28097         * object.h (mono_string_chars): Changed casting type.
28098
28099 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
28100
28101         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
28102                            method signatures to use gunichar2 instead of gint16.
28103
28104 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
28105
28106         * object.h, object.c: domain-specific versions of mono_object_new and
28107         mono_array_new.
28108
28109 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
28110
28111         * object.c: changed String layout
28112
28113         * string-icalls.c (mono_string_Internal_ctor_chara): added
28114         internal string constructors.
28115
28116 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
28117
28118         * threads.c: pass 'this' to the thread start routine.
28119
28120 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28121
28122         * string-icalls.c: fix IndexOf and LastIndexOf. Now
28123         InternalCompareStr don't call twice mono_string_cmp_char for the last
28124         character. Improved performance in mono_string_cmp_char.
28125
28126 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
28127
28128         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
28129         code into its own library: libmonoruntime.
28130
28131 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
28132
28133         * object.h, object.c: changed array format so that szarrays do not
28134         require a bounds structure.
28135         * icall.c, appdomain.c: support for new szarray format.
28136
28137 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
28138
28139         * metadata.c: compare also the retuns type when comparing signatures:
28140         we didn't do this as an optimization since really overloaded methods
28141         must differ also in the arguments, but this doesn't work with
28142         low-level IL code (or when using explicit conversion operators: see
28143         bug#23498 for an example).
28144
28145 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
28146
28147         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
28148
28149 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
28150
28151         * icall.c: make MonoType::GetElementType its own icall.
28152
28153 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
28154
28155         * icall.c: remove MonoMethod_get_Name().
28156         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
28157         object.
28158
28159 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
28160
28161         * string-icalls.c: optimized a few methods.
28162
28163 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
28164
28165         * icall.c: added all new string internal calls
28166         * string-icalls.c: added, new string internal call implementation.
28167         * object.c: added mono_string_new_size for allocating a string a size
28168
28169 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
28170
28171         * object.c (mono_object_isinst): use the same code as in the
28172         optimized x86 version.
28173
28174 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
28175
28176         * profiler.c: TSC-based timer code (faster and more accurate).
28177         Not hooked up in configure, yet (set USE_X86TSC to 1).
28178
28179 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
28180
28181         * profiler.c, profiler.h: track time spent compiling methods.
28182         * threads.c: track thread creation/destruction.
28183
28184 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
28185
28186         * profiler.c, profiler.h, profiler-private.h: profiling interface
28187         and sample implementation. Moved here so that it can be used also by
28188         the jit.
28189
28190 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
28191
28192         * reflection.c, reflection.h: keep types and other handles separate in
28193         the hash tables for referred tokens. Add guid for modules.
28194
28195 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
28196
28197         * assembly.c: fix bugs found with valgrind.
28198         * metadata.h, metadata.c: added mono_metadata_guid_heap().
28199
28200 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
28201
28202         * threads: added icall support for getting current domain for
28203                    the thread.
28204  
28205 2002-04-13  Martin Baulig  <martin@gnome.org>
28206
28207         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
28208         (MonoDebugVarInfo): Added `index' field for register based addresses.
28209         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
28210         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
28211         `MonoDebugVarInfo *params' and `guint32 this_offset' with
28212         `MonoDebugVarInfo *this_var'.
28213
28214         * debug-symfile.c (relocate_variable): New static function to write
28215         a location description for a local variable or method parameter.
28216
28217 2002-04-12  Martin Baulig  <martin@gnome.org>
28218
28219         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
28220         stack offset and begin/end scope address of a local variable.
28221         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
28222         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
28223         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
28224
28225         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
28226         Added new relocation types for start/end scope of a local variable.
28227
28228 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
28229
28230         * object.h: add mono_object_domain() macro.
28231         * reflection.c: handle typespecs.
28232         * icall.c: MonoMethod::get_Name() implementation.
28233
28234 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
28235
28236         * icall.c: String::GetHashCode() icall implementation.
28237
28238 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
28239
28240         * icall.c: String::IndexOfAny icall.
28241         * object.c, object.h: make array->max_length more useful.
28242         Intrduced mono_object_class() and mono_string_length() macros.
28243
28244 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28245
28246         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
28247         instead of g_unichar_isdigit.
28248
28249 2002-04-11  Nick Drochak  <ndrochak@gol.com>
28250
28251         * icall.c: Implement a simple Double.ToString().
28252
28253 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
28254
28255         * appdomain.h: only io-layer.h is supposed to be included.
28256         * icall.c: explicitly import environ. Fix warning.
28257
28258 2002-04-10  Nick Drochak  <ndrochak@gol.com>
28259
28260         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
28261                 return true even if it's not Daylight Savings time.
28262                 Only return false for the case where the function isn't
28263                 implemented for a plaform (read Windows).
28264
28265 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
28266
28267         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
28268         data with a mutex.
28269
28270 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
28271
28272         * mempool.c (mono_mempool_alloc): only use g_malloc when
28273         absolutely necessary.
28274
28275 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
28276
28277         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
28278
28279         * class.c (mono_class_vtable): use domain mempool to allocate vtable
28280         (mono_class_proxy_vtable): use domain mempool
28281
28282 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
28283
28284         * appdomain.h, appdomain.c: split initialization that requires the
28285         execution engine support into mono_runtime_init().
28286
28287 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
28288
28289         * class.c (mono_class_init): don't include vtable inside MonoClass
28290         to save some memory, gather some statistics.
28291         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
28292
28293 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
28294
28295         * icall.c: internalcall implementation for ValueType.Equals().
28296
28297 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
28298
28299         * object.c (mono_message_init): moved 
28300         (mono_runtime_exec_main): new arch. independent impl.
28301         (mono_runtime_invoke_array): new method - like
28302         mono_runtime_invoke, but you can pass an array of objects.
28303         (mono_remoting_invoke): new arch. independent impl.
28304         (mono_message_invoke): new arch. independent impl.
28305         (mono_runtime_class_init): new arch. independent impl.
28306         (mono_runtime_object_init): new arch. independent impl.
28307
28308 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
28309
28310         * metadata.c, object.c, reflection.c: documented the exported
28311         functions.
28312
28313 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
28314
28315         * icall.c: simpler code to pass the assembly builder data to corlib.
28316         Implement GetNestedTypes() internalcall.
28317
28318 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
28319
28320         * class.c: warn if a type can't be loaded.
28321
28322 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
28323
28324         * image.h: typedef MonoImageOpenStatus
28325         * types.h: removed unused file
28326         
28327 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
28328
28329         * icall.c: Enum_ToObject accepts enum value arguments.
28330
28331 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
28332
28333         * class.c: move initialization of properties, events and nested
28334         classes, so that they happen for interfaces, too.
28335
28336 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
28337
28338         * icall.c: cleanup some ugly casts in Array_SetValue*.
28339
28340 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
28341
28342         * icall.c: the values array fro enums is of the correct type, now.
28343         Implement (correctly) getFullName instead of assQualifiedName for
28344         MonoType.
28345         * reflection.h, reflection.c: added mono_type_get_name ().
28346
28347 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
28348
28349         * assembly.c, image.h: for each MonoImage, record from wich assembly
28350         it was loaded.
28351         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
28352         Make Type.Assembly work.
28353
28354 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
28355
28356         * debug-symfile.h: use char* instead of gpointer to avoid
28357         unnecessary casts.
28358
28359         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
28360
28361         * icall.c (ves_icall_InternalExecute): impl. FielSetter
28362         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
28363
28364 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
28365
28366         * icall.c (mono_message_init): impl. (code cleanup)
28367         (ves_icall_InternalExecute): impl. FieldGetter
28368
28369         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
28370         defined we call all (non-static)methods through the vtable. 
28371
28372 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
28373
28374         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
28375         finalizer even though the memory is still referenced (and the chunk of
28376         memory is not freed).
28377
28378 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
28379
28380         * assembly.c: fix brokeness.
28381
28382 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
28383
28384         * class.c: kill some warnings. Check explicit interface method
28385         implementation also without considering the namespace.
28386         Load also literal strings in static class data.
28387
28388 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
28389
28390         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
28391         (default_assembly_name_resolver): Make the resolver take the
28392         "base" directory where the assembly was originally defined, so we
28393         can load DLLs that are in the same directory as the assembly that
28394         is being referenced.
28395
28396 2002-03-28  Dick Porter  <dick@ximian.com>
28397
28398         * file-io.h: 
28399         * file-io.c:
28400         * socket-io.c: 
28401         * unicode.h: 
28402         * unicode.c: Warning cleanups
28403
28404 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
28405
28406         * object.h, reflection.h: use the correct type instead of MonoObject.
28407
28408 2002-03-28  Martin Baulig  <martin@gnome.org>
28409
28410         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
28411         (mono_debug_update_symbol_file): Initialize classes if necessary.
28412
28413 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
28414
28415         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
28416         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
28417
28418 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
28419
28420         * assembly.h: fix function prototype.
28421         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
28422         * mono-endian.h: use const cast.
28423
28424 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
28425
28426         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
28427
28428 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
28429
28430         * loader.c: don't assert when a typeref can't be loaded, give
28431         a chance to the runtime to trow an exception instead.
28432         * loader.h: fix warning.
28433
28434 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
28435
28436         * class.c (mono_class_proxy_vtable): added proxy support
28437
28438 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
28439
28440         * icall.c: removed last of PAL calls, added System.Environment
28441         * file-io.h, file-io.c: MonoIO implementation
28442         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
28443
28444 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
28445
28446         * appdomain.c: do not use the byte marker in ldstr table lookup.
28447         * debug-helpers.c: allow two ':' to separate class and method name.
28448         * object.c: allocate arrays bounds with the GC, too.
28449         * verify: add a few more checks.
28450
28451 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
28452
28453         * reflection.c: output also literal strings. Allocate parameter data
28454         with GC_malloc() (thanks, Martin, for catching this!).
28455
28456 2002-03-26  Martin Baulig  <martin@gnome.org>
28457
28458         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
28459         include the `this' offset in the `param_offsets'.
28460
28461 2002-03-25  Martin Baulig  <martin@gnome.org>
28462
28463         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
28464         mono_debug_get_class() function to get the classes. Added new
28465         relocation types for arrays and strings.
28466         (mono_debug_get_class): New static function to search in all
28467         referenced assemblies for a metadata token.
28468
28469         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
28470
28471 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
28472
28473         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
28474         hold gc-allocated objects. Make the string heap a stream like the
28475         others. Removed duplicated code when writing stream info.
28476         Added asserts to catch possible buffer overflows. Set the sorted map
28477         for tables that need sorting. Added some documentation.
28478
28479 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
28480
28481         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
28482         for interned strings and vtables.
28483
28484 2002-03-24  Martin Baulig  <martin@gnome.org>
28485
28486         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
28487         it in the array since it was created with g_slist_prepend().
28488
28489 2002-03-24  Martin Baulig  <martin@gnome.org>
28490
28491         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
28492         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
28493         (mono_debug_method_from_token): Renamed to
28494         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
28495         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
28496
28497         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
28498         relocation types.
28499
28500         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
28501
28502 2002-03-24  Martin Baulig  <martin@gnome.org>
28503
28504         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
28505         (mono_debug_method_from_token): New func.
28506
28507         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
28508         New interncall, calls mono_debug_local_type_from_signature().
28509         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
28510         calls mono_debug_method_from_token().
28511
28512 2002-03-23  Martin Baulig  <martin@gnome.org>
28513
28514         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
28515         specifies the number of bytes to be converted, not the array size.
28516         Return the number of chars, not the number of bytes.
28517         (ves_icall_iconv_get_chars): The `byteCount' argument
28518         specifies the number of bytes to be converted, not the array size.
28519
28520 2002-03-23  Martin Baulig  <martin@gnome.org>
28521
28522         * reflection.h (MonoReflectionSigHelper): New type.
28523
28524         * reflection.c (mono_reflection_sighelper_get_signature_local),
28525         (mono_reflection_sighelper_get_signature_local): New functions.
28526
28527         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
28528         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
28529         interncalls.
28530
28531 2002-03-23  Martin Baulig  <martin@gnome.org>
28532
28533         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
28534         is_writeable is set.
28535         (mono_raw_buffer_update): New function to write the modified map
28536         back to disk.
28537
28538         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
28539
28540         * debug-symfile.c (mono_debug_update_symbol_file): Call
28541         mono_raw_buffer_update() when done writing.
28542
28543 2002-03-23  Martin Baulig  <martin@gnome.org>
28544
28545         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
28546
28547         * debug-symfile.c: Added support for arguments and local variables.
28548
28549 2002-03-23  Dick Porter  <dick@ximian.com>
28550
28551         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
28552         protected by ifdefs, hence breaking the w32 build.
28553
28554 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28555
28556         * object.c: implement is_interned() the right way.
28557
28558 2002-03-21  Martin Baulig  <martin@gnome.org>
28559
28560         * debug-symfile.[ch]: New files to handle debugging information
28561         files. There's also support to dynamically update these symbol
28562         files to include machine dependent information.
28563
28564 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
28565
28566         * threads.c (mono_thread_create): new function to create thread
28567         from C
28568
28569 2002-03-20  Martin Baulig  <martin@gnome.org>
28570
28571         * icall.c (ves_icall_InternalInvoke): Create a new object if the
28572         method is a constructor.
28573         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
28574         points to ves_icall_InternalInvoke().
28575
28576 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
28577
28578         * file-io.c: Flush shouldn't throw exceptions.
28579
28580 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
28581
28582         * file-io.c: FileStream flush support; FileSetLength now
28583         restores file pointer.
28584
28585 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
28586
28587         * class.c: set image for pointer classes.
28588
28589 2002/03/19  Nick Drochak <ndrochak@gol.com>
28590
28591         * sysmath.c: Forgot one.
28592
28593 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
28594
28595         * sysmath.c: Avoid redefining existing names.
28596
28597 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
28598
28599         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
28600         handled by runtime as icall rather than dllimport from libm.so
28601         * file-io.c, file-io.h: fixed handle argument type.
28602
28603 2002-03-18  Dick Porter  <dick@ximian.com>
28604
28605         * reflection.c (mono_image_get_type_info): rename interface to
28606         iface, because of "#define interface struct" on windows.
28607
28608 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
28609
28610         * class.c, class.h: rename and export mono_ptr_class_get().
28611         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
28612         * reflection.c, reflection.h, icall.c: better/saner type name
28613         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
28614         method signatures.
28615
28616 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
28617
28618         * class.c (mono_class_init): removed hardcoded GHC_SLOT
28619
28620         * icall.c (ves_icall_InternalInvoke): impl.
28621
28622 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
28623
28624         * reflection.c: output the interface map table, too.
28625
28626 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
28627
28628         * class.c (class_compute_field_layout): separate computation of 
28629         static field layout
28630
28631 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
28632
28633         * icall.c: added System.Buffer support.
28634         * file-io.c: moved file icalls from PAL to FileStream.
28635
28636 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
28637
28638         * icall.c (ves_icall_System_Object_GetHashCode): impl.
28639
28640 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
28641
28642         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
28643
28644 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
28645
28646         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
28647
28648 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28649
28650         * debug-helpers.{c,h}: moved here from monograph some useful functions
28651         to locate a method by name/signature in a class or image. Included
28652         also a small and flexible IL disassembler.
28653
28654 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
28655
28656         * reflection.c: fixup tokens in methods with small header size, too.
28657
28658 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
28659
28660         * object.c (mono_string_to_utf8): remove assert(!error), instead
28661         print a warning. 
28662
28663 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
28664
28665         * icall.c: update to the new mono_Array_class_get interface.
28666
28667 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
28668
28669         * appdomain.c, object.c: Boehm-GC enable.
28670         * icall.c: make get_data_chunk() support split data requests.
28671         Ensure a class is initialized in more cases. Return only the first
28672         property found in GetProperties() or the compiler gets confused. 
28673         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
28674         * reflection.h, reflection.c: add fixup mechanism for field and method
28675         tokens. Initialize assembly->typeref in a single place. Output
28676         properties after events. Support custom attributes for events, too.
28677         Typo fix for paramter custom attrs.
28678
28679 2002-03-07  Martin Baulig  <martin@gnome.org>
28680
28681         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
28682
28683 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
28684
28685         * class.c (mono_array_class_get): fix. for multi. dim. arrays
28686
28687 2002-03-06  Martin Baulig  <martin@gnome.org>
28688
28689         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
28690         non-zero lower bounds. See testcases #F10-#F13.
28691
28692 2002-03-05  Martin Baulig  <martin@gnome.org>
28693
28694         * exception.c (mono_get_exception_argument_out_of_range): New exception.
28695
28696         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
28697         ves_icall_System_Array_GetValue(), only calculate the absolute array position
28698         here.
28699         (ves_icall_System_Array_SetValue): Likewise.
28700         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
28701         as argument and does the actual work. This function is used when copying a
28702         multi-dimensional array.
28703         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
28704         now do all the widening conversions of value types.
28705         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
28706
28707 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28708
28709         * class.c: remove some magic numbers and use the smbolic names,
28710         instead. Added init_events() to load event info at class init time.
28711         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
28712         and mono_metadata_methods_from_event().
28713         * reflection.h, reflection.c: added support for writing out the evnets
28714         related information.
28715
28716 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
28717
28718         * reflection.h, icall.c: use a different method (GetInterfaces)
28719         to gather interface info and add isbyref, isprimitive and
28720         ispointer to the ves_icall_get_type_info() return value.
28721
28722 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
28723
28724         * class.h: stared adding support for events.
28725         * icall.c: split find_members implementation. Added debug icall to get
28726         the address of an object.
28727         * reflection.c: handle TypeBuilders in mono_type_get_object().
28728
28729 2002-03-01  Martin Baulig  <martin@gnome.org>
28730
28731         * icall.c (ves_icall_System_Array_GetLength): This must throw an
28732         ArgumentOutOfRangeException(), not an ArgumentException().
28733         (ves_icall_System_Array_GetLowerBound): Likewise.
28734         (ves_icall_System_Array_GetValue): Improved argument checking.
28735         (ves_icall_System_Array_SetValue): Improved argument checking.
28736
28737 2002-03-01  Martin Baulig  <martin@gnome.org>
28738
28739         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
28740         called with invalid arguments rather than just dying with g_assert().
28741         (ves_icall_System_Array_SetValue): Likewise.
28742         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
28743         raise a NotImplementedException instead.
28744         (ves_icall_System_Array_GetLength): Added argument checking.
28745         (ves_icall_System_Array_GetLowerBound): Added argument checking.
28746
28747 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
28748
28749         * object.h (mono_assert): new macros mono_assert and
28750         mono_assert_not_reached
28751
28752 2002-02-28  Martin Baulig  <martin@gnome.org>
28753
28754         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
28755         and "System::String::IsInterned" to "System::String::_IsInterned".
28756
28757 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
28758
28759         * icall.c: remove hacks for typebuilder. Added icall to create a
28760         modified type from a tybebuilder.
28761         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
28762         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
28763         to create a backing MonoClass for a TypeBuilder.
28764
28765 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
28766
28767         * class.c, class.h: more refactoring of class init.
28768         Export mono_class_setup_mono_type() and mono_class_setup_parent().
28769
28770 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
28771
28772         * marshal.c, marshal.h: start of marshaling interface.
28773
28774 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
28775
28776         * icall.c: fix order in assembly qualified name icall.
28777
28778 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
28779
28780         * class.c: do not free str, since we store it in the hash table.
28781         * reflection.h: add label field to MonoILExceptionInfo.
28782         * reflection.c: handle references to more than one assembly. Handle
28783         case when there isn't a module created in the assembly.
28784
28785 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
28786
28787         * class.c: Fix typo. Start refactoring of class init code.
28788
28789 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
28790
28791         * appdomain.c: exit with 1 on error.
28792         * class.c: we already have the name in MonoClassField.
28793         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
28794         MonoStreamHeader instead of an offset of image->raw_metadata.
28795
28796 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
28797
28798         * appdomain.c (mono_init): Be even more descriptive about the error.
28799
28800 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
28801
28802         * appdomain.c: give the user an informative message when corlib can't
28803         be loaded.
28804
28805 2002-02-26  Martin Baulig  <martin@gnome.org>
28806
28807         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
28808         New icall to get the time zone data.
28809
28810 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
28811
28812         * reflection.c: set virtual and raw size of section correctly.
28813         * threads.c: transfer domain information to newly created threads.
28814
28815 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
28816
28817         * class.c: when instancing a class in a domain, load the default
28818         vaules for static fields from the constant table. Fix System.Enum to
28819         not be an enum.
28820         * icall.c: implement Object::GetType() internalcall. Implemented
28821         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
28822         Fixed checking of binding flags in find_members().
28823         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
28824         * reflection.c: handle enumerations when writing to the constant
28825         table. Use a different object cache for types.
28826
28827
28828 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
28829
28830         * object.c (mono_object_isinst): fix for arrays
28831
28832         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
28833
28834 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
28835
28836         * object.c: don't use mprotect ()  and fix intern pool hash table
28837         lookup for big endian systems.
28838
28839 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
28840
28841         * icall.c: change type_is_subtype_of () signature.
28842
28843 2002-02-21  Mark Crichton  <crichton@gimp.org>
28844
28845         * rand.c, rand.h: Added random number generator for
28846         System.Security.Cryptography classes.
28847
28848         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
28849
28850         * icall.c: Added System.Security.Cryptography calls.
28851
28852 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
28853
28854         * class.c, icall.c, metadata.c: better support for pointer types.
28855         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
28856         * reflection.c: Add support for getting custom attrs for properties
28857         and simplify some code.
28858
28859 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
28860
28861         * icall.c: change getToken () and add custom attribute GetBlob()helper
28862         method.
28863         * reflection.h: add custom attrs array to the reflection builder structures.
28864         * reflection.c: encode and emit custom attributes for all the relevant
28865         reflection objects. Cache fieldref and methodref tokens. Change
28866         mono_image_create_token() interface to take a MonoDynamicAssembly.
28867         More complete custom attributes decoder. Load custom attributes for
28868         Assembly, Field, Method and Constructor objects, too. Make the
28869         returned array an Attribute[] one, not object[]. Added
28870         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
28871         custom attribute constructor.
28872
28873 2002-02-20  Dick Porter  <dick@ximian.com>
28874
28875         * icall.c:
28876         * rawbuffer.c:
28877         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
28878         problem code out for now).
28879
28880 2002-02-19  Radek Doulik  <rodo@ximian.com>
28881
28882         * object.c (mono_ldstr): use hash table to avoid multiple swapping
28883
28884 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
28885
28886         * icall.c: register the GetCustomAttributes method.
28887         * object.c, object.h: add mono_string_new_len ().
28888         * reflection.h, reflection.c: added mono_runtime_invoke(),
28889         mono_install_runtime_invoke(). Added
28890         mono_reflection_get_custom_attrs () to load custom attributes and
28891         create the attribute objects.
28892
28893 2002-02-19  Dick Porter  <dick@ximian.com>
28894         * threads-dummy-types.c:
28895         * threads-dummy-types.h:
28896         * threads-dummy.c:
28897         * threads-dummy.h:
28898         * threads-pthread-types.c:
28899         * threads-pthread-types.h:
28900         * threads-pthread.c:
28901         * threads-pthread.h:  Deleted obsolete files
28902
28903 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
28904
28905         * class.c (mono_class_vtable): runtime init the class when we
28906         allocate static class data.
28907
28908         * icall.c (ves_icall_System_Array_SetValue): check for null values.
28909
28910         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
28911         and String - but we will need generic marshalling support in the
28912         future. 
28913         (mono_init): set the domain name in a ms compatible way
28914
28915         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
28916         String[].
28917
28918 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
28919
28920         * object.c (mono_array_clone): use alloca() instead of g_malloc  
28921         for sizes
28922
28923         * appdomain.c (mono_domain_unload): impl.
28924
28925 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
28926
28927         * appdomain.c, object.c: fix intern pool implementation.
28928         * class.c: fix alignment code.
28929
28930 2002-02-16  Radek Doulik  <rodo@ximian.com>
28931
28932         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
28933         and s2 > s1, just copy lower bytes to be compatible with little
28934         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
28935         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
28936
28937         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
28938         force big_endian to be 1 for big endian machines 
28939         (ves_icall_iconv_new_decoder): ditto
28940
28941 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
28942
28943         * socket-io.c (convert_sockopt_level_and_name): If the system
28944         doesn't define SOL_IP or SOL_TCP, get them by hand using
28945         getprotobyname() and caching the values (because this could be a
28946         slow operation).
28947         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
28948         Use the appropriate struct when the system does support it. Ie,
28949         not all systems have struct ip_mreqn so use struct ip_mreq when
28950         appropriate.
28951
28952 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
28953
28954         * reflection.c: handle finally clauses.
28955
28956 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
28957
28958         * socket-io.c: use g_snprintf() instead of snprintf.
28959
28960 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
28961
28962         * reflection.c (mono_param_get_objects): Cast second argument to
28963         mono_method_get_param_names to a const char** to silence the
28964         compiler warning.
28965
28966         * appdomain.c (mono_domain_assembly_open): Put parens around the
28967         truth statement in the for-loop.
28968
28969         * unicode.c (iconv_convert): Got rid of a compiler warning about
28970         int i being unused when the system has a new iconv.
28971         (iconv_get_length): Same.
28972
28973         * image.c (load_class_names): Cast the second argument to
28974         g_hash_table_insert() to char* to hush compiler warnings about the
28975         arg being a const.
28976         (mono_image_open): Same here.
28977
28978         * socket-io.c: Don't conditionally include sys/filio.h or
28979         sys/sockio.h here anymore since we now get them from
28980         io-layer/io-layer.h
28981         (inet_pton): If the system doesn't support inet_aton, implement
28982         using inet_addr and also #define INADDR_NONE if it isn't defined
28983         by the system.
28984
28985 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
28986
28987         * metadata.c, metadata.h: added function to get packing and size info
28988         of a typedef.
28989         * reflection.h, reflection.c: handle field RVA data. Save info about
28990         the table layout if needed. Assign typedef indexes to all the types
28991         before dumping the info about them to avoid forward reference problems.
28992
28993 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
28994
28995         * socket-io.c (convert_sockopt_level_and_name): ifdef
28996         SO_ACCEPTCONN because it is not defined on my system (old debian)
28997
28998 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
28999
29000         * opcode.c: use stddef.h to get NULL.
29001
29002 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
29003
29004         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
29005         for FIONBIO, FIONREAD and SIOCATMARK.
29006         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
29007         define INADDR_NONE and besides, inet_addr() is deprecated and
29008         should not be used. Use inet_pton() instead - it also has the
29009         added bonus that it can easily handle IPv6 addresses as well.
29010         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
29011
29012 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
29013
29014         * decimal.c: remove _MSC_VER conditional.
29015
29016 2002-02-13  Dick Porter  <dick@ximian.com>
29017
29018         * socket-io.c: 
29019         * icall.c: Internal calls for Blocking, Select, Shutdown,
29020         GetSocketOption and SetSocketOption
29021
29022 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
29023
29024         * assembly.cs: better resolver: use it instead of some kludgy
29025         code.
29026
29027 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
29028
29029         * reflection.c: the best way to speed-up the compiler is to avoid
29030         infinite loops.
29031
29032 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
29033
29034         * class.c (mono_class_vtable): changed the object layout
29035         (obj->vtable->class). 
29036         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
29037
29038 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
29039
29040         * assembly.c: look for assemblies in the assembly dir, too.
29041
29042 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
29043
29044         * class.c: fix thinko in mono_class_from_type().
29045
29046 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
29047
29048         * exception.h, exception.c: added TypeLoadException.
29049         * object.h, object.c: added mono_array_clone ().
29050         * icall.c: handle throwOnError in AssemblyGetType().
29051         Added Array.Clone().
29052         * opcode.h, opcode.c: use a single value for the opcode val.
29053         Compile fix for non-gcc compilers.
29054
29055 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
29056
29057         * opcodes.c, opcodes.h: export interesting info about opcodes.
29058
29059 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
29060
29061         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
29062         icalls. 
29063
29064         * class.c (class_compute_field_layout): set element_class for enums
29065         (mono_class_create_from_typedef): set element_class for normal classes
29066
29067         * icall.c (ves_icall_System_Enum_get_value): impl.
29068
29069         * class.c (mono_class_create_from_typedef): do not set valuetype
29070         flag for System.ValueType and System.Enum
29071
29072 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
29073
29074         * unicode.c (iconv_convert): fix big endian problem.
29075
29076 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
29077
29078         * class.c: add asserts if we are ever going to scribble over memory.
29079         * socket-io.c: not all systems have AF_IRDA defined.
29080
29081 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
29082
29083         * class.c (class_compute_field_layout): do not consider static
29084         fields to compute alignment
29085
29086 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
29087
29088         * appdomain.c (mono_appdomain_get): impl.
29089         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
29090
29091 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
29092
29093         * icall.c: ignore "file://" prefix when loading an assembly.
29094
29095 2002-01-23  Dick Porter  <dick@ximian.com>
29096
29097         * socket-io.c:
29098         * icall.c:
29099         * Makefile.am: Added socket support
29100
29101 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
29102
29103         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
29104         code back.  This should return the assemblies that are loaded by
29105         the runtime on behalf of an application domain. 
29106
29107         The current implementation is still broken, it just returns every
29108         assembly loaded, but until we get real applications domain this
29109         will do.
29110
29111 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
29112
29113         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
29114         AppDomain object.
29115
29116 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
29117
29118         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
29119         the mono_class_from_name lookup.
29120         (ves_icall_get_parameter_info): ditto.
29121         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
29122         method.
29123         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
29124
29125 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
29126
29127         * class.c: load also nested classes on class init.
29128         System.ValueType instance methods gets passed boxed
29129         values, unless methods in derived classed that get a pointer to the
29130         data.
29131         * icall.c: use better name parsing code in GetType().
29132         * image.c, image.h: add mono_image_loaded ().
29133         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
29134         * reflection.c, reflection.h: added mono_reflection_parse_type().
29135
29136 2002-01-22  Veronica De Santis <veron78@interfree.it>
29137
29138         * icall.c : Added mapping of internal calls for Manual and Auto reset events
29139         * threads.c : Added the implementation of internal calls for events
29140         * threads.h : Added prototypes of internal calls for events
29141         
29142 2002-01-21  Radek Doulik  <rodo@ximian.com>
29143
29144         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
29145
29146 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
29147
29148         * class.c (mono_class_init): set min_align to 1 (instead of 0)
29149         (mono_class_value_size): use min_align
29150
29151 2002-01-20  Dick Porter  <dick@ximian.com>
29152
29153         * threads.h:
29154         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
29155         so it compiles on w32.
29156
29157 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
29158
29159         * metadata.c (mono_type_stack_size): impl.
29160
29161         * class.c (mono_class_get_field): impl. memberref token
29162
29163 2002-01-16 Veronica De Santis <veron78@@interfree.it>
29164
29165         * icall.h : Added the internal calls mapping for CreateMutex_internal
29166                     and ReleaseMutex_internal.
29167         * threads.h : Added the prototype of mutexes internal calls.
29168         * threads.c : Added the implementations of mutexes internal calls.
29169
29170 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
29171
29172         * metaparse.h: removed unused file.
29173         * reflection.c, reflection.h: added stream_data_align () function 
29174         to align data in streams and keep stream aligned. Add support for
29175         exception support in method headers.
29176
29177 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
29178
29179         * unicode.c: make iconv_convert () return the number of bytess written
29180         in the output buffer.
29181
29182 2002-01-15  Dick Porter  <dick@ximian.com>
29183         * threads.c: Make the runtime's idea of infinite timeouts coincide
29184         with the class library's
29185
29186         Fix a particularly egregious bug in mono_thread_cleanup(). That
29187         code was so utterly bogus it must have been written on a Monday.
29188
29189 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
29190
29191         * reflection.h: add subtypes field to TypeBuilder.
29192         * reflection.c: encode constants for literal fields.
29193         Handle subtypes. Fix user string token (and add a zero byte)
29194         at the end.
29195         
29196 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
29197
29198         * class.c (mono_class_init): bug fix: assign slot numbers for
29199         abstract methods.
29200
29201 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
29202
29203         * reflection.c: don't try to output a code RVA for abstract methods.
29204         Small fixes for method header format. Output parameter info to the
29205         ParamDef table. Save method overriding info to MethodImpl table.
29206         Fix property support. Allow typedef.extends to be a type in the
29207         building assembly.
29208         * verify.c: fix off-by-one error.
29209
29210 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
29211
29212         * class.c: fix mono_class_from_mono_type () for szarray types.
29213         Remove unused cache check in mono_class_from_type_spec().
29214         * icall.c: *type_from_name () functions handle simple arrays and byref.
29215         * reflection.c: handle byref and szarray types. Handle methods without
29216         body (gets P/Invoke compilation working). Handle types and fields in
29217         get_token ().
29218         * reflection.h: add rank to MonoTypeInfo.
29219
29220 2002-01-10  Dick Porter  <dick@ximian.com>
29221
29222         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
29223         internal calls
29224
29225 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
29226
29227         * icall.c: initialize class in type_from_handle ().
29228         Loop also in parent classes for get_method ().
29229         * reflection.c: properly encode class and valuetype types.
29230         Start on encoding TypeBuilder types. Handle fieldrefs.
29231         Use correct length when registering a user string.
29232         Handle ConstructorBuilder and MonoMethod in get_token ().
29233         Make mono_type_get_object () aware of cached types.
29234         * object.c: back out change to mono_string_new ().
29235
29236 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
29237         * object.c: mono_string_new should return a NULL when the string 
29238         passed in is NULL -- not try to deference it.
29239         
29240 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
29241
29242         * icall.c: hack to make IsSubType work for TypeBuilders.
29243         * reflection.c: emit constructors before methods.
29244         Retrieve param names in mono_param_get_objects().
29245
29246 2002/01/05  Nick Drochak  <ndrochak@gol.com>
29247
29248         * Makefile.am: fix list of headers and sources so automake 1.5
29249         doesn't complain. Removed \# at end of list.
29250
29251 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
29252
29253         * reflection.c: get token for a method ref. Set return type of
29254         constructor to void.
29255         * loader.c: debug message.
29256         * class.c: typo fix.
29257
29258 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
29259
29260         * icall.c: fix array init with rank > 1. FindMembers
29261         loops in parent class as well.
29262         * image.c: do not insert nested types in name cache.
29263         * reflection.c: warning fix.
29264         * reflection.h: add override method (for interface impl).
29265
29266 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
29267
29268         * metadata.c: fix customattr decoding.
29269
29270 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
29271
29272         * rawbuffer.cs: Added native Win32 implementation, avoids using
29273         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
29274
29275 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
29276
29277         * class.c: make the low-level routines handle the cache.
29278
29279 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
29280
29281         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
29282
29283 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
29284
29285         * class.c: fix mono_array_element_size() for objects.
29286         * class.h, class.c: add properties to MonoClass and load them
29287         at init time.
29288         * icall.c: check with isinst() when assigning a value to an array
29289         instead of requiring the classes to match exactly.
29290         Implemented icall for System.Type::GetType().
29291         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
29292         enums. Handle bindingflags when looking for methods and fields.
29293         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
29294         and mono_metadata_methods_from_property().
29295         * reflection.h, reflection.c: added structures for propreties,
29296         parameters and enums. Implemented mono_property_get_object() and
29297         mono_param_get_objects().
29298
29299 2001-12-18  Dick Porter  <dick@ximian.com>
29300
29301         * file-io.c: Use mono_string_to_utf16() instead of
29302         mono_string_chars()
29303
29304         * object.c: Added mono_string_to_utf16(), which copies the non
29305         NULL-terminated MonoString into a new double-null-terminated
29306         buffer.
29307
29308 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
29309
29310         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
29311
29312 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
29313
29314         * file-io.c: raise exceptions if handle is invalid.
29315
29316 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
29317
29318         * assembly.c: yet another check for mscorlib.
29319         * class.c, class.h: load nesting info for classes.
29320         * icall.c: many new functions to support the Reflection classes.
29321         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
29322         * reflection.h, reflection.c: mono_image_create_token(),
29323         mono_assembly_get_object(), mono_type_get_object(),
29324         mono_method_get_object(), mono_field_get_object(): methods to return
29325         objects that parallel the C representation of assemblies, types,
29326         methods, fields.
29327
29328 2001-12-11  Dick Porter  <dick@ximian.com>
29329
29330         * icall.c:
29331         * file-io.c: Internal calls for file IO.
29332
29333 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
29334
29335         * tabledefs.h: missing FileAttributes.
29336         * verify.h, verify.c: use is_valid_string () to simplify and check for
29337         valid strings more correctly. Fix warnings and speeling.
29338         Check more tables: Filed, File, ModuleRef, StandAloneSig.
29339         Check code: branches, maxstack, method calls.
29340
29341 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
29342
29343         * object.c (mono_object_allocate): removed static, so that the jit
29344         can allocate value types.
29345
29346         * icall.c (ves_icall_System_DateTime_GetNow): impl.
29347
29348 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
29349
29350         * class.c: init enum types right away and register the
29351         token->MonoClass map in mono_class_create_from_typedef ().
29352         * verify.h, verify.c: first cut of the verifier.
29353         * pedump.c: add --verify switch to verify metadata tables.
29354         * tabledefs.h: add some missing enums.
29355
29356 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
29357
29358         * class.c (mono_install_runtime_class_init): impl.
29359         (mono_class_init): renamed mono_class_metadata_init to
29360         mono_class_init, also removed the metadata_inited flag
29361
29362         * object.c (mono_object_isinst): use faster algorithm
29363
29364 2001-11-30  Radek Doulik  <rodo@ximian.com>
29365
29366         * mono-endian.h: reverted last change
29367         added function prototypes
29368
29369         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
29370         add mono-endian.c back
29371
29372         * mono-endian.c: returned back, as Paolo pointed out, it's needed
29373         for unaligned access, I've mistaked it with endianess. I am
29374         sorry.
29375         (mono_read16): fix reverted endianess
29376         (mono_read64): ditto
29377         (mono_read32): ditto
29378
29379 2001-11-30  Dick Porter  <dick@ximian.com>
29380
29381         * exception.c: Implement mono_exception_from_name()
29382
29383 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
29384
29385         * metadata.h, metadata.c: remove params_size and locals_size and their
29386         calculation from the metadata code: they are only usefult to the
29387         interp.
29388
29389 2001-11-29  Radek Doulik  <rodo@ximian.com>
29390
29391         * object.c (mono_ldstr): swap bytes here, it's probably not the
29392         best place, but works for me now, I'll redo it once I know mono
29393         better, also note that I add PROT_WRITE and don't reset back, also
29394         note that it's only affects big endians, so x86 should be OK
29395
29396         * mono-endian.h (read16): use just glib macros for both endians
29397
29398         * mono-endian.c: removed as glib macros are used in in
29399         mono-endian.h so we don't need to care about endianess for read
29400         macros as glib does that for us already
29401
29402 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
29403
29404         * class.h, class.h: take minimum alignment into consideration so
29405         that the fields of a class remain aligned also when in an array.
29406
29407 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
29408
29409         * loader.h, loader.c: add mono_method_get_param_names().
29410         * class.c: 0-init class fields.
29411
29412 2001-11-26  Dick Porter  <dick@ximian.com>
29413
29414         * icall.c:
29415         * threads-types.h:
29416         * threads.c: New file that handles System.Threading on all platforms
29417
29418         * object.c: 
29419         * object.h: Remove the synchronisation struct from MonoObject,
29420         replace it with a pointer that gets initialised on demand
29421
29422         * Makefile.am: Replace all the system-specific threading code with
29423         a single file that uses the new wrapper library
29424
29425 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
29426
29427         * class.c, class.h: add mono_install_trampoline() so that the runtime
29428         can register a function to create a trampoline: removes the ugly
29429         requirement that a runtime needed to export arch_create_jit_trampoline.
29430         * object.h, object.c: added mono_install_handler() so that the runtime
29431         can install an handler for exceptions generated in C code (with
29432         mono_raise_exception()). Added C struct for System.Delegate.
29433         * pedump.c: removed arch_create_jit_trampoline.
29434         * reflection.c: some cleanups to allow registering user strings and
29435         later getting a token for methodrefs and fieldrefs before the assembly
29436         is built.
29437         * row-indexes.h: updates and fixes from the new ECMA specs.
29438
29439 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
29440
29441         * class.h, class.c: add enum_basetype field to MonoClass.
29442         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
29443         to get index in the constant table reated to a field, param or
29444         property.
29445         * reflection.h, reflection.c: handle constructors. Set public-key and
29446         version number of the built assembly to 0.
29447         * row-indexes.h: update from new ECMA spec.
29448
29449 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
29450
29451         * class.h, class.c: add a max_interface_id to MonoClass.
29452         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
29453         since it's used to do that. Added mono_type_type_from_obj().
29454         Make GetType() return NULL instead of segfaulting if the type was not
29455         found. Handle simple arrays in assQualifiedName.
29456         * object.h: add a struct to represent an Exception.
29457         * reflection.c: output call convention in method signature.
29458         Add code to support P/Invoke methods and fixed offsets for fields.
29459
29460 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
29461
29462         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
29463         the value.
29464         * icall.c: use mono_array_addr instead of array->vector: fixes the
29465         reflection image writing.
29466         * reflection.c: init call convention byte to 0 in method signature.
29467         Encode the property signature. Don't output property-related methods
29468         twice. Really process the properties for a type (don't cast a field to
29469         a property, my mom always told me that).
29470         Fix 64 bit issues in pointer alignment in a different and more
29471         readable way.
29472
29473 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
29474
29475         * loader.h: Removed type class from MonoDefaults, added monotype
29476
29477         * loader.c: Loaded MonoType, removed loading of Type
29478
29479         * icall.c (my_mono_new_object): Now returns a System.MonoType,
29480         and fills in System.Type._impl with a RuntimeTypeHandle rather
29481         than the actual MonoClass *
29482
29483         (ves_icall_type_from_handle): change from type_class to
29484         monotype_class
29485
29486         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
29487         implemented
29488
29489         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
29490         implemented
29491
29492         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
29493
29494         (ves_icall_System_Reflection_Assembly_GetType): implemented
29495
29496         (ves_icall_System_MonoType_assQualifiedName): implemented
29497
29498         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
29499
29500 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29501
29502         * assembly.c (mono_assembly_open): Implement a cache for the
29503         assemblies. 
29504
29505         (mono_assembly_close): only destroy the assembly when the last
29506         reference is gone.
29507         
29508 2001-11-09  Dick Porter  <dick@ximian.com>
29509
29510         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
29511
29512 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
29513
29514         * class.c (mono_class_metadata_init): bug fix: compute the right slot
29515
29516 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
29517
29518         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
29519         from Martin Weindel.
29520         * object.h: add mono_string_chars ().
29521
29522 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
29523
29524         * reflection.c (build_compressed_metadata): Eliminates warnings
29525         and uses 64-bit clean code.
29526
29527         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
29528         (mono_type_equal): Change signature to eliminate warnings.
29529
29530 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
29531
29532         * icall.c, loader.c: remove the internalcall array constructors.
29533         Changes to match the new MonoArray structure.
29534         * object.h, object.c: an array object doesn't allocate an extra
29535         vector. Add mono_array_new_full () to create jagged arrays easily.
29536
29537 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
29538
29539         * metadata.h, metadata.c: add mono_metadata_field_info () to
29540         retreive all the info about a field from vairous tables.
29541         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
29542         * class.h, class.c: augment MonoClassField with more info.
29543         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
29544         policy and load a field's RVA if needed.
29545
29546 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
29547
29548         * class.c (mono_class_metadata_init): create a trampoline for all
29549         virtual functions instead of actually compiling them.
29550
29551 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
29552
29553         * class.h, class.c: include name in MonoClassField.
29554         * class.c: fix fundamental type of System.Object and System.String.
29555         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
29556         tokens in ldtoken.
29557         * icall.c: remove internalcalls for the Reflection stuff that is now
29558         done in C# code.
29559         * loader.c: mono_field_from_memberref () implementation.
29560         * mono-endian.c: thinko (s/struct/union/g).
29561         * object.c, object.h: make the mono_string_* prototypes actually use
29562         MonoString instead of MonoObject.
29563         * reflection.c, reflection.h: updates for changes in the reflection
29564         code in corlib: we use C structures that map to the actual C# classes.
29565         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
29566         fat method header if needed and use the info from the ILGenerator for
29567         methods. Handle fields in types. Misc fixes.
29568
29569 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
29570
29571         * class.c (mono_class_metadata_init): bug fix: always allocate
29572         space for static class data
29573
29574 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
29575
29576         * class.c (mono_compute_relative_numbering): use relative
29577         numbering to support fast runtime type checks.
29578
29579 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
29580
29581         * class.c (mono_class_create_from_typeref): added debugging output
29582         to print class name when MonoDummy is returned instead of real class
29583
29584 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
29585
29586         * class.c (mono_class_metadata_init): interface offset table now
29587         contains pointers into the vtable - this is more efficient for the jit
29588
29589 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
29590
29591         * class.c (mono_class_metadata_init): use a temporary vtable (the
29592         old algorithm only worked for the interpreter, but not for the jit)
29593
29594 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
29595
29596         * loader.c (method_from_memberref): use mono_class_get to get the
29597         class of an array instead of using System.Array directly.
29598         (mono_get_method): also add MEMBERREF methods to the method cache
29599         which usefull for arrays.
29600
29601 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
29602
29603         * pedump.c (arch_compile_method): added to compute vtable entry
29604
29605         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
29606         number of interfaces.
29607         
29608         * class.h: merged MonoArrayClass into MonoClass
29609
29610         * class.c (mono_class_create_from_typedef): compute the vtable size and
29611         allocate space to include the vtable inside MonoClass
29612         (mono_class_metadata_init): initialize the vtable
29613
29614 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
29615
29616         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
29617         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
29618         * image.c: endian fixes by Laurent Rioux.
29619         * object.h, object.c: rename MonoStringObject to MonoString and
29620         MonoArrayObject to MonoArray. Change some function names to conform to
29621         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
29622         guint16* as first argument, so don't use char*.
29623         Provide macros to do the interesting things on arrays in a portable way.
29624         * threads-pthread.c: updates for the API changes and #include <sched.h>
29625         (required for sched_yield()).
29626         * icall.c: updates for the API changes above.
29627         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
29628         platforms that need them.
29629
29630 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
29631
29632         * class.c: set the correct type for all the fundamental
29633         type when loading the class.
29634
29635 2001-10-05  Dick Porter  <dick@ximian.com>
29636
29637         * threads-pthread.c (pthread_mutex_timedlock): Simple
29638         compatibility version for C libraries that lack this call.
29639
29640 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
29641
29642         * class.c: MonoTypes stored in MonoClass are stored as
29643         fundamental MonoTypes when the class represents a
29644         fundamental type (System.Int32, ...).
29645         The TypeHandle return by ldtoken is a MonoType*.
29646         * icall.c: ves_icall_get_data_chunk () write out all the
29647         PE/COFF stuff. Implement ves_icall_define_method (),
29648         ves_icall_set_method_body (), ves_icall_type_from_handle ().
29649         * image.c: properly skip unknown streams.
29650         * loader.h, loader.c: add type_class to mono_defaults.
29651         * metadata.c, metadata.h: export compute_size () as
29652         mono_metadata_compute_size () with a better interface.
29653         Typo and C&P fixes.
29654         * pedump.c: don't try to print the entry point RVA if there is no entry point.
29655         * reflection.c, reflection.h: many cleanups, fixes, output method
29656         signatures and headers, typedef and typeref info, compress the metadata
29657         tables, output all the heap streams, cli header etc.
29658         * row-indexes.h: typo fixes.
29659
29660 2001-10-04  Dick Porter  <dick@ximian.com>
29661
29662         * object.h: Add a synchronisation mutex struct to MonoObject
29663
29664         * object.c (mono_new_object): Initialise the object
29665         synchronisation mutexes
29666
29667         * icall.c: System.Threading.Monitor internal calls
29668         
29669         * threads-pthread.h:
29670         * threads-pthread.c: System.Threading.Monitor internal calls
29671
29672         * threads-types.h: New file, includes the system-specific thread
29673         structures
29674         
29675         * threads-pthread-types.h:
29676         * threads-pthread-types.c: New files, handle pthread-specific
29677         synchronisation types
29678
29679         * threads-dummy-types.h: 
29680         * threads-dummy-types.c: New files of dummy support for
29681         thread-specific types
29682
29683         * metadata.c:
29684         * image.c:
29685         * pedump.c: include mono-endian.h not endian.h
29686         
29687         * Makefile.am: More threads files.
29688         Name mono-endian.h not endian.h
29689
29690 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
29691
29692         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
29693         stuff and implement a few more bits.
29694         * icall.c: a field needs to be dereferenced twice. Do not use the same
29695         name for two variables in the same scope.
29696         * image.c, image.h: cleanups.
29697
29698 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
29699
29700         * class.c (mono_class_metadata_init): bug fix: compute the right size
29701
29702 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
29703
29704         * icall.c: implemented some of the Reflection internalcalls.
29705         * image.c, image.h: start writing out the PE/COFF image.
29706         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
29707         that does the reverse than decode_blob_size ().
29708         * object.c: use mono_metadata_encode_value (). Move here
29709         temporary implementation of mono_string_to_utf8 ().
29710         * rawbuffer.c: make malloc_map static.
29711
29712 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
29713
29714         * metadata.c: fix type comparison for arrays.
29715         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
29716         Added a couple of new classes to monodefaults.
29717         * icall.c: added a couple of Reflection-related internalcalls.
29718         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
29719         Added a byval_arg MonoType to MonoClass.
29720
29721 2001-09-28  Dick Porter  <dick@ximian.com>
29722
29723         * icall.c:
29724         * threads-pthread.h: 
29725         * threads-pthread.c: Implemented internal calls for
29726         LocalDataStoreSlot operations.  Applied mutexes around all shared
29727         data.  Reworked the thread creation and Start() operations to
29728         avoid a race condition.
29729         
29730         * threads-dummy.h:
29731         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
29732
29733 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
29734
29735         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
29736
29737 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
29738
29739         * class.c, loader.c: warn and return NULL instead of erroring out.
29740         * icall.c: added System.AppDomain::getCurDomain().
29741         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
29742
29743 2001-09-25  Dick Porter  <dick@ximian.com>
29744
29745         * threads-pthread.h:
29746         * threads-pthread.c: Implemented timed thread joining and added
29747         System.Threading.Thread::Join_internal internal call
29748
29749         * icall.c: Added System.Threading.Thread::Join_internal internal call
29750
29751         * threads-dummy.h:
29752         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
29753
29754 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
29755
29756         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
29757         mono_string_intern () to implement the semantics of the ldstr opcode
29758         and the interning of System.Strings.
29759         * icall.c: provide hooks to make String::IsIntern and String::Intern
29760         internalcalls.
29761
29762 2001-09-23  Dick Porter  <dick@ximian.com>
29763
29764         * threads-dummy.c: 
29765         * threads-dummy.h: New files of dummy threading routines
29766
29767         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
29768         support code based on system specifics
29769
29770         Rename PTHREAD_LIBS to THREAD_LIBS
29771         
29772 2001-09-23  Dick Porter  <dick@ximian.com>
29773
29774         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
29775         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
29776         internal calls.
29777         (mono_thread_init): Set up a Thread object instance to return when
29778         the main thread calls Thread.CurrentThread
29779         (mono_thread_cleanup): Wait for all subthreads to exit
29780
29781         * icall.c: New internal calls for System.Threading.Thread::Sleep
29782         (including Schedule) and CurrentThread
29783
29784         * threads.h: New file, to insulate thread-specific stuff from the
29785         rest of the code
29786
29787 2001-09-21  Dick Porter  <dick@ximian.com>
29788
29789         * threads-pthread.h: 
29790         * threads-pthread.c: New file, for handling pthreads-style
29791         threading support.  Start() now starts a new thread and executes
29792         the ThreadStart delegate instance.
29793
29794         * icall.c: Added the internalcall for
29795         System.Threading.Thread::Start_internal
29796
29797         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
29798
29799 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
29800
29801         * loader.c: work around the different signatures for delegates
29802         constructors csc generates in compiled code vs the ones compiled in mscorlib.
29803
29804 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
29805
29806         * class.h, class.c: add mono_class_get_field_from_name ().
29807         * *: Fix C comments and other ANSI C issues.
29808
29809 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
29810
29811         * endian.h, assembly.c: fix some endianness issues.
29812
29813 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
29814
29815         * loader.h, load.c: add delegate_class to mono_defaults.
29816         Handle runtime provided methods in mono_get_method ().
29817
29818 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
29819
29820         * loader.c (mono_get_method): use pinvoke for internal call
29821
29822         * icall.c: use pinvoke for internal call
29823
29824         * loader.c (method_from_memberref): set the method name
29825
29826 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
29827
29828         * metadata.c: help the compiler generate better code for
29829         mono_class_from_mono_type ().
29830
29831 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
29832
29833         * class.c (mono_class_metadata_init): delayed computing of the
29834         class size to mono_class_metadata_init ()
29835
29836 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
29837
29838         * class.c, class.h: add an interfaces member to MonoClass.
29839         * image.c, image.h: add assembly_name field to MonoImage
29840         from the assembly table.
29841         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
29842
29843 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
29844
29845         * class.c: Handle Array in mono_class_from_mono_type ().
29846         * metadata.c, pedump.c: some endian fixes.
29847
29848 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
29849
29850         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
29851         * metadata.c: fix small problem introduced with the latest commit.
29852
29853 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
29854
29855         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
29856         We don't need a MonoMetadata pointer anymore to compare signatures in
29857         mono_metadata_signature_equal (), update callers.
29858         Reduced memory usage an number of allocations for MonoMethodHeader and
29859         MonoMethodSignature.
29860
29861 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
29862
29863         * metadata.c: added compare for szarray.
29864
29865 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
29866
29867         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
29868         and add a couple more types to it and mono_defaults. Give an hint on
29869         classes that need implementing in our corlib and are referenced
29870         in mscorlib.
29871
29872 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
29873
29874         * class.h, class.c: keep track if a class is also an Enum.
29875         * loader.c: Implement a couple more types for use in libffi
29876         marshalling. Gives better diagnostics when failing to dlopen
29877         a library. Set method->klass for P/Invoke methods, too.
29878
29879 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
29880
29881         * class.c, class.h: add a MonoType this_arg to MonoClass that
29882         represents a pointer to an object of the class' type that
29883         can be used by the interpreter and later the type cache.
29884         Add best guess alignment info for valuetype objects.
29885
29886 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
29887
29888         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
29889         into MonoType: one less level of indirection and allocation and
29890         simplifies quite a bit of code. Added cache for MonoTypes that are
29891         used frequently, so that we don't need to allocate them all the time.
29892
29893 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
29894
29895         * class.c (mono_class_create_from_typedef): System.Enum is also a
29896         value type, although it does not derive from System.ValueType
29897         (maybe a bug in the ms compiler?)
29898
29899         * metadata.c (mono_type_size): return the right size for value types
29900
29901         * loader.c (mono_get_method): only initialize method header if not abstract
29902
29903         * class.c (mono_class_from_mono_type): use mono_default values. 
29904
29905 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
29906
29907         * *: use MonoClass pointers instead of <type_tokens>
29908         
29909         * class.h: new flag: metadata_inited.
29910
29911         * class.c (mono_class_metadata_init): impl.
29912         (mono_class_instance_size): impl.
29913         (mono_class_data_size): impl.
29914
29915 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
29916
29917         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
29918         MonoClass now has the name and name_space fields. 
29919         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
29920         mono_get_method () takes and optional MonoClass as argument.
29921         Removed mono_typedef_from_name() and added mono_class_token_from_name()
29922         instead that takes advantage of a map from class names to typedef
29923         tokens in MonoImage.
29924
29925 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
29926
29927         * metadata.c: zero is not a valid alignment boundary.
29928         Merge MONO_TYPE_VOID in default decoding code.
29929
29930 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
29931
29932         * image.h: merged MonoMetadata into MonoImage
29933
29934         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
29935         identify the type of elements.
29936
29937 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
29938
29939         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
29940         * cil-coff.h: split MonoMSDOSHeader and add size info.
29941         * image.c: add some consistency checks.
29942         * metadata.c: fix row size computation: one programmer
29943         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
29944         add explanation for the locator routine.
29945         Fix decoding of size in method header.
29946         
29947 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
29948
29949         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
29950         (g_concat_dir_and_file): Bring g_concat_dir_and_file
29951         function from gnome-libs.  This uses the right path separator
29952         based on the OS, and also works around a bug in some systems where
29953         a double slash is not allowed. 
29954         (default_assembly_name_resolver): Use g_concat_dir_and_file
29955         (mono_assembly_open): ditto.
29956
29957 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
29958
29959         * metadata.c (mono_metadata_signature_equal): impl.
29960
29961         * *: void is now a realy MonoType (instead of using NULL)
29962         
29963         * metadata.c (do_mono_metadata_parse_type): use
29964         mono_metadata_parse_type to parse void value.
29965
29966 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
29967
29968         * metadata.c, metadata.h: in the signature and method header store
29969         only the space required for holding the loca vars and incoming arguments.
29970
29971 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
29972
29973         * metadata.c (do_mono_metadata_parse_type): treat void like any
29974         other type (instead of assigning NULL);
29975
29976 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
29977
29978         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
29979
29980 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
29981
29982         * image.c (do_mono_image_open): added a cache for arrays.
29983
29984 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
29985
29986         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
29987         decode a single column from a row in a metadata table and changes
29988         to take advantage of it in the typedef locator (gives a nice speed up).
29989         Store offset info for function params.
29990
29991 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
29992
29993         * image.h (MONO_IMAGE_IS_CORLIB): removed 
29994
29995 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
29996
29997         * assembly.c: how could mono_assembly_close () had ever worked?
29998         * metadata.c, metadata.h: provide offset info for local vars.
29999         Implement mono_type_size () to take care of alignment as well
30000         as size (it was mono_field_type_size in cli/class.c before).
30001
30002 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
30003
30004         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
30005
30006         * assembly.h (CORLIB_NAME): set to corlib.dll
30007
30008         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
30009
30010 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
30011
30012         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
30013         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
30014         tokentype.h: massive namespace cleanup.
30015
30016 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
30017
30018         * metadata.h, metadata.c: decode exception clauses when parsing method header.
30019
30020 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
30021
30022         * metadata.c (mono_metadata_free_type): added check for type !=
30023         NULL (void) before calling mono_metadata_free_type()
30024
30025 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
30026
30027         * metadata.h, row_indexes.h: added header with enumerations to use
30028         to index in the columns from tables in metadata and to decode coded
30029         tokens: we should start using this instead of embedding magic numbers
30030         all over the code.
30031
30032 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
30033
30034         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
30035         Move metadata_t info from cli_image_info_t to MonoImage, where
30036         it's easily accessible. Changed all the uses accordingly.
30037         Added the method and class caches to MonoImage.
30038         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
30039         and mono_metadata_decode_value () signature to be more consistent
30040         with the other parse functions (and simplify code). Taken advantage
30041         of zero-length array allocation with GCC. Removed reduntant (and
30042         wrong) MonoFieldType struct and use MonoParam instead. Changed
30043         mono_metadata_parse_field_type () to use common code for parsing.
30044         Added mono_metadata_typedef_from_field () and
30045         mono_metadata_typedef_from_method () to lookup a typedef index from a
30046         field or method token.
30047         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
30048
30049 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
30050
30051         * metadata.c (mono_metadata_parse_field_type): Implement. 
30052         (do_mono_metadata_parse_type): Split engine from
30053         mono_metadata_parse_type, so that we can create smaller structures
30054         for things that just have one pointer to the MonoType (look at
30055         the MonoFieldType)
30056
30057 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
30058
30059         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
30060         as Jan Gray found out, it is incorrect. 
30061
30062 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
30063
30064         * assembly.c: Implement asssembly loading.  This loads an image
30065         and loads all the referenced assemblies.  Come to think of it, we
30066         could always do lazy loading of the assemblies. 
30067
30068         * image.c (mono_image_open): Keep loaded images in a hashtable.
30069
30070         * image.h (MonoImage): Add reference count.
30071
30072 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
30073
30074         * assembly.c (mono_assembly_open): Keep track of the file name in
30075         case the assembly has no ASSEMBLY table.
30076
30077         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
30078         from get.c here.
30079
30080 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
30081
30082         * metadata.c, metadata.h: decode local vars in method header
30083         parse function. Change callers accordingly.
30084
30085 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
30086
30087         * metadata.h, cil-coff.h: protect against multiple inclusion.
30088         Added some new structures to hold information decoded from metadata:
30089         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
30090         and relevant decoding/free functions.
30091         * metadata.c: implement decoding functions. Add warning for out of bounds
30092         index in mono_metadata_locate(). Implement mono_get_method () to retreive
30093         all the info about a method signature and invocation. Remove check on
30094         uninitialized local var in parse_mh() and fix memory leak.
30095
30096 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
30097
30098         * metadata.h: More macros.
30099
30100         * tokentype.h: New file.
30101
30102 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
30103
30104         * assembly.c: added a consistency check and initialize
30105         some structures with g_new0().
30106         * metadata.c: fixed a couple more bugs in table size computation
30107         and add other checks for out-of bound access to metadata.
30108
30109 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
30110
30111         * metatada.c: fix bugs computing table sizes. Spew a
30112         warning when index in string heap is out of bounds.
30113
30114 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
30115
30116         * metadata.h: Add a couple of macros to manipulate tokens. 
30117
30118 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
30119
30120         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
30121         cli_section_tables).
30122
30123 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
30124
30125         * metadata.c (mono_metadata_user_string): New function, provides
30126         access to the UserString heap. 
30127
30128 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
30129
30130         * metadata.c: Add inline documentation.
30131
30132 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
30133
30134         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
30135         files. 
30136
30137 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
30138
30139         * typeattr.h: New file, TypeAttribute flags. 
30140
30141 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
30142
30143         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
30144         mono_assembly_ensure_section): Section loading code.
30145         (load_section_tables): Load the sections.
30146
30147         * mono/metadata/metadata.c (mono_metadata_locate_token,
30148         mono_metadata_locate): Functions to locate the information
30149         definition given a token or a table and an index.
30150         (mono_metadata_compute_table_bases): New.
30151         (compute_size): New function to compute the sizes of the various
30152         tables.
30153
30154         * mono/metadata/metadata.h: Finish listing the different index
30155         types. 
30156
30157         * mono/metadata/pedump.c: Improve to dump new information.
30158
30159 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
30160
30161         * mono/metadata/metadata.c: Entered all the tables matching
30162         Beta2. 
30163
30164         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
30165
30166
30167
30168