* Makefile.am: Build `docs` after `runtime`, so that it can depend
[mono.git] / mono / metadata / ChangeLog
1 2008-10-30  Mark Probst  <mark.probst@gmail.com>
2
3         * monitor.c (mono_monitor_get_fast_enter_method): If
4         CompareExchange is not available, don't create the fastpath
5         instead of asserting.  (The method is missing in the 1.1 profile.)
6
7 2008-10-30  Mark Probst  <mark.probst@gmail.com>
8
9         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
10
11         * monitor.c, monitor.h: Code for generating Monitor.Enter and
12         Monitor.Exit IL fastpaths.
13
14 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
15
16         * class.c (mono_class_create_from_typedef): Added Vector2ul.
17
18 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
19
20         * class.c (mono_class_create_from_typedef): Added Vector2l.
21
22 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
23
24         * class.c (mono_class_create_from_typedef): Added Vector2d.
25
26 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
27
28         * appdomain.c: translate \ into / for cache_path.
29         * domain-internals.h: new mono_is_shadow_copy_enabled().
30         * icall.c: (fill_reflection_assembly_name) do the same path
31         manipulations that get_code_base does.
32         (get_code_base) use mono_is_shadow_copy_enabled.
33
34 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
35
36         * appdomain.c: shadow-copied assemblies go to CachePath +
37         ApplicationName when both are set. DynamicBase has nothing to do with
38         shadow copies.
39         Bug #406877 fixed.
40
41 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
42
43         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
44         STANDALONESIG table.
45
46         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
47         standalone signatures.
48
49         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
50         comparison code: instead of comparing the signatures using a custom
51         equals function, transform them to a common signature and compare that. This
52         works better with AOT.
53
54 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
55
56         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
57
58         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
59         call for generic instances.
60         (mono_class_setup_properties): Call setup_properties () before accessing
61         gklass->properties.
62
63         * class.c (mono_class_get_virtual_methods): New helper function to iterate
64         over the virtual methods of a class using metadata if possible, avoiding the
65         creation of MonoMethod's for non-virtual methods.
66         
67         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
68         get_virtual_methods () to iterate over the virtual methods of classes.
69
70 2008-10-25  Martin Baulig  <martin@ximian.com>
71
72         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
73
74 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
75
76         * class.c (mono_class_create_from_typedef): Added Vector4i.
77
78 2008-10-24  Mark Probst  <mark.probst@gmail.com>
79
80         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
81         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
82         special-casing applies to eliminate the call completely.
83
84 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
85
86         * class.c (mono_class_create_from_typedef): Added Vector8s.
87
88 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
89
90         * class.c (mono_class_create_from_typedef): Added Vector16sb.
91
92 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
93
94         * icall.c: get rid of annoying warning.
95
96 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
97
98         * threadpool.c: in 1.x, if you change the background status of the
99         threadpool thread, it's not reset.
100         Remove unnecessary calls to SetState.
101
102 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
103
104         * threadpool.c: asynchronously create a set of idle threads upon first
105         use of the threadpool. SetMinThreads will now start the appropriate
106         number of idle threads if they are not already running. The default is
107         1 threadpool thread per CPU. Increased the maximum number of threads
108         per CPU to 10.
109
110 2008-10-22  Martin Baulig  <martin@ximian.com>
111
112         Revert r116521 from Zoltan, it breaks the debugger:
113
114         * class.c (mono_class_get_virtual_methods): New helper function to iterate
115         over the virtual methods of a class using metadata if possible, avoiding the
116         creation of MonoMethod's for non-virtual methods.
117         
118         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
119         get_virtual_methods () to iterate over the virtual methods of classes.
120
121 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
122
123         * threads.c: when creating a threadpool thread, set its state to
124         'background'.
125         * threadpool.c: reset the background state of a threadpool thread
126         after finishing each work item
127         Bug #437888 fixed.
128
129 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
130
131         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
132         
133         * class.c (mono_class_setup_vtable_general): Add an optimized version for
134         generic instances which works by inflating the methods in the container
135         class's vtable.
136
137         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
138         variant which doesn't make a copy if no inflation was done.
139         (mono_class_setup_fields): Use it.
140
141         * metadata.c (mono_metadata_get_shared_type): New helper function to
142         return a shared instance of a given MonoType.
143
144         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
145         a copy of most non-generic types.
146
147 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
148
149         * threadpool.c: remove one more GetSystemInfo () call.
150
151 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
152
153         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
154         use the code in mono-proclib.h to get processor information.
155
156 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
157
158         * appdomain.c: fixed the logic that determines whether assemblies in a
159         directory are "shadow-copied" or not. Bug #433483 fixed.
160
161 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
162
163         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
164         warning.
165
166 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
167
168         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
169         returning a vtype.
170
171         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
172         reflection.c: Use mono_field_get_name () for accessing a field's name.
173
174         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
175         class.c
176
177         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
178         field.
179
180         * loader.c (find_method_in_class): Reenable the metadata optimization by
181         not using it for generic instances.
182
183         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
184         data/def_type fields from MonoClassField into a separate structure.
185         (struct MonoClassField): Remove data/def_type fields.
186         (struct _MonoClass): Add a 'field_def_values' array to store the default
187         values/RVA for fields.
188
189         * class.c reflection.c: Update after the changes.
190         
191         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
192         for accessing field->data.
193
194         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
195
196         * loader.c (find_method_in_class): Revert the last change for now as
197         it breaks Mono.C5 unit tests.
198
199         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
200         'field_generic_types' and 'field_objects' which contain the information
201         previously stored in MonoInflatedField.
202         (MonoInflatedField): Delete.
203         (struct _MonoClassField): Delete 'generic_info' field.
204
205         * reflection.c: Store the information which was previously in 
206         field->generic_info in MonoDynamicGenericClass instead.
207
208         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
209         MonoClassField changes.
210
211 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
212
213         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
214         store the value inside the data array of the MonoMethodWrapper.
215         This saves memory, is faster and fixes the lifetime issues (methods
216         were never removed from the hash previously). May also fix bug#436996.
217
218 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
219
220         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
221         generic instances, compute the type from the generic definition instead of
222         looking in field->generic_info.
223
224         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
225         for inflated fields, the only user was get_fieldref_token () which no
226         longer needs it.
227
228         * class.c (mono_class_init): Revert the last change as it seems to cause
229         crashes.
230
231         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
232         bytes on 64 bit platforms.
233
234         * object.c (mono_class_create_runtime_vtable): Fix a warning.
235         
236         * object.c (mono_class_create_runtime_vtable): Don't initalize
237         field->data/field->def_type here, it is done lazily by 
238         mono_class_get_field_default_value ().
239
240         * icall.c (ves_icall_get_enum_info): Call 
241         mono_class_get_field_default_value () instead of directly accessing
242         field->data and field->def_type.
243
244         * object.c (get_default_field_value): Ditto.
245
246         * class.c (mono_field_get_data): Ditto.
247         
248         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
249         call for generic instances.
250
251         * loader.c (find_method_in_class): If klass != from_class, then inflate
252         the method with the context of from_class, since the caller assumes this.
253
254 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
255
256         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
257         for accessing method->slot.
258
259 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
260
261         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
262
263 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
264
265         * class.c (mono_method_get_vtable_index): Use
266         mono_method_get_vtable_slot () for accessing method->slot.
267
268         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
269         accessing klass->methods.
270
271         * class.c (mono_method_get_vtable_slot): New helper function.
272         (mono_class_get_vtable_entry): Ditto.
273         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
274         accessing method->slot.
275
276         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
277         method to get_inflated_method ().
278
279         * class.c (mono_class_get_inflated_method): New helper method to obtain
280         a method of an inflated class without calling setup_methods ().
281         (mono_class_get_cctor): Use get_inflated_method.
282
283         * generic-sharing.c (mono_class_get_method_generic): Ditto.
284         
285         * marshal.c image.c: Lazily create all the marshal caches.
286
287         * image.c (mono_image_init): Move initialization of runtime_invoke
288         caches to marshal.c.
289
290         * marshal.c (get_cache): New helper function to lazily initialize a 
291         wrapper cache.
292         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
293
294         * debug-helpers.c (mono_method_full_name): Include generic arguments.
295
296 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
297
298         * loader.c: fixed check for interface type.
299
300 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
301
302         * appdomain.c: check for NULL setup before it's referenced.
303
304 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
305
306         * class.c: remove the unused old vtable setup code.
307
308 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
309
310         * class.c: don't depend on interface order in
311         setup_interface_offsets (bug #435777).
312         * reflection.c: sort the InterfaceImpl table (patch from
313         Jb Evain  <jbevain@novell.com>).
314
315 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
316
317         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
318         the low level assemblies lock.
319
320 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
321
322         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
323         object.c, reflection.c, socket-io.c, threads.c: introduced
324         mono_framework_version () to return the major framewrok version,
325         changed the code that was using more complex patterns to use it.
326         Return the correct value for PlatformID for OSX.
327
328 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
329
330         * icall-def.h, process.h, process.c: added an icall to get info about
331         processes using mono-proclib.
332
333 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
334
335         * mono-perfcounters.c: use the mono-proclib functions to
336         access process information.
337
338 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
339
340         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
341         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
342         reflection.c: remove rawbuffer usage: mmap support is more sanely
343         provided by utils/mono-mmap.
344
345 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
346
347         * gc.c: use posix semaphores when possible so that
348         mono_gc_finalize_notify() is signal safe.
349
350 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
351
352         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
353         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
354         be #ifdef-ed out, the linker will remove the rest.
355
356         * marshal.c: Implement DISABLE_COM.
357
358         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
359
360 2008-10-11  Miguel de Icaza  <miguel@novell.com>
361
362         * locales.c (string_invariant_compare_char): Optimization: do not
363         call g_unichar_type unless we actually need the information.
364
365 2008-10-10  Mark Probst  <mark.probst@gmail.com>
366
367         * object.c, class-internals.h: Also create remoting trampolines
368         for generic methods.  Pass the domain to the remoting trampoline
369         creation function, too.
370
371 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
372
373         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
374
375 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
376
377         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
378         Vector4ui.
379
380 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
381
382         * assembly.c:
383         * locales.c: remove the use of g_strdown. Fixes bug #322313.
384
385 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
386
387         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
388         for the least possible amount of time (extending the fix in r113458).
389
390 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
391
392         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
393
394 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
395
396         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
397         as possible simd intrinsic types.
398         Optimized the test to check for the common prefix first.
399
400 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
401
402         * class.c: back out part of a broken optimization committed on
403         May 23th (bug #433908).
404
405 2008-10-09  Mark Probst  <mark.probst@gmail.com>
406
407         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
408         Win32.  Should fix #432388 for most cases until we have the new
409         profiler on Win32.
410
411 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
412
413         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
414         instead of using inst->id so the hash is stable for AOT.
415
416 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
417
418         * appdomain.c:
419         * icall.c: create a .ini file for shadow-copied assemblies that
420         contains the location of the original assembly. Use this to return the
421         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
422         Also fix the number of '/' for windows when returning the CodeBase.
423         Fixes bug #430920.
424
425 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
426
427         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
428
429         Code is contributed under MIT/X11 license.
430
431 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
432
433         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
434           if if the class vtable needs initialized.
435
436         Code is contributed under MIT/X11 license.
437
438 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
439
440         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
441           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
442           STRING->BSTR, and CLASS->INTERFACE.
443
444         Code is contributed under MIT/X11 license.
445
446 2008-10-07  Marek Habersack  <mhabersack@novell.com>
447
448         * sysmath.h: changed the declaration of the
449         ves_icall_System_Math_Round2 icall by adding an extra
450         away_from_zero parameter.
451
452         * sysmath.c (ves_icall_System_Math_Round2): added support for
453         away from zero rounding. The icall now takes an extra boolean
454         parameter to signal that away from zero operation is requested.
455
456 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
457
458         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
459         the delegate klass so it can work with full-aot.
460         (mono_marshal_get_delegate_end_invoke): Ditto.
461         (mono_marshal_get_delegate_invoke): Ditto.
462
463 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
464
465         * gc.c, attach.h, attach.c: remove a bad pattern:
466         add_finalizer_callback () is not implemented correctly, it can't
467         without adding more overhead to the finalizer loop and it's not
468         even needed, since we know exactly what we need to call, so there is
469         no need to do so through an expensive function pointer.
470
471 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
472
473         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
474         for the no-gc case.
475         * attach.c (mono_attach_init): Remove the #ifdef.
476
477 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
478
479         * attach.c (mono_attach_init): Don't use
480         mono_gc_add_finalizer_thread_callback when compiling without GC.
481         Fixes #432306.
482         
483         Code is contributed under MIT/X11 license.
484
485 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
486
487         * class.c (mono_class_create_from_typedef): Remove the 
488         #ifndef DISABLE_SIMD stuff.
489
490 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
491
492         * class-internals.h (MonoClass): Added simd_type bit field.
493
494         * class.c (mono_class_create_from_typedef): Check if type is a simd
495         intrinsic.
496
497 2008-10-03  Mark Probst  <mark.probst@gmail.com>
498
499         * object.c (mono_method_add_generic_virtual_invocation): Only add
500         instantiations to the thunk whose count is at least as large as
501         the threshold.
502
503 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
504
505         * icall.c: changed the Type of the exception thrown when trying to
506         invoke a constructor on an abstract class. Part of the fix for bug
507         #324185.
508
509 2008-10-02  Mark Probst  <mark.probst@gmail.com>
510
511         * class.c, class-internals.h (mono_method_get_vtable_index): New
512         function which returns the index into the vtable and properly
513         handles inflated virtual generic methods.
514
515 2008-10-01  Mark Probst  <mark.probst@gmail.com>
516
517         * object.c, domain.c, object-internals.h, domain-internals.h:
518         Generalize IMT thunk machinery to also handle thunks for virtual
519         generic method invokes.  When a virtual generic method is invoked
520         more than a number of times we insert it into the thunk so that it
521         can be called without lookup in unmanaged code.
522
523         * generic-sharing.c, class-internals.h: Fetching a
524         MonoGenericInst* for a method from an (M)RGCTX.
525
526 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
527
528         * marshal.c (emit_marshal_string): Applied a variant of a patch by
529         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
530         marshalling. Fixes #431304.
531
532 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
533
534         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
535           handle when ref is specified without In or Out.
536
537         Code is contributed under MIT/X11 license.
538
539 2008-09-30  Mark Probst  <mark.probst@gmail.com>
540
541         * loader.c (mono_get_method_constrained): Don't expand method with
542         the class's context, because it's already a method of that class.
543
544 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
545
546         * attach.c : should be correct build fix.
547
548 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
549
550         * attach.c: Fix the previous change.
551
552 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
553
554         * attach.c : quick w32 build fix.
555
556 2008-09-27  Miguel de Icaza  <miguel@novell.com>
557
558         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
559         crashes MonoDevelop: #430455.
560
561 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
562
563         * domain-internals.h (struct _MonoDomain): Move most fields used only by
564         the JIT do MonoJitDomainInfo in ../mini/mini.h.
565
566         * domain.c: Remove initialization/cleanup of the removed fields.
567
568 2008-09-27  Mark Probst  <mark.probst@gmail.com>
569
570         * class.c (mono_class_generic_sharing_enabled): Enable generic
571         code sharing for PPC.
572
573 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
574
575         * attach.c : Fixing the Windows builds.
576
577         Code is contributed under MIT/X11 license.
578
579 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
580
581         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
582         the default generic sharing mode to 'all'.
583
584 2008-09-25  Mark Probst  <mark.probst@gmail.com>
585
586         * generic-sharing.c, class-internals.h: New function for checking
587         whether a method needs a static RGCTX invoke wrapper.  A few
588         funtions moved from mini/generic-sharing.c.
589
590         * icall.c: New function used.
591
592 2008-09-25  Mark Probst  <mark.probst@gmail.com>
593
594         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
595         Static RGCTX invoke wrapping applies to value type methods, too.
596
597         * class.c (mono_class_setup_vtable_general): In generic-shared
598         value types, wrap methods with a static RGCTX invoke wrapper.
599
600 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
601
602         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
603         osx build.
604
605 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
606
607         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
608         register a callback which is called when the finalizer thread is woken
609         up.
610         (finalizer_thread): Call the callback if it exists.
611
612         * attach.h attach.c: New files, implementing the attach mechanism.
613
614         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
615         
616         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
617         by the previous change.
618
619 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
620
621         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
622         loader.c, marshal.c, metadata-internals.h, metadata.c,
623         method-builder.c, object.c, reflection.c: introduced specific functions
624         to allocate from the domain and image mempools and cleaned up most of
625         the code to use them (still missing a few in reflection.c).
626         Keep the loader bytes counter updated.
627
628 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
629
630         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
631         loader-related counters.
632
633 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
634
635         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
636         added more MS-compatible counters.
637
638 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
639
640         * class.c (mono_class_setup_fields): Call setup_fields before accessing
641         class->blittable. Fixes #428217.
642
643 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
644
645         * reflection.c (mono_image_get_field_on_inst_token): Call 
646         field_encode_signature () since that handles custom modifiers too.
647         Fixes #424663.
648
649 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
650
651         * reflection.c (add_custom_modifiers): New helper function to merge custom
652         modifiers stored in objects to a MonoType.
653         (fieldref_encode_signature): Encode custom modifiers.
654         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
655         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
656
657 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
658
659         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
660         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
661         64-bit IL only images because imports are not resolved for IL only images.
662         Special thanks to Bill Holmes for finding this bug and testing the patch.
663         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
664
665         Contributed under MIT/X11 license.
666
667 2008-09-19  Miguel de Icaza  <miguel@novell.com>
668
669         * mono-config.c (dllmap_start): Add support for the bits keyword
670         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
671
672 2008-09-19  Mark Probst  <mark.probst@gmail.com>
673
674         * reflection.c (inflate_mono_method): When the class the method is
675         to be inflated for is itself not inflated, just return the method.
676
677 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
678
679         * mono-perfcounters.c: use more user friendly process instance names.
680
681 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
682
683         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
684           handle "[in] ref" and "[in][out] ref" cases.
685
686         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
687           to mono_mb_create_method.  This was causing problems calling native to
688           managed passing Variants by value.
689
690         Code is contributed under MIT/X11 license.
691
692 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
693
694         * class.c (can_access_internals): Call mono_assembly_load_friends ()
695         before accessing the friend_assembly_names field.
696
697         * assembly.c (mono_assembly_load_friends): Make this callable multiple
698         times.
699         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
700         called lazily when it is needed.
701
702         * metadata-internals.h (struct _MonoAssembly): Add 
703         'friend_assembly_names_inited' flag.
704
705 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
706
707         * mono-perfcounters-def.h: fix the types of a few counters.
708         * mono-perfcounters.c: implemented the instance names getter
709         and a few bugfixes.
710
711 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
712
713         * culture-info-table.h : regenerated.
714
715 2008-09-17  Robert Jordan  <robertj@gmx.net>
716
717         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
718         context bound objects. Fixes #415577.
719
720         Code is contributed under MIT/X11 license.
721
722 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
723
724         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
725         implementation (bug #423582).
726
727 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
728
729         * object.c (mono_object_get_virtual_method): Handle the case method->slot
730         is not set. Fixes #426309.
731
732 2008-09-16  Jb Evain  <jbevain@novell.com>
733
734         * class.c (mono_class_from_name): fix the exported type look up
735         when the type is defined in a referenced assembly.
736
737 2008-09-16  Jb Evain  <jbevain@novell.com>
738
739         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
740         increment the next index counter on each iteration to make that work
741         for more than one type forwarder. Unmanaged part to fix #422929.
742
743 2008-09-15  Mark Probst  <mark.probst@gmail.com>
744
745         * object-internals.h: enum ComInterfaceType in
746         MonoInterfaceTypeAttribute is guint32, not guint16.
747
748 2008-09-12  Mark Probst  <mark.probst@gmail.com>
749
750         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
751         writing code.
752
753 2008-09-11  Mark Probst  <mark.probst@gmail.com>
754
755         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
756         not gboolean.
757
758 2008-09-11  Mark Probst  <mark.probst@gmail.com>
759
760         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
761         Endianness fixes for MonoSymbolFileOffsetTable.
762
763 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
764
765         * process.c (complete_path) : Removing quotes from the 
766           input path.  The glib file routines do not handle file paths
767           that have quotes around them.
768
769         Code is contributed under MIT/X11 license.
770
771 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
772
773         * socket-io.h : Adding a comment to provide locations where 
774           changes to MonoSocketAsyncResult need to be synced.
775
776         Code is contributed under MIT/X11 license.
777
778 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
779
780         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
781         parameters as well. Fixes #425001.
782
783 2008-09-08  Miguel de Icaza  <miguel@novell.com>
784
785         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
786         windows build.
787
788 2008-09-07  Miguel de Icaza  <miguel@novell.com>
789
790         * console-io.c: Add support for tracking the window size if it
791         changes.
792
793         The setup is very simple: the TtySetup function will now return a
794         pointer to a location in memory that tracks the current console
795         size.  The managed code checks its current value every time its
796         queried against the last value set, and updates accordingly.
797
798         With this setup we can work with multiple consoles, and we do not
799         require to poke into managed code from a signal handler.
800
801         Additionally, the environment for COLUMNS and LINES is now handled
802         in unmanaged code.
803
804         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
805
806 2008-09-07  Mark Probst  <mark.probst@gmail.com>
807
808         * marshal.c (mono_type_native_stack_size): Treat
809         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
810
811 2008-09-04  Jb Evain  <jbevain@novell.com>
812
813         * class.c (mono_class_is_assignable_from): fix assignability of nullables
814         to nullables.
815
816 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
817
818         * verify.c (verify_type_compatibility_full): Revert change
819         to allow converting a native int to unmanaged pointer be verifiable
820         under non-strict mode.
821         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
822
823         * verify.c: Added some TODOs.
824
825 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
826
827         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
828           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
829           Changed to use GlobalAlloc for the memory returned on Windows platforms.
830
831         Code is contributed under MIT/X11 license.
832
833 2008-09-02  Jb Evain  <jbevain@novell.com>
834
835         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
836
837 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
838
839         reflection.c (typebuilder_setup_fields): Handle classes with
840         explicit size.
841
842 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
843
844         class.c (mono_class_setup_events): Add memory barrier due to
845         double checked locking.
846         
847         class.c (mono_class_setup_properties): Same.
848
849 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
850
851         * class.c (mono_class_is_assignable_from): Fix the build.
852         
853         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
854         before accessing klass->interface_bitmap. Fixes #421744.
855
856 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
857
858         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
859         the runtime into no-exec mode, useful when running the AOT compiler.
860
861         * appdomain.c gc.c object.c: Avoid executing managed code when running
862         in no-exec mode.
863         
864         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
865
866         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
867         special case when the mono_assembly_loaded () returns NULL because the 
868         search hook is not installed.
869
870 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
871
872         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
873         crashes in bstr marshalling on linux.
874
875 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
876
877         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
878         with more than one parameter.
879
880 2008-08-24  Miguel de Icaza  <miguel@novell.com>
881
882         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
883         start/stop flow control as well when turning off ICANON (allows
884         C-s and C-q to be read by Console.ReadKey).
885
886 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
887
888         * class.c (mono_class_init): Move the initialization of nested classes
889         into mono_class_get_nested_types (). Fixes #418433.
890
891         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
892         flag.
893
894         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
895         iterating tough the nested classes of a class.
896
897 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
898
899         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
900         on arm.
901
902 2008-08-22  Miguel de Icaza  <miguel@novell.com>
903
904         * console-io.c (sigcont_handler): Support signal chaining for
905         SIGCONT.
906
907         (console_set_signal_handlers): Use best practices with sigaction,
908         clear the structure before using it. 
909
910 2008-08-22  Robert Jordan  <robertj@gmx.net>
911
912         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
913         Fix the Windows build.
914
915 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
916
917         * class.c (mono_class_generic_sharing_enabled): Make the default
918         sharing mode 'corlib'.
919
920 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
921
922         * console-io.c (console_set_signal_handlers): Fix a warning.
923
924         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
925         method normally, the JIT will take care of avoiding recursion.
926
927 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
928
929         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
930
931         Code is contributed under MIT/X11 license.
932
933 2008-08-20  Miguel de Icaza  <miguel@novell.com>
934
935         * console-io.c (sigcont_handler): We need to restore the entire
936         termios state, not only the original settings, as things like echo
937         can be controlled after this (Booish exposes this issue with its
938         own ReadLine implementation).
939
940         Additionally, we need to set the terminal back into keypad_xmit
941         mode.
942         
943         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
944         string as a paramter as well.   Otherwise we get different
945         keyboard sequences.
946
947 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
948
949         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
950         delegates with byref out parameter passing. Fixes #351520.
951
952         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
953         a generic context.
954         (mono_type_get_desc): Add the type arguments for GENERICINST.
955         (mono_method_full_name): Stringify the class name using mono_type_full_name
956         so it picks up generic arguments.
957
958 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
959
960         * console-io.c: Removed debug output.
961
962 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
963
964         reflection.c (mono_reflection_create_runtime_class): Alloc
965         the nested classes linked list using the dynamic image mempool.
966         Fixes leak in corlib compilation.
967
968 2008-08-19  Miguel de Icaza  <miguel@novell.com>
969
970         * console-io.c: Fix incredibly annoying behavior on the console
971         after resuming execution after control-z.   This affected every
972         console application.
973
974 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
975
976         * mempool-internals.h: Header for mono private mempool functions. The first
977         two function are for allocating glib linked lists using pools.
978
979         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
980
981         * Makefile.am: Added mempool-internals.h.
982
983 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
984
985         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
986         (mono_domain_free): Ditto.
987
988         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
989         be used by the JIT to store its domain-specific information, instead of putting
990         it directly into MonoDomain.
991
992         * domain.c (mono_install_create_domain_hook): New helper function to install
993         a hook which initializes domain->runtime_info.
994
995         * domain.c (mono_install_free_domain_hook): Ditto.
996         
997 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
998
999         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
1000         asserting if the ares parameter is null.
1001
1002         * mono-perfcounters.c: Fix warnings.
1003
1004         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
1005         is not needed, don't check for interruptions either.
1006         (mono_marshal_get_delegate_end_invoke): Ditto.
1007
1008 2008-08-15  Marek Habersack  <mhabersack@novell.com>
1009
1010         * mono-perfcounters.c (predef_readonly_counter): added support for
1011         reading the ASP.NET Requests Queued counter from another process.
1012
1013 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
1014
1015         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
1016         MonoImage to simplify the AOT code.
1017
1018 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
1019
1020         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
1021         marshalling. Fixes #416078.
1022
1023 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
1024         
1025         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
1026         it is set, looking up the icall address is deferred to the JIT, since 
1027         in embedded scenarios, the icall might not be registered in the runtime
1028         doing the AOT compilation. Backported from the 2.0 branch.
1029
1030 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
1031
1032         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
1033         Fixes #415621.
1034
1035 2008-08-05  Marek Habersack  <mhabersack@novell.com>
1036
1037         * Makefile.am: added support for cross-compilation.
1038
1039 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
1040
1041         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
1042
1043 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
1044
1045         * mono-perfcounters.c: jitted methods and jitted bytes counters.
1046
1047 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
1048
1049         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
1050         mono-perfcounters.c: performance counters implementation.
1051
1052 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
1053
1054         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
1055         to gpointer, letting the AOT code decide what to store in it.
1056
1057 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
1058
1059         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
1060           mono_class_setup_methods if the methods are not initialized.
1061
1062         Code is contributed under MIT/X11 license.
1063
1064 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
1065
1066         * verify.c: Remove some debug code I commited by accident.
1067
1068         * verify.c (mono_method_is_valid_in_context): Change the return value
1069         to make possible to distinguish between invalid and unverifiable.
1070
1071         * verify.c (verifier_load_method): Don't return NULL for unverifiable
1072         methods.
1073
1074 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
1075
1076         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
1077         constraints. Fixes regression in gtest-253.
1078
1079 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
1080
1081         * verify.c (mono_verifier_verify_class): Don't allow generic types
1082         with explicit layout.
1083
1084         * verify.c (mono_method_verify): Check locals and argument types.
1085
1086 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
1087
1088         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
1089         wait if the thread is in StopRequested state.
1090
1091         * class.c (mono_class_from_name): Refactor the module searching code into
1092         a separate function so it can be reused in the AOT case too.
1093
1094 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
1095
1096         * verify.c (mono_type_is_valid_in_context): Improve the error message.
1097         Check both the type and it's generic type definition for loader errors.
1098         
1099         * verify.c (mono_method_is_valid_in_context): Don't generate another
1100         error when a type errors occur, this leads to the wrong exception been
1101         thrown.
1102
1103 2008-07-28  Dick Porter  <dick@ximian.com>
1104
1105         * icall-def.h
1106         * process.c
1107         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
1108         New internal calls to duplicate and close a process handle.
1109
1110 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
1111
1112         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
1113
1114 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
1115
1116         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
1117
1118 2008-07-27  Robert Jordan  <robertj@gmx.net>
1119
1120         * class.c (mono_class_init): Don't compute class.has_finalize for
1121         valuetypes. Fixes #412477.
1122
1123 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
1124
1125         * verify.c: Implement constraint equivalence checking.
1126         This is required when a generic parameter is used as
1127         argument to a constrained one.
1128
1129         Fixes #410637.
1130
1131 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
1132
1133         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
1134
1135         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
1136
1137         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
1138         synch with managed object layout.
1139
1140 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
1141
1142         * verify.c (do_branch_op): Handle valuetypes and generic
1143         arguments properly.
1144
1145         * verify.c (do_cmp_op): Same.
1146
1147         Fixes #410383.
1148
1149 2008-07-24  Mark Probst  <mark.probst@gmail.com>
1150
1151         * generic-sharing.c: Fix memory leaks.
1152
1153         * class.c, class-internals.h: Make
1154         mono_class_inflate_generic_type_with_mempool() non-static.
1155
1156 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
1157
1158         * pedump.c (dump_verify_info): Dump full class name.
1159
1160 2008-07-24  Mark Probst  <mark.probst@gmail.com>
1161
1162         * generic-sharing.c: Removed some old code that didn't do anything.
1163
1164 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
1165         * profiler.c: Added runtime_initialized_event,
1166         mono_profiler_install_runtime_initialized and
1167         mono_profiler_runtime_initialized. This new hook tells the profiler
1168         when the runtime is sufficiently initialized to be able to call
1169         mono_thread_attach on the root appdomain.
1170         * profiler.h, profiler-private.h: Likewise.
1171
1172 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
1173
1174         * verify.c (do_cast): Do boxing for generic arguments as well.
1175
1176         * class.c (is_nesting_type): Drop generic instantiations before
1177         checking for nesting.
1178
1179         * class.c (can_access_instantiation): Allow access to generic
1180         arguments.
1181
1182 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
1183
1184         * verify.c (verify_class_for_overlapping_reference_fields):
1185         On some cases, the field size might be zero, guard against that.
1186         Fix the explicit layout check to work as expected.
1187
1188 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
1189
1190         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
1191         mono_thread_resume () during shutdown, since the thread we want to abort
1192         might be suspended.
1193
1194 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
1195
1196         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
1197         warning.
1198
1199         * debug-mono-symfile.c: Fix a warning.
1200
1201         * mono-perfcounters.c (get_cpu_times): Fix a warning.
1202
1203         * object.c (mono_class_vtable): Check if exception_type is set, and return
1204         NULL as defined by the function comments.
1205
1206 2008-07-22  Mark Probst  <mark.probst@gmail.com>
1207
1208         * mempool.c: Use malloc for every single mempool allocation if the
1209         configure option is set.  This makes it easier to track mempool
1210         allocations with tools like Valgrind.
1211
1212 2008-07-22  Jb Evain  <jbevain@novell.com>
1213
1214         * reflection.c (create_dynamic_mono_image): emit the same
1215         metadata version that SL2 does when creating a SL2 image.
1216
1217 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
1218
1219         * icall-def.h:
1220         * icall.c: New icall System.Enum:get_hashcode. This function
1221         avoids the overhead of boxing the enum to the underlying type.
1222
1223 2008-07-21  Mark Probst  <mark.probst@gmail.com>
1224
1225         * reflection.c (mono_method_get_object): Don't let static RGCTX
1226         invoke wrappers get into MonoReflectionMethods.
1227
1228 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
1229
1230         * object-internals.h:
1231         * object.c: New mono_runtime_class_init_full function
1232         that makes throwing the exception optinal.
1233
1234         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
1235         for the case where the exception object is supplied.
1236
1237 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
1238
1239         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
1240         old ld versions.
1241
1242         Contributed under MIT/X11 license.
1243
1244 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
1245
1246         * string-icalls.c (ves_icall_System_String_InternalSplit):
1247         Optimize array allocation by caching the MonoClass of the
1248         array type.
1249
1250         * icall.c (ves_icall_Type_GetMethodsByName): Same.
1251
1252         * reflection.c (mono_param_get_objects): Same.
1253
1254 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
1255
1256         * icall-def.h:
1257         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
1258         It inflates the given type using the class context.
1259
1260 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
1261
1262         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
1263         the vtable if it already exists.
1264
1265         * object-internals.h: Add mono_class_try_get_vtable as part of the
1266         internal API.
1267
1268         * reflection.c (mono_type_get_object): Use the MonoObject from the
1269         vtable when possible. Reduces locking contention on reflection heavy
1270         code.
1271
1272 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
1273
1274         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
1275         g_bit_nth_msf () since that macro is not implemented in eglib.
1276
1277 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
1278
1279         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
1280         on platforms which do not support it.
1281
1282 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
1283
1284         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
1285
1286 2008-07-11  Martin Baulig  <martin@ximian.com>
1287
1288         * mono-debug-debugger.h
1289         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
1290
1291         * mono-debug-debugger.c
1292         (_mono_debugger_interruption_request): New global volatile variable.
1293         (mono_debugger_check_interruption): New public function.
1294
1295         * threads.c
1296         (mono_thread_current_check_pending_interrupt): Call
1297         mono_debugger_check_interruption().
1298         (mono_thread_interruption_checkpoint_request): Likewise.
1299
1300 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1301
1302         * verify.c: Add more type checks for loaded types. Verify the result
1303         handle from ldtoken.
1304
1305 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1306
1307         * loader.c (field_from_memberref): Don't crash if the field
1308         wasn't found.
1309
1310 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1311
1312         * verify.c: Verify if type and method instantiations
1313         don't have invalid VAR or MVAR arguments.
1314
1315 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1316
1317         * verify.c: Fix double free of function pointer list.
1318
1319 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1320
1321         * object.c (mono_string_to_utf8): Comment the new code as it
1322         breaks under eglib.
1323
1324 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
1325
1326         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
1327
1328 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
1329
1330         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
1331           is not throw too many times.
1332
1333         Code is contributed under MIT/X11 license.
1334
1335 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
1336
1337         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
1338         debugging is turned off.
1339
1340 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
1341
1342         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
1343
1344 2008-07-04  Mark Probst  <mark.probst@gmail.com>
1345
1346         * class-internals.h, class.c: Added new generic sharing option:
1347         Share only stuff in System.Collections.Generic, which is now the
1348         default.
1349
1350 2008-07-04  Mark Probst  <mark.probst@gmail.com>
1351
1352         * generic-sharing.c, class-internals.h: New function for getting a
1353         generic method in a generic class given the corresponding method
1354         for a different instantiation of the class.  Partly refactored
1355         from mini-trampolines.c.
1356
1357         * class.c: Make sure generic methods have a class_inst if they are
1358         part of a generic class.
1359
1360         * metadata.c (mono_type_stack_size_internal): Handle type
1361         variables.
1362
1363 2008-07-04  Mark Probst  <mark.probst@gmail.com>
1364
1365         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
1366         Signifies whether information on the this/vtable/mrgctx variable
1367         is available.
1368
1369 2008-07-04  Mark Probst  <mark.probst@gmail.com>
1370
1371         * object.c, object-internals.h, icall.c: New function
1372         mono_delegate_ctor_with_method(), which does the same as
1373         mono_delegate_ctor(), but takes an explicit method argument
1374         instead of taking the method from the jit info.
1375
1376         * marshal.c: When creating a delegate with an inflated method take
1377         the "this" argument as the target class for the castclass.
1378
1379 2008-07-03  Mark Probst  <mark.probst@gmail.com>
1380
1381         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
1382         mono_jit_info_table_find() to perform very badly in some cases.
1383
1384 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
1385
1386         * icall.c (type_from_typename): Handle 'string'.
1387
1388         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
1389         wrappers into the wrapper_hash, since the key is not a MonoMethod.
1390
1391 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
1392
1393         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
1394
1395         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
1396         number of available managed allocator types.
1397
1398         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
1399         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
1400
1401 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
1402
1403         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
1404         which is a low level lock protecting just the 'jit_code_hash' hash table.
1405
1406         * domain.c: Initialize+cleanup jit_code_hash_lock.
1407         
1408 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
1409
1410         * coree.c (mono_load_coree): Set coree_module_handle global variable only
1411         after initialization.
1412
1413         * coree.h: Make MonoFixupExe internal.
1414
1415         Contributed under MIT/X11 license.
1416
1417 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
1418
1419         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
1420         because that is platform independent. Check NumberOfRvaAndSizes in PE32
1421         as well.
1422         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
1423         image being loaded is a CLI image and _CorValidateImage gets called.
1424
1425         * coree.h: Add MonoLoadImage.
1426
1427         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
1428         instead of LoadLibrary.
1429
1430         Contributed under MIT/X11 license.
1431
1432 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
1433
1434         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
1435         for any primitive type.
1436
1437 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
1438
1439         * object.c (mono_array_new_specific): Optimize this and the other allocation
1440         functions a bit.
1441         
1442         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
1443         domains too if mono_dont_free_domains is set.
1444
1445         * domain-internals.h (mono_dont_free_domains): New internal option controlling
1446         whenever to free appdomain data after it has been unloaded.
1447
1448         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
1449         
1450 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
1451
1452         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
1453         (mono_method_get_equivalent_method): Fix a warning.
1454
1455         * object.c (mono_message_init): Avoid looking up array types for each call.
1456
1457 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
1458
1459         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
1460         call.
1461
1462         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
1463         even more.
1464
1465         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
1466         each iteration.
1467
1468         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
1469         fields of an enum.
1470
1471 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
1472
1473         * object.c (mono_value_box): Fix boxing of nullables.
1474
1475 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
1476
1477         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
1478         mono_module_handle that is defined by the linker; no initialization required.
1479         * coree.h: Remove mono_module_handle, add __ImageBase, update
1480         mono_image_open_from_module_handle.
1481         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
1482         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
1483         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
1484         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
1485         to 4 GB away from image base address. IA64 version is not tested but was very
1486         easy to implement and should work if we ever need it.
1487         * domain.c (mono_init_internal): Avoid system error message boxes.
1488         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
1489         with has_entry_point. Handle do_mono_image_load fauilre correctly.
1490         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
1491         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
1492         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
1493
1494         Contributed under MIT/X11 license.
1495
1496 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1497
1498         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
1499         as part of the private mono API.
1500         
1501         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
1502         Do proper argument checking for methods that belong to generic classes.
1503         Do proper type resolution for GMFH/2.
1504         Fixes #377324.
1505         
1506 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1507
1508         * verify.c (do_switch): Fix a memory corruption bug with
1509         the jump index is out of bound.
1510
1511 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1512
1513         * verify.c: Disable debug code.
1514
1515 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1516
1517         * reflection.c (mono_image_get_methodbuilder_token): Use
1518         mono_image_get_methodspec_token_for_generic_method_definition
1519         instead of mono_image_get_memberref_token. We cache more memberef
1520         entries now.
1521
1522 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1523
1524         * verify.c: Inflate exception clause types.
1525         Fixes #402606.
1526         
1527 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1528
1529         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
1530         name.
1531
1532         * reflection.c (mono_image_get_ctorbuilder_token): Same.
1533
1534         * reflection.c (mono_image_create_method_token): Same.
1535
1536 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
1537
1538         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
1539         It does the same as mono_image_get_methodref_token but works on
1540         MethodBuilder.
1541
1542         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
1543         and always generate a methodspec. This follows the old behavior and fixes
1544         the regressions in System.Core. 
1545
1546 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
1547
1548         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
1549         don't event mono_class_get () succeeds. Fixes #402182.
1550
1551 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
1552
1553         * metadata-internals.h: Added MonoDynamicImage::methodspec
1554         hashtable to store methodspec tokens created for MethodBuilders.
1555
1556         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
1557         MethodBuilders as open instantiations if a methodspec was requested.
1558
1559         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
1560
1561         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
1562
1563         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
1564
1565         Fixes bug #349190.
1566
1567 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
1568
1569         * loader.c (method_from_methodspec): Avoid crashing if the
1570         method lookup fails.
1571
1572 2008-06-20  Dick Porter  <dick@ximian.com>
1573
1574         * socket-io.c (get_socket_assembly): Cope with Moonlight network
1575         classes being in a different assembly.  Fixes bug 399184.
1576
1577 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
1578
1579         * loader.c (mono_loader_init): Make this callable multiple times.
1580         (mono_dllmap_insert): Call mono_loader_init () so this works even before
1581         the runtime is initialized. Fixes #401755.
1582
1583 2008-06-19  Dick Porter  <dick@ximian.com>
1584
1585         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
1586         Fixes bug 349688.
1587
1588 2008-06-19  Dick Porter  <dick@ximian.com>
1589
1590         * socket-io.c:
1591         * icall-def.h: Implement Socket generic Send() and Receive()
1592         methods.  Fixes bug 395168.
1593
1594 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
1595
1596         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
1597
1598         Contributed under MIT/X11 license.
1599
1600 2008-06-18  Martin Baulig  <martin@ximian.com>
1601
1602         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
1603         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
1604         set to 80.0.  The debugger <-> runtime interface is now frozen as
1605         well.   
1606
1607         * mono-debug.c
1608         (mono_debug_debugger_version): Bump to 4.
1609
1610 2008-06-18  Martin Baulig  <martin@ximian.com>
1611
1612         * debug-mono-symfile.c
1613         (load_symfile): Don't check the minor version.
1614
1615         * debug-mono-symfile.h: Bump the version number to 50.0.
1616
1617 2008-06-18  Martin Baulig  <martin@ximian.com>
1618
1619         * debug-mono-symfile.c
1620         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
1621         minimum required version.
1622
1623 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
1624
1625         * reflection.c (mono_custom_attrs_from_property): Fix support for
1626         retriveving cattrs of dynamic inflated generic types.
1627
1628         * reflection.c (mono_custom_attrs_from_event): Same.
1629
1630         * reflection.c (mono_custom_attrs_from_field): Same;
1631
1632         * reflection.c (typebuilder_setup_events): Same cattrs of events.
1633
1634         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
1635         Moved to metadata.c.
1636
1637         * metadata.c: New functions to retrive the equivalent field, event
1638         of property from the generic type definition.
1639
1640         * metadata-internals.h: Added new functions from metadata.c.
1641
1642 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
1643
1644         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
1645         to cached in a mempool is used.
1646
1647         * metadata.c (free_generic_class): In some situations field generic_info type
1648         is not properly dup'ed and leads to double free'ing.
1649
1650         Fixes #400643.
1651
1652 2008-06-17  Mark Probst  <mark.probst@gmail.com>
1653
1654         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
1655         this arguments (will be needed later for generic methods).
1656         Collect stats.
1657
1658 2008-06-17  Mark Probst  <mark.probst@gmail.com>
1659
1660         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
1661         Create a static RGCTX invoke wrapper for methods which require it.
1662
1663 2008-06-17  Mark Probst  <mark.probst@gmail.com>
1664
1665         * object.c, class-internals.h: New function for checking whether
1666         an individual field is special static.
1667
1668 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
1669
1670         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
1671         linear search since the table is sorted.
1672
1673         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
1674         Fixes #324180.
1675
1676 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
1677
1678         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
1679         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
1680
1681         * gc.c (mono_domain_finalize): Allow an infinite timeout.
1682
1683         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
1684         
1685         * threads.c (mono_thread_request_interruption): Get rid of locking, use
1686         InterlockedCompareExchange to query and modify 
1687         thread->interruption_requested.
1688
1689         * object-internals.h (struct _MonoThread): Change interruption_requested
1690         to a gint32 so it can be modified by atomic operations. Add 
1691         'critical_region_level' from the managed side, change small_id to a guint32,
1692         add new set of 'unused' fields.
1693
1694         * appdomain.c: Bump corlib version.
1695
1696 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
1697
1698         * class.c (mono_class_from_name): Search modules as well. Fixes
1699         #322332.
1700
1701 2008-06-13  Mark Probst  <mark.probst@gmail.com>
1702
1703         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
1704         templates.  Templates are generalized with an additional type_argc
1705         argument.  RGCTX templates have type_argc==0, MRGCTX templates
1706         have type_argc>0.
1707
1708         * domain-internals.h, domain.c: New hash table for looking up
1709         MRGCTXs.
1710
1711         * metadata.c, metadata-internals.h: Rename hash and equal
1712         functions for MonoGenericInst's and make them public.
1713
1714         * class-internals.h: New data structures for the MRGCTX.  Macros
1715         for distinguishing slots in the RGCTX and the MRGCTX.
1716
1717 2008-06-13  Mark Probst  <mark.probst@gmail.com>
1718
1719         * object.c (mono_method_get_imt_slot): Put the same methods of
1720         different instantiations of the same generic interface in the same
1721         IMT slots, to make generic sharing simpler.
1722
1723 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
1724
1725         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
1726
1727         * metadata.c (mono_metadata_field_info_with_mempool): Added.
1728         This function works just like mono_metadata_field_info, but
1729         accept a mempool as argument to be used allocating memory.
1730
1731         * marshal.c (mono_marshal_load_type_info): Use new function
1732         to load marshal data into image mempool.
1733
1734 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
1735
1736         * class.c (mono_class_inflate_generic_type_with_mempool):
1737         This function allows to inflate a generic type using
1738         a mempool.
1739
1740         * class.c (inflate_generic_type): Take a mempool as argument
1741         and use it to do type dup'ing.
1742
1743         * class.c (mono_class_setup_fields): Field type for generic
1744         generic classes are allocated from the image mempool.
1745
1746         * metadata.c (free_generic_class): Inflated field type is
1747         now allocated in the image mempool.
1748
1749 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
1750
1751         * threads.c (thread_cleanup): Free MonoThread::name.
1752
1753 2008-06-12  Marek Habersack  <mhabersack@novell.com>
1754
1755         * appdomain.c (ensure_directory_exists): avoid unnecessary
1756         mkdir(2) calls when the shadow directory already exists.
1757         (mono_make_shadow_copy): copy also satellite assemblies from the
1758         private bin directories.
1759
1760 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
1761
1762         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
1763         
1764         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
1765         a page boundary. Fixes #396219.
1766
1767 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1768
1769         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
1770         due to double-checked locking.
1771
1772 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1773
1774         * assembly.c (build_assembly_name): Release memory on failure.
1775
1776         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
1777
1778 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1779
1780         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
1781         memory on failure.
1782
1783 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1784
1785         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
1786         memory on failure.
1787
1788 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1789
1790         * loader.c (field_from_memberref): Check if field signature type is equal
1791         to the non-inflated type of the field. Fixes #398980.
1792
1793 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
1794
1795         * assembly.c (mono_assembly_load_from_full): Call 
1796         mono_assembly_load_friends () outside the assemblies lock, since it can
1797         acquire the loader lock. Fixes #323696.
1798
1799         * reflection.c (resolve_object): Inflate the inst with the context for
1800         FieldOnTypeBuilderInst. Fixes #399010.
1801
1802 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1803
1804         * reflection.c (mono_image_get_field_on_inst_token): Don't
1805         inflate the field to encode it's signature. If it's a
1806         VAR or MVAR it should stay that way in the signature.
1807         Fixes #399047.
1808
1809 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1810
1811         * reflection.c (resolve_object): Release memory of inflated types.
1812
1813 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1814
1815         * loader.c (mono_method_get_signature_full): Remove assert about
1816         loading a methodspec to a generic method. We have such methods, such as
1817         System.Threading.Interlocked::CompareExchange<T>.
1818         This assert was removed since it crashes the verifier when it checks
1819         methods calling CompareExchange<T>.
1820
1821 2008-06-10  Marek Safar  <marek.safar@gmail.com>
1822
1823         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
1824         of Type array and not MonoType.
1825
1826 2008-06-10  Marek Habersack  <mhabersack@novell.com>
1827
1828         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
1829         <lupus@ximian.com>
1830
1831 2008-06-10  Martin Baulig  <martin@ximian.com>
1832
1833         * debug-mono-symfile.h
1834         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
1835         changes to the file format, but we were generating incorrect
1836         source file indices in the line number table due to a bug, which
1837         made backtraces report an incorrect source file.
1838
1839 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
1840
1841         * mono-debug.c: Moved mono_debug_free_method_jit_info from
1842         mini/debug-mini.c to here.
1843
1844         * mono-debug.c (il_offset_from_address): Free memory from find_method.
1845
1846         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
1847         use it to release structs returned by mono_debug_find_method.
1848
1849 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
1850
1851         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
1852         since it needs to set method->slot for all interface methods.
1853
1854 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
1855
1856         * class-internals.h: Forgot to add.
1857
1858 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
1859
1860         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
1861
1862         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
1863         Lookup the custom attributes from property_hash.
1864
1865         * reflection.c (mono_save_custom_attrs): Save the custom attributes
1866         in property_hash. Allocate all data using the image mempool.
1867
1868         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
1869         for dynamic_custom_attrs to checks if the image is dynamic.
1870
1871 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
1872
1873         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
1874         assemblies array.
1875         
1876         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
1877         runtime functions while holding the domain assemblies lock.
1878
1879 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
1880
1881         * verify.c: Reapplied the last bit of the reverted changes.
1882
1883 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
1884
1885         * verify.c: Reapplied more of the reverted changes.
1886
1887 2008-06-09  Martin Baulig  <martin@ximian.com>
1888
1889         * debug-mono-symfile.c (load_symfile): Check the major version
1890         first; if it's wrong, don't print the minor version in the error message.
1891
1892 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
1893
1894         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
1895         lock instead of the domain lock to avoid deadlocks, since the thread might
1896         already hold the loader lock.
1897
1898         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
1899         (mono_thread_attach): Ditto.
1900
1901         * monitor.c: Use a TLS variable for holding the current thread id instead
1902         of calling pthread_self ().
1903         (mono_monitor_init_tls): New internal function to initialize the TLS
1904         variable.
1905         (mono_monitor_try_enter_internal): Put the owner == id check after the
1906         owner == 0 check.
1907
1908         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
1909         missed optimizations when using gcc-4.3.
1910
1911 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
1912
1913         * reflection.c (mono_dynamic_image_free): Free the memory
1914         used by MonoGenericParam in MonoDynamicImage::gen_param.
1915
1916         * reflection.c (mono_reflection_setup_generic_class): Allocate
1917         container from mempool.
1918
1919         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
1920         container from mempool.
1921
1922 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
1923
1924         * threads.c (mono_set_pending_exception): New internal function to set the
1925         pending exception of the current thread.
1926         (mono_thread_get_and_clear_pending_exception): Check for 
1927         thread->pending_exception as well.
1928
1929         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
1930
1931         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
1932         it can trigger a collection.
1933
1934 2008-06-06  Martin Baulig  <martin@ximian.com>
1935
1936         Merged the `debugger-kahalo' branch.
1937
1938         * mono-debug.h
1939         (MONO_DEBUGGER_VERSION): Bumped to 72.
1940
1941         * debug-mono-symfile.h
1942         (MonoSymbolFileMethodIndexEntry): Removed.
1943         (MonoSymbolFileMethodEntry): New public typedef.
1944         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
1945         (MonoSymbolFileSourceEntry): Remove everything except `index' and
1946         `data_offset'.
1947         (MonoSymbolFileMethodEntry): Removed.
1948         (MonoSymbolFileLexicalBlockEntry): Removed.
1949         (MonoSymbolFileLineNumberEntry): Removed.
1950         (MonoDebugLexicalBlockEntry): Removed.
1951         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
1952         removed `num_il_offsets' and `il_offsets'.
1953         (MonoSymbolFile): Replace `version' with `major_version' and
1954         `minor_version'.
1955         (MONO_SYMBOL_FILE_VERSION): Replace with
1956         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
1957         `MONO_SYMBOL_FILE_MINOR_VERSION'.
1958
1959         * debug-mono-symfile.c
1960         (mono_debug_symfile_lookup_location): Add support for the new line
1961         number table format.
1962
1963 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
1964
1965         * metadata.c (free_generic_class): Release the inflated
1966         MonoClass of dynamic generic classes if it's not a generic
1967         type definition.
1968
1969 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
1970
1971         * verify.c: Reapplied more of the reverted changes.
1972
1973 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
1974
1975         * reflection.c (lookup_custom_attr): Clean the cached flag or
1976         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
1977         for SRE types.
1978
1979 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
1980
1981         * verify.c: Reapplied a small part of the reverted changes.
1982
1983 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
1984
1985         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
1986
1987         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
1988         previously in managed code.
1989         (mono_monitor_exit): Ditto.
1990         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
1991
1992         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
1993         the managed definition.
1994
1995 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
1996
1997         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
1998
1999 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
2000
2001         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
2002         
2003         * monitor.c: Add some micro optimizations.
2004
2005         * icall.c (type_from_typename): Handle 'bool'.
2006
2007 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
2008
2009         * verify.c: Implement constructor verification per P III 1.8.1.4.
2010         Fixes #396716.
2011
2012 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
2013
2014         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
2015         holding the assemblies lock here too.
2016
2017 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2018
2019         * verify.c: Kill stack_top function.
2020
2021 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2022
2023         * verify.c: Kill stack_get function.
2024
2025 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2026
2027         * verify.c (mono_method_verify): Last change broke the build. Fixed.
2028
2029 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2030
2031         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
2032         more reliable.
2033
2034         * verify.c (mono_method_verify): Inflate params and locals to avoid
2035         mismatch when checking for compatibility.
2036
2037 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
2038
2039         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
2040         Length prefix should be size in bytes. Fix bug #339530.
2041         
2042         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
2043         Length prefix should be size in bytes. Fix bug #339530.
2044
2045         Code is contributed under MIT/X11 license.
2046
2047 2008-06-05  Bill Holmes <billholmes54@gmail.com>
2048
2049         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
2050
2051         Contributed under MIT/X11 license.
2052
2053 2008-06-05  Martin Baulig  <martin@ximian.com>
2054
2055         * mono-debug-debugger.c
2056         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
2057
2058 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
2059
2060         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
2061         while holding the assemblies lock to prevent deadlocks. Handle the case
2062         where the search hook returns NULL but the assembly was still loaded.
2063         Fixes #323696.
2064
2065         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
2066         modify domain state.
2067
2068 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
2069
2070         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
2071         * Makefile.am (pedump_LDADD): Post-process object files and
2072         add dtrace-generated object file, if necessary.
2073
2074         Code is contributed under MIT/X11 license.
2075
2076 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2077
2078         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
2079
2080 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2081
2082         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
2083
2084 2008-06-04  Mark Probst  <mark.probst@gmail.com>
2085
2086         * threads.c: Try to free everything from the delayed free table
2087         when shutting down threads, and set the variable to NULL after the
2088         table is freed so that calling
2089         mono_thread_hazardous_try_free_all() when shutting down the root
2090         domain doesn't crash.
2091
2092 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2093
2094         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
2095         the caller if resulting type was inflated.
2096
2097         * class.c (mono_class_create_from_typespec): Free the MonoType if it
2098         was inflated.
2099
2100         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
2101
2102
2103 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
2104
2105         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
2106         class library tests.
2107
2108         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
2109         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
2110         #396989.
2111
2112 2008-06-04  Mark Probst  <mark.probst@gmail.com>
2113
2114         * domain.c, domain-internals.h: The JIT infos are now freed by the
2115         JIT info table code.  They are freed immediately if there only a
2116         single JIT info table in circulation.  If there is more, the free
2117         is delayed via a queue.
2118
2119         * threads.c, threads-types.h: New hazard pointer function for
2120         freeing all freeable delayed items in one sitting.
2121
2122 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2123
2124         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
2125
2126         * reflection.c (typebuilder_setup_properties): Same.
2127
2128         * reflection.c (typebuilder_setup_events): Same.
2129
2130 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2131
2132         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
2133         and use it for allocating memory.
2134
2135         * reflection.c (mono_marshal_spec_from_builder): Same.
2136
2137         * reflection.c: Change code to use new signatures.
2138
2139         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
2140
2141 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
2142
2143         * decimal.c (rescale128): Put back one line which was accidently commented
2144         out.
2145         
2146         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
2147         to cause crashes.
2148
2149 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2150
2151         * reflection.c (mono_reflection_generic_class_initialize): Name must
2152         be always malloc'ed so we can free it later on. Do this for field, property
2153         and event.
2154
2155         * metadata.c (free_generic_class): Free field, property and event names.
2156
2157 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2158
2159         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
2160         instead of g_memdup.
2161
2162         * reflection.c (typebuilder_setup_fields): Same.
2163
2164 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
2165
2166         * decimal.c (rescale128): Optimize this function a bit more.
2167
2168 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2169
2170         * metadata.c (free_generic_class): Release some memory from
2171         SRE generic classes.
2172
2173 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2174
2175         * reflection.c (mono_image_get_generic_field_token): No reference
2176         to name is kept, free it.
2177
2178         * reflection.c (mono_reflection_generic_class_initialize): Free
2179         more memory of the inflated field.
2180
2181 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
2182
2183         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
2184         code.
2185
2186 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
2187
2188         * reflection.c (mono_dynamic_image_free): Release memory used by
2189         MonoDynamicImage::array_methods elements.
2190
2191         * reflection.c (assembly_add_win32_resources): Release memory after
2192         encoding.
2193
2194 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
2195
2196         * decimal.c (log2_32): Use an optimized version for this function too.
2197         
2198         * decimal.c (log2_64): Fix this on 32 bit machines.
2199
2200 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
2201
2202         * class.c (mono_dup_array_type): Implement allocation using a mempool.
2203
2204         * class.c (mono_metadata_signature_deep_dup): Same.
2205
2206         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
2207         a mempool.
2208
2209         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
2210
2211         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
2212
2213         * metadata-internals.h: Added mono_metadata_signature_dup_full.
2214
2215         * class-internals.h: Update signatures to take a MonoMemPool.
2216
2217 2008-06-02  Dick Porter  <dick@ximian.com>
2218
2219         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
2220         * icall-def.h: Add
2221         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
2222         FormatMessage API to get the error text.  Fixes bug 321827.
2223
2224 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
2225
2226         * decimal.c: Add some micro optimizations to make decimal operations faster.
2227
2228 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2229
2230         * reflection.c (method_encode_clauses): Take a mempool
2231         as parameter and use it to allocate the clause array.
2232
2233         * reflection.c (mono_image_get_field_on_inst_token): Free
2234         the inflated type after encoding it.
2235
2236         * reflection.c (mono_dynamic_image_free): Free each element
2237         of MonoDynamicImage::gen_params.
2238
2239         * reflection.c (reflection_methodbuilder_to_mono_method):
2240         Allocate the generic param array from the mempool.
2241         Allocate signature params from the mempool.
2242
2243         * reflection.c (mono_reflection_generic_class_initialize):
2244         Free inflated fields after been used.
2245
2246 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
2247
2248         * icall.c: Reapply the memory leak fixes as they no
2249         longer make mono crash.
2250
2251 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
2252
2253         * reflection.c (mono_type_get_object): Don't store the suplied
2254         MonoType with type_hash. A caller which pass a type that
2255         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
2256         might end with a pointer to freed memory.
2257         The solution is to use byval_arg or this_arg from the associated
2258         MonoClass of the supplied type.
2259
2260 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
2261
2262         * icall.c: Revert the rest of the last change as it breaks the build too.
2263
2264 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2265
2266         * icall.c: Revert a leak fix as it's breaking the build.
2267
2268 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2269
2270         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
2271
2272 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2273
2274         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
2275
2276 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2277
2278         * icall.c: Fix some memory leaks.
2279
2280 2008-05-29  Dick Porter  <dick@ximian.com>
2281
2282         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
2283         async socket operations from the pending list when a socket
2284         closes.  Leaving it until the threadpool services the event
2285         exposes a race condition when a socket descriptor is reused.
2286         Fixes bug 377589.
2287
2288 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2289
2290         * object.c: Fix negative index check for array alocation.
2291
2292 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2293
2294         * icall.c, marshal.c: Delegate wrappers should skip visibility.
2295         This check is performed by the verifier for IL created delegates
2296         and by Delegate::CreateDelegate for programatically created ones.
2297         Fixes #372406.
2298
2299 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2300
2301         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
2302         Fix code to use mono_array_size_t instead of int.
2303
2304         Based on patch by Luis F. Ortiz.
2305         Contributed under X11 license.
2306         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2307
2308 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2309
2310         * icall.c: Added ves_icall_System_Array_GetLongLength and
2311         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
2312         arrays.
2313
2314         * icall.h: Export both new functions.
2315
2316         Based on patch by Luis F. Ortiz.
2317         Contributed under X11 license.
2318         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2319
2320 2008-05-28  Martin Baulig  <martin@ximian.com>
2321
2322         The debugger now requires exactly r103463.
2323
2324         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
2325         This version is not supported by the debugger, wait for 72.
2326
2327 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2328
2329         * object.h: Changed array related functions to use
2330         mono_array_size_t instead of guint32. Forgot to commit this file.
2331
2332         Patch by Luis F. Ortiz.
2333         Contributed under X11 license.
2334         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2335
2336
2337 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2338
2339         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
2340         don't define it. Use the number literal instead.
2341
2342 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2343
2344         * icall.c: Changed array related functions to use
2345         mono_array_size_t instead of guint32.
2346
2347         * icall.c (ves_icall_System_Array_GetLength): Check for length
2348         overflow under MONO_BIG_ARRAYS.
2349
2350         Based on patch by Luis F. Ortiz.
2351         Contributed under X11 license.
2352         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2353
2354 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2355
2356         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
2357
2358         Based on patch by Luis F. Ortiz.
2359         Contributed under X11 license.
2360         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2361
2362 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2363
2364         * object.c, object.h: Changed array related functions to use
2365         mono_array_size_t instead of guint32.
2366
2367         Patch by Luis F. Ortiz.
2368         Contributed under X11 license.
2369         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2370
2371 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2372
2373         * object.h: Introduced mono_array_size_t typedef. This must be used
2374         in all places an array length is expected. This is 64bits wide if
2375         MONO_BIG_ARRAYS is enabled.
2376
2377         Patch by Luis F. Ortiz.
2378         Contributed under X11 license.
2379         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2380
2381 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
2382
2383         * security-manager.c class.c: Set the class exception info by calling
2384         mono_class_set_failure ().
2385
2386         * class.c (mono_class_get_exception_data): New accessor function.
2387         (mono_class_set_failure): Store exception_data in the property hash.
2388
2389         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
2390         the struct as a property.
2391
2392         * loader.c (mono_get_method_full): Store the lookup result for method
2393         tokens in method_cache, the others in methodref_cache to decrease the memory
2394         usage of hash tables.
2395
2396         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
2397         (mono_image_init): method_cache is lazy inited now.
2398
2399         * metadata-internals.h (struct _MonoImage): Change method_cache to
2400         a MonoValueHashTable, add a separate methodref_cache.
2401
2402 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
2403
2404         * number-formatter.h: Fix tables to avoid arithemtic overflow in
2405           Double.ToString as exposed by Bug #383531.
2406
2407 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
2408
2409         * number-formatter.h: Make some tables static.
2410
2411         * class.c (mono_method_set_generic_container): New accessor function.
2412         (mono_method_get_generic_container): Ditto.
2413
2414         * class-internals.h (struct _MonoMethod): Remove rarely used 
2415         'generic_container' field, store it in the property hash instead. Add 
2416         'is_generic' boolean field instead.
2417
2418         * image.c (mono_image_init): Initialize property_hash.
2419         (mono_image_close): Destroy property_hash.
2420
2421         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
2422         hold rarely used fields of runtime structures belonging to this image.
2423
2424         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
2425         to get/set method->generic_container.
2426
2427         * loader.c (mono_get_method_from_token): Avoid loading the method header for
2428         generic methods.
2429
2430 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
2431
2432         * class.c (mono_class_inflate_generic_method_full): Don't increase
2433         mono_stats.inflated_method_count for methods found in the cache.
2434
2435         * threads.c (mono_thread_request_interruption): Add a comment about 
2436         QueueUserAPC ().
2437
2438 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
2439
2440         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
2441         interface_offsets_packed table.
2442         
2443         * class.c (mono_class_init): Remove some dead code.
2444
2445         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
2446         mono_class_setup_vtable () when CAS is active to detect security problems.
2447
2448 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
2449
2450         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
2451
2452         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
2453         parameters as it's irrelevant for delegate checking.
2454
2455 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
2456
2457         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
2458
2459         * class.c (mono_class_init): Control the creation of a generic vtable using
2460         a global which is true by default, but set to false by the runtime startup code.
2461         
2462         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
2463         Disabled for now since it breaks the embedding API.
2464         Move the setup of class->methods for arrays to mono_class_setup_methods ().
2465         (mono_class_setup_methods): Add a memory barrier.
2466
2467         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
2468         when mono_class_init () doesn't compute the generic vtable.
2469         
2470 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
2471         * profiler.c: Added mono_profiler_install_statistical_call_chain,
2472         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
2473         to support call chains (backtrace) in the stat profiler.
2474         * profiler.c, profiler-private.h: Likewise.
2475
2476 2008-05-22  Mark Probst  <mark.probst@gmail.com>
2477
2478         * generic-sharing.c: Init generic class when a method of it is
2479         requested via a runtime generic context.
2480
2481 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
2482
2483         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
2484
2485         * reflection.c (mono_type_get_object): Add a FIXME.
2486
2487         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
2488
2489         * class.c (mono_class_get_method_by_index): New helper function, returning an
2490         entry in the class->methods array.
2491
2492 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
2493
2494         * class.c (mono_class_init): Only do the array optimization for szarrays. 
2495         Avoid creating a generic vtable for generic instances as well.
2496         (mono_class_get_method_from_name_flags): Don't search in the metadata for
2497         generic instances.
2498
2499 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
2500
2501         * loader.c (mono_get_method_constrained): Inflate the signature
2502         with class context. Fix #325283.
2503
2504 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
2505
2506         * object.c (mono_class_create_runtime_vtable): Add a comment.
2507
2508         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
2509         where needed.
2510         (setup_interface_offsets): Handle the case when this is called twice for arrays.
2511         (mono_class_setup_vtable_general): Add an assert.
2512         (mono_class_init): Avoid creating a generic vtable for arrays.
2513
2514         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
2515         here, let mono_class_init () do that.
2516
2517         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
2518         interfaces in mscorlib.
2519
2520         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
2521         interfaces. Add some comments.
2522         (mono_class_init): Call mono_class_setup_methods () here since it is no
2523         longer called by mono_class_setup_vtable ().
2524
2525         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
2526         not set in class->vtable.
2527         (mono_class_create_runtime_vtable): Reenable the disabled code.
2528
2529         * object.c (mono_class_create_runtime_vtable): Disable the last change for
2530         now as it causes some test failures.
2531
2532         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
2533         if using the vtable trampoline. Also remove some strange code which put the
2534         generic methods themselves into the vtable slots. Remove the AOT init_vtable
2535         stuff as it is no longer needed.
2536
2537 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2538
2539         * pedump.c: Give make --verify all option check code as well.
2540         Using --verify code won't check for metadata now.
2541
2542 2008-05-19  Martin Baulig  <martin@ximian.com>
2543
2544         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
2545
2546         * mono-debug.c
2547         (_mono_debug_using_mono_debugger): New global variable; it's set
2548         directly by the debugger, so mono_debug_using_mono_debugger() also
2549         works after attaching.
2550
2551 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
2552
2553         * object.c (mono_class_create_runtime_vtable): Use memory barriers
2554         as we do double checked locking on MonoClass::runtime_info and
2555         MonoClassRuntimeInfo::domain_vtables.
2556
2557 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
2558
2559         * debug-helpers.c (print_field_value): Fix a warning.
2560
2561 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
2562
2563         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
2564         set in the AOT case.
2565
2566 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
2567
2568         * class.c (mono_class_setup_vtable_general): Use memory barriers
2569         as we do double checked locking on MonoClass::vtable.
2570
2571 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
2572
2573         * reflection.c (resolve_object): Inflate only if the generic context
2574         is not null. Fixes #389886.
2575
2576 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
2577
2578         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
2579         instead of g_free.
2580
2581         Code is contributed under MIT/X11 license.
2582
2583 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
2584
2585         * class.c: Revert unrelated change.
2586
2587 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
2588
2589         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
2590         a generic instantiation, use mono_class_from_mono_type instead of playing
2591         with MonoType directly.
2592
2593 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
2594
2595         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
2596         checks must ignore generic instantiations, so mono_class_has_parent is not
2597         suitable. Fixes #390128.
2598
2599 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
2600
2601         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
2602         it to avoid registering tokens during metadata generation. Fixes #390023.
2603
2604 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
2605
2606         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
2607         consistent.
2608
2609         Contributed under MIT/X11 license.
2610
2611 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
2612
2613         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
2614         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
2615         to fixup the EXE image.
2616         (mono_cleanup): Use mono_close_exe_image.
2617         (mono_close_exe_image): New function.
2618         * image.c: Include "marshal.h".
2619         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
2620         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
2621         counting when the image is loaded outside of mono_image_open_full. Set status
2622         based on GetLastError.
2623         * coree.c: Include required headers. Add init_from_coree.
2624         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
2625         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
2626         (_CorExeMain): Set init_from_coree.
2627         (CorExitProcess): Only call ExitProcess for now.
2628         (CorBindToRuntimeEx): New stub implementation.
2629         (CorBindToRuntime): New function.
2630         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
2631         (MonoFixupExe): ILONLY executables require no fixups.
2632         (mono_set_act_ctx): New function to set activation context.
2633         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
2634         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
2635         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
2636         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
2637         as MONO_INTERNAL.
2638         * domain-internals.h: Add mono_close_exe_image.
2639
2640         Contributed under MIT/X11 license.
2641
2642 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
2643
2644         * metadata.c (mono_metadata_compute_size): Correctly calculate field
2645         size for generic param and event tables. Fixes #388977.
2646
2647 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
2648
2649         * loader.c (mono_method_signature): Use memory barriers because of the double
2650         checked locking pattern.
2651
2652         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
2653         aborting or aborted as well. Fixes #376391.
2654         
2655         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
2656         existing runtime state in the Suspend handler during shutdown.
2657
2658 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
2659
2660         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
2661
2662         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
2663         which are starting up or shutting down.
2664
2665         * threads.c (mono_threads_set_shutting_down): Don't return a value since
2666         this function never returns if the runtime is already shutting down.
2667
2668         * icall.c (ves_icall_System_Environment_Exit): Update after 
2669         mono_threads_set_shutting_down () signature change.
2670         
2671 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
2672
2673         * class.c: Added can_access_instantiation to verify if the instantiation
2674         is visible. Fix access check for nested types as they returned TRUE
2675         before doing type and generic instantiation visibility checks.
2676
2677 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
2678
2679         * reflection.c (mono_reflection_create_generic_class): The created type
2680         must have a different container from its TypeBuilder. Otherwise they
2681         will end sharing generic arguments, which is wrong.
2682
2683         Due to the sharing, making a generic instance of the created type using
2684         the TypeBuider generic arguments resulted in the generic type definition
2685         been returned, which is wrong as well.
2686
2687         As a bonus the code was leaking the type_params array. This memory should
2688         be allocated from the image mempool.
2689
2690         This fixes bug #354047.
2691
2692 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
2693
2694         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
2695         to here         as they are now used in assembly.c new code.
2696         Added a skipverification flag to MonoAssembly.
2697         New internal function mono_assembly_has_skip_verification.
2698
2699         * assembly.c: New function mono_assembly_has_skip_verification. It checks
2700         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
2701         part of #387274.
2702
2703 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
2704
2705         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
2706         needed. Fixes #387034.
2707
2708         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
2709
2710 2008-05-06  Miguel de Icaza  <miguel@novell.com>
2711
2712         * assembly.c (mono_assembly_load_reference): Prevent crash while
2713         disassembling Silverlight 2.0 executables while we still do not
2714         have GACed libraries.
2715
2716 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
2717
2718         * reflection.c: Special case generic type definitions as well. Fixes #383444.
2719
2720 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
2721
2722         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
2723         of the dynamic case. Fixes #387404.
2724
2725 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
2726
2727         *verify.c (mono_verifier_is_class_full_trust): If under
2728         verify_all and the verifier mode was not set, only
2729         gac and corlib types are fulltrust. This makes --verify-all
2730         usable to detect unverifiable code, which is the expected
2731         use case.
2732
2733 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
2734
2735         * verify.h: Ops, commited the header with debug
2736         enabled.
2737
2738 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
2739
2740         * verify.c (merge_stack): Use the new value on unverifiable
2741         stack merges.
2742
2743         * verify.c (verify_type_compatibility_full): Comparison
2744         of nullable types can't use mono_class_is_assignable_from.
2745
2746         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
2747         that makes all verification errors be reported.
2748
2749         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
2750         mono_method_verify.
2751
2752 2008-05-05  Robert Jordan  <robertj@gmx.net>
2753
2754         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
2755         support for value types. See #386415.
2756
2757         * object.c: comments.
2758
2759         Code is contributed under MIT/X11 license.
2760
2761 2008-05-05  Martin Baulig  <martin@ximian.com>
2762
2763         * debug-mono-symfile.h
2764         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
2765         for old pre-terrania symbol files.
2766
2767 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
2768
2769         * mono-config.c: Add ppc64 architecture.
2770
2771         Code is contributed under MIT/X11 license.
2772
2773 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
2774
2775         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
2776           PPC64 uses function descriptors as well.
2777
2778         Code is contributed under MIT/X11 license.
2779
2780 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
2781
2782         * object.c (compute_class_bitmap): Ignore literal static fields.
2783
2784         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
2785         var has an invalid format.
2786         (describe_ptr): Add some sanity checks for the vtable.
2787         (add_nursery_frag): Clear unused nursery fragments.
2788         (major_collection): Clear all remaining nursery fragments.
2789
2790 2008-05-03  Robert Jordan  <robertj@gmx.net>
2791
2792         * image.c, metadata-internals.h: add thunk_invoke_cache.
2793
2794         * marshal.c, marshal.h: implement
2795         mono_marshal_get_thunk_invoke_wrapper ().
2796
2797         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
2798
2799         Code is contributed under MIT/X11 license.
2800
2801 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
2802
2803         * verify.c (do_leave): Empty the stack.
2804
2805 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
2806
2807         * class.c (mono_class_is_assignable_from): Variance
2808         doesn't work between reference and value types. For example,
2809         given type C<T+>, C<int32> is not assignable to C<object>.
2810         Break the argument checking loop on first error. 
2811
2812 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
2813
2814         * icall.c : base64_to_byte_array() needs some more strict
2815           check for sequence of '=' characters. Patch by Santa
2816           Marta (http://deee.g.hatena.ne.jp/santamarta).
2817
2818           Contributed under MIT/X11 license.
2819           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
2820
2821 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
2822
2823         * domain.c: Disable LoadLibrary support to fix Win32 build.
2824
2825         Code is contributed under MIT/X11 license.
2826
2827 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
2828
2829         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
2830         to help with cache behaviour.
2831
2832 2008-05-01  Miguel de Icaza  <miguel@novell.com>
2833
2834         * appdomain.c (mono_domain_from_appdomain): Add new accessor
2835         method. 
2836
2837 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
2838
2839         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
2840
2841 2008-05-01  Dick Porter  <dick@ximian.com>
2842
2843         * process.c (process_get_fileversion): Only pass 16 bits of
2844         language ID to VerLanguageName.  Fixes bug 381204.
2845
2846 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2847
2848         * verify.c (mono_method_verify): Fix the comparison
2849         operator for code bounds check.
2850
2851 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2852
2853         * verify.c (mono_method_verify): Check the bounds of
2854         all access of the code array.
2855
2856 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
2857
2858         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
2859
2860 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
2861
2862         * image.c (mono_image_strong_name_position): Fix return value when the rva is
2863         not valid.
2864
2865 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
2866
2867         * loader.c (mono_get_method_from_token, mono_method_signature): Add
2868         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
2869         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
2870         fixup main EXE images when using mono.exe for mixed-mode assembly support.
2871         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
2872         mono_runtime_load.
2873         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
2874         runtime initialization from metadata.
2875         * assembly.c: Remove obsolete ceGetModuleFileNameA.
2876         (mono_set_rootdir): Use mono_get_module_file_name.
2877         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
2878         handles.
2879         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
2880         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
2881         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
2882         MonoCLIImageInfo. Add support for module handles.
2883         (load_cli_header): Update mono_cli_rva_image_map signature.
2884         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
2885         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
2886         (mono_image_rva_map): Add support for module handles.
2887         (mono_image_ensure_section_idx): Add support for module handles.
2888         (mono_image_close): Add support for module handles.
2889         (do_load_header): Add support for module handles.
2890         (mono_image_open_from_module_handle): New function for internal use.
2891         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
2892         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
2893         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
2894         handles.
2895         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
2896         * image.h: Add mono_image_fixup_vtable.
2897         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
2898         support.
2899         * coree.h: New file.
2900         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
2901         unsupported native code.
2902         (mono_marshal_set_callconv_from_modopt): New function splitted from
2903         mono_marshal_get_managed_wrapper.
2904         (mono_marshal_get_managed_wrapper): Use
2905         mono_marshal_set_callconv_from_modopt.
2906         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
2907         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
2908         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
2909         that results in a deadlock when the runtime is loaded in _CorDllMain.
2910         * Makefile.am: Add coree.c and coree.h.
2911
2912         Contributed under MIT/X11 license.
2913
2914 2008-04-28  Mark Probst  <mark.probst@gmail.com>
2915
2916         * generic-sharing.c: Search for type arguments in array element
2917         types as well.
2918
2919 2008-04-28  Mark Probst  <mark.probst@gmail.com>
2920
2921         * class-internals.h, generic-sharing.c: New, small runtime generic context.
2922
2923         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
2924
2925         * object.c: Don't setup the RGCTX when the vtable is created,
2926         because we're setting it up lazily now.
2927
2928 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
2929
2930         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
2931         64 bit support.
2932
2933 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2934
2935         * verify.c (verify_class_for_overlapping_reference_fields): 
2936         If class is under fulltrust allow reference types to overllap
2937         if they have the same RVA.
2938
2939 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2940
2941         * pedump.c: Added new flag valid-only, that makes the verifier
2942         behaves just like --security=validil. It won't fail type load
2943         due to unverifiable restrictions.
2944
2945 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2946
2947         * class-internals.h (struct MonoMethod): Added a verification_success
2948         field to cache verifier executions. Reduced MonoMethod:slot size by
2949         one bit.
2950
2951 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
2952
2953         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
2954         instead of a 'vt' argument to save an indirection and to allow these to be used
2955         for valuetypes.
2956         (scan_vtype): New helper function to scan an area using a gc descriptor.
2957         (mono_gc_wbarrier_value_copy): Implement this.
2958         (handle_remset): Add support for REMSET_VTYPE.
2959         (find_in_remset_loc): Ditto.
2960         (mono_gc_base_init): Allow some debugging options to be controlled through the
2961         use of the MONO_GC_DEBUG env variable.
2962         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
2963         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
2964
2965 2008-04-23  Martin Baulig  <martin@ximian.com>
2966
2967         * domain.c (mono_domain_create): Move the call to
2968         mono_debug_domain_create() down, after allocating the domain id.
2969
2970 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2971
2972         verify.c (verify_class_for_overlapping_reference_fields): Skip
2973         static fields while verifying for overlapping fields as they
2974         don't matter at all.
2975
2976 2008-04-23  Marek Habersack  <mhabersack@novell.com>
2977
2978         * domain-internals.h: added a declaration of
2979         mono_make_shadow_copy.
2980
2981         * assembly.c (mono_assembly_open_full): shadow copying of
2982         assemblies moved to here, so that all the assemblies within the
2983         application domain's private binary directories can be
2984         processed. Fixes bug #380546
2985
2986         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
2987         mono_make_shadow_copy and made non-static. The decision whether
2988         to shadow-copy an assembly is made based on its location - it's
2989         copied if it's in one of the private application domain binary
2990         directories and its different to the target file in the shadow
2991         directory. Fixes bug #380546
2992
2993 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
2994
2995         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
2996
2997         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
2998         types.
2999
3000         * reflection.c (mono_image_create_token): Handle 
3001         Method/ConstructorOnTypeBuilderInst.
3002         (resolve_object): Ditto.
3003         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
3004         so it can be called from resolve_object. Also handle the case when the inflated
3005         class already has its methods setup.
3006
3007 2008-04-21  Martin Baulig  <martin@ximian.com>
3008
3009         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
3010
3011 2008-04-20  Geoff Norton  <gnorton@novell.com>
3012
3013         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
3014         pointer dereference.
3015
3016 2008-04-15  Marek Habersack  <mhabersack@novell.com>
3017
3018         * appdomain.c (try_load_from): if IOMAP is in effect, call the
3019         portability API to look up the assembly file. Fixes behavior in
3020         situations when the application has a bin/ directory, but the
3021         assembly search patch refers to Bin/ (and thus the requested file
3022         name is Bin/SomeLibrary.dll). Fixes bug #379888
3023
3024 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3025
3026         verify.c (mono_type_is_generic_argument): Extracted this check
3027         from a dozen places to here.
3028
3029         verify.c: Fixed all issues related to boxing generic arguments
3030         and their constraints.
3031
3032 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3033
3034         verify.c (mono_class_interface_implements_interface): Fix win32 build.
3035
3036 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
3037
3038         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
3039         isn't finished yet. Fixes #363447.
3040
3041 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
3042
3043         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
3044         Fixes #346419.
3045
3046 2008-04-13  Jb Evain  <jbevain@novell.com>
3047
3048         * domain.c: update the 2.1 profile versions.
3049         Merged from the Moonlight 2 branch.
3050
3051 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
3052
3053         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
3054         mscorlibs for the non-refonly case as well.
3055
3056         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
3057         in mono_assembly_load_from_full (). Fixes #378924.
3058
3059 2008-04-11  Geoff Norton  <gnorton@novell.com>
3060
3061         * icall.c: The global extern environ doesn't exist on Mac.  We
3062         need to call NSGetEnviron instead.
3063
3064 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3065
3066         verify.c: Add generic method constraint verification.
3067
3068 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3069
3070         class.c (mono_class_inflate_generic_method_full): Add a long
3071         explanation to the is_mb_open hack. Remove the FIXME.
3072
3073 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3074
3075         * verify.c (mono_method_verify): Mark all unknown opcodes
3076         as invalid. Mark jmp as unverifiable.
3077
3078 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3079
3080         * verify.c: Add code to do type constraint verification on class instances.
3081
3082         * verify.c (mono_verifier_verify_class): Use the type constraint 
3083         verification code.
3084
3085 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3086
3087         * class.c (mono_class_get_field_default_value): Don't pass cindex
3088         as hint to mono_metadata_get_constant_index. The local is not initialized
3089         and should contain garbage most of the time. This could only work
3090         with a lot of luck.
3091
3092 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
3093
3094         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
3095
3096 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
3097
3098         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
3099
3100         * class.c (mono_class_from_generic_parameter): Save the token of the
3101         generic param in MonoClass::sizes.generic_param_token.
3102
3103         * reflection.c (mono_custom_attrs_from_class): If the class type is
3104         VAR or MVAR retrieve the attributes of the generic param.
3105
3106 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3107
3108         * class.c (mono_class_init): Do class verification if the verifier
3109         is enabled.
3110
3111 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3112
3113         * verify-internal.h: Added mono_verifier_verify_class.
3114
3115         * verify.c: Added mono_verifier_verify_class. It checks for
3116         classes with explicit layout that have overlapping reference fields.
3117
3118         * pedump.c: Init the verifier state prior to verification. Fixed
3119         command line arguments.
3120
3121 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3122
3123         * Makefile.am: Added verify-internals.h, hopefully fix the build.
3124
3125 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
3126
3127         * verify-internals.h: Fix a warning.
3128
3129 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3130
3131         * verify-internals.h: New header with the verifier configuration
3132         extracted from mini.c.
3133
3134         * verify.c: Implemented the new functions exported by verify-internals.h.
3135
3136 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3137
3138         * verify.c: Add proper verification of ckfinite.
3139
3140 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
3141
3142         * verify.c (do_conversion): Improved error message to something
3143         more meanfull.
3144
3145         * verify.c (check_is_valid_type_for_field_ops): Fix to work
3146         with primitive types.
3147
3148 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
3149
3150         * verify.c: Added tail prefix checking. Marked icall
3151         as unverifible.
3152
3153 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
3154
3155         * verify.c: Fix the detection of branches to the middle
3156         of an instruction.
3157
3158 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
3159
3160         * verify.c: Implemented verification of volatile. and
3161         unaligned. prefix. Check if a type is valid after retrieving it.
3162
3163 2008-04-01  Dick Porter  <dick@ximian.com>
3164
3165         * process.c (process_get_fileversion): If there's no string block,
3166         set the file language to en_US.  Fixes the other new part of bug
3167         374600.
3168
3169 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
3170
3171         * class.c: New functions mono_method_can_access_field_full and
3172         mono_method_can_access_method_full. They perform type visibility
3173         and type site check.
3174
3175         * class-internal.h: Added exported functions.
3176
3177         * verify.c: Use new functions to implement proper visibility checks.
3178
3179 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
3180
3181         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
3182
3183 2008-03-28  Dick Porter  <dick@ximian.com>
3184
3185         * process.c (process_get_fileversion): Use the first language ID
3186         we see, rather than insisting on an invariant language.  Fixes bug
3187         374600.
3188
3189 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
3190
3191         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
3192         the streams to fix reading of invalid memory later.
3193
3194         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
3195         to ease debugging.
3196
3197 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
3198
3199         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
3200         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
3201
3202 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
3203         * threads.h: Added MonoThreadManageCallback type and
3204         mono_thread_set_manage_callback prototype
3205         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
3206         (used to store the mono_thread_manage callback).
3207         * threads.c: Added mono_thread_set_manage_callback, and handle
3208         "MonoThread->manage_callback" in build_wait_tids.
3209
3210 2008-03-26  Dick Porter  <dick@ximian.com>
3211
3212         * process.c (process_get_fileversion): Set FileVersionInfo strings
3213         to Empty when the resource doesn't have the particular info.
3214         Fixes bug 355717.
3215
3216 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
3217
3218         * verify.c (mono_method_verify): Proper prefix validation.
3219
3220 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
3221
3222         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
3223         itself in a separate argument instead of throwing them. Fixes #373448.
3224
3225         * appdomain.c: Bump corlib version.
3226
3227 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
3228
3229         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
3230
3231 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
3232
3233         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
3234         version macros.
3235
3236 2008-03-20  Mark Probst  <mark.probst@gmail.com>
3237
3238         * generic-sharing.c, class-internals.h: Code for putting
3239         reflection types into the runtime generic context.
3240
3241 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3242
3243         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
3244         Fixes #340662. 
3245
3246
3247 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
3248
3249         * verify.c (VerifyContext): Added instruction prefix data to the struct.
3250
3251         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
3252
3253         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
3254
3255         * verify.c (do_cast): Let the result value keep the boxed status.
3256
3257         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
3258
3259 2008-03-17  Jb Evain  <jbevain@novell.com>
3260
3261         * reflection.c: when running on a 2.0 runtime, emit
3262         unconditionally the #~ header version as 2.0, and the
3263         CLI header version as 2.5, for symmetry's sake with csc.
3264
3265 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
3266
3267         * class.c: Remove the unused cache_interface_offsets stuff.
3268
3269         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
3270         profiler.c: Fix warnings.
3271
3272 2008-03-16  Mark Probst  <mark.probst@gmail.com>
3273
3274         * generic-sharing.c, class-internals.h: Support for putting
3275         methods into the runtime generic context.
3276
3277 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
3278
3279         * class.c (mono_class_setup_fields): Ignore calls made to this function for
3280         classes which are generic instances of not-yet finished typebuilders. Fixes
3281         #351172.
3282
3283         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
3284
3285 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
3286
3287         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
3288
3289         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
3290         field, replace it with a hash table in MonoDynamicImage.
3291
3292         * reflection.c (inflate_mono_method): Access the generic definition object from
3293         image->generic_def_objects instead of imethod->reflection_info.
3294
3295         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
3296
3297         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
3298         
3299         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
3300         function in reflection.c so it is easier to keep in sync with the dynamic image
3301         creation code.
3302
3303         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
3304         mono_image_close ().
3305
3306 2008-03-15  Mark Probst  <mark.probst@gmail.com>
3307
3308         * class.c (mono_class_generic_sharing_enabled): Disable generic
3309         sharing for all architectures except AMD64 and x86 to fix build.
3310
3311 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
3312
3313         * verify.c: Use the generic definition MonoGenericContext when available.
3314         Remove code for checking generics instance compatibility in favor of
3315         mono_class_is_assignable_from.
3316
3317 2008-03-14  Mark Probst  <mark.probst@gmail.com>
3318
3319         * marshal.c, marshal.h, metadata-internals.h, image.c,
3320         wrapper-types.h: New wrapper for invoking a shared static method
3321         without having to pass the runtime generic context argument.
3322
3323 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
3324
3325         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
3326
3327 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
3328
3329         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
3330         
3331         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
3332         create a token from a FieldOnTypeBuilderInst.
3333         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
3334         (resolve_object): Ditto.
3335
3336         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
3337         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
3338
3339 2008-03-14  Martin Baulig  <martin@ximian.com>
3340
3341         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
3342
3343         * debug-mono-symfile.h
3344         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
3345         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
3346
3347 2008-03-10  Martin Baulig  <martin@ximian.com>
3348
3349         * debug-mono-symfile.h
3350         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
3351         `lexical_block_table_offset'.
3352         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
3353         `lexical_blocks'.
3354         (MonoSymbolFile): Added `version'.
3355
3356         * mono-debug.h
3357         (MonoDebugLexicalBlockEntry): Removed.
3358         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
3359         `lexical_blocks'.
3360
3361         * mono-debug.c (mono_debug_add_method): Don't compute lexical
3362         blocks here; the debugger now does this internally.
3363
3364 2008-02-27  Martin Baulig  <martin@ximian.com>
3365
3366         * object.c (mono_runtime_exec_main): Call
3367         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
3368         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
3369
3370 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
3371
3372         * verify.c (verify_type_compatibility_full): Allow native int to be converted
3373         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
3374
3375 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
3376
3377         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
3378         ldftn with a virtual method.
3379
3380 2008-03-13  Geoff Norton  <gnorton@novell.com>
3381
3382         * decimal.c:  Only include memory.h if the platform has it.
3383
3384 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
3385
3386         * assembly.c, class.c, metadata-internals.h: make sure public key
3387         tokesns are compared in a case-insensitive way. Also, all
3388         the lookups in the GAC use a lowercase public key token
3389         (gaacutil already does the lowercasing on install). Fixes
3390         bug #369541.
3391
3392 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
3393
3394         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
3395         and return value.
3396
3397 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
3398
3399         * image.c: when someone loads a mscorlib from a file, return the
3400         currently loaded mscorlib (fixes bug #369253).
3401
3402 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
3403
3404         * class.c: handle types with no parents by forcing them to have
3405         System.Object as a parent and marking them as broken (this currently
3406         allows the first part of bug #369173 to work as well, likely because
3407         we don't check for typeload exceptions everywhere yet).
3408
3409 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
3410
3411         * class.c: more complete check that types belong to corlib
3412         (fixes second part of bug #369173).
3413
3414 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
3415
3416         * generic-sharing.c:  Including glib.h for the MSVC builds to define
3417           "inline" to "__inline" before including mono-membar.h.
3418           
3419         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
3420           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
3421           MSVC builds.
3422
3423         Contributed under MIT/X11 license.
3424
3425 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
3426
3427         * verify.c (do_invoke_method): Remove return type validation.
3428
3429         * verify.c (do_ret): Do return type validation at return site instead of
3430         call site.
3431
3432 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
3433
3434         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
3435
3436         * verify.c: Some todos cleaned and improved a few error messages.
3437
3438 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
3439
3440         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
3441
3442 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
3443
3444         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
3445         system types correctly.
3446
3447         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
3448         function.
3449
3450 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
3451
3452         * assembly.c (build_assembly_name): Fix a warning.
3453
3454 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
3455
3456         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
3457         the called function takes an object type argument. Fixes storing or
3458         valuetypes across remoting as well as reducing memory usage.
3459         * image.c, metadata-internals.h: remove now unused ldfld_remote and
3460         stfld_remote wrapper caches.
3461
3462 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
3463
3464         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
3465         is not found.
3466
3467         * reflection.c (mono_image_register_token): New helper function to save
3468         a token->object mapping.        
3469
3470         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
3471         managed code.
3472
3473         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
3474         one dimension arrays. Fixes #367670.
3475         (mono_reflection_get_type_internal): Ditto.
3476
3477 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
3478
3479         * marshal.c: mono_load_remote_field_new() always returns object.
3480         so use the proper signature (fixes bug #366445).
3481
3482 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
3483         
3484         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
3485         add an 'inline_failure' flag instead.
3486
3487 2008-03-04  Mark Probst  <mark.probst@gmail.com>
3488
3489         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
3490         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
3491         contains the location of "this", used for exception handling.
3492
3493 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
3494
3495         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
3496         their size on all platforms for perf reasons.
3497
3498 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
3499
3500         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
3501         object-internal.h
3502
3503         * object-internal.h: Same.
3504
3505 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
3506
3507         * reflection.h: Fix the build I just broke.
3508
3509 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
3510
3511         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
3512         Test if a token is valid, this remove explicit usage of 
3513         MonoDynamicImage::tokens from the verifier code.
3514
3515         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
3516
3517         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
3518         instead of direct access to MonoDynamicImage::tokens.
3519
3520 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
3521
3522         * verify.c (token_bounds_check): Fix the build I just broke.
3523
3524 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
3525
3526         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
3527
3528         * verify.c (verifier_load_method): Fixed the errors message.
3529
3530         * verify.c (mono_method_verify): Fixed a debug message.
3531
3532 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
3533
3534         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
3535         mono-perfcounters.h, class-internals.h: support for predefined
3536         writable counters, query of categories and counters, bugfixes.
3537
3538 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
3539
3540         * verify.c (do_refanytype): Verify the refanytype opcode.
3541
3542         * verify.c (mono_method_verify): Use do_refanytype.
3543
3544 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
3545
3546         * verify.c (do_mkrefany): Verify the mkrefany opcode.
3547
3548         * verify.c (mono_method_verify): Use do_mkrefany.
3549
3550 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
3551
3552         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
3553         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
3554         implementation.
3555
3556 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
3557
3558         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
3559         the type load exception.
3560
3561 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
3562
3563         * verify.c: Added a few FIXME for method signatures
3564
3565         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
3566         of mono_method_get_signature and get vararg call working. Removed unused
3567         checks for return value.
3568
3569         * verify.c (do_refanyval): Verify the refanyval opcode.
3570
3571         * verify.c (mono_method_verify): Implemented verification of arglist and
3572         use do_refanyval.
3573
3574 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
3575
3576         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
3577         vtypes to marshal.c.
3578
3579         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
3580         it works for AOT as well.
3581
3582 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
3583
3584         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
3585         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
3586         the system time is adjusted.
3587
3588 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
3589
3590         * icall.c, icall-def.h: use the new time functions (fixes the
3591         non-monotonic behaviour of TickCount).
3592
3593 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
3594
3595         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
3596         it breaks the build.
3597         
3598         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
3599         cattr is not finished yet.
3600
3601 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
3602
3603         * verify.c: Proper token validation for field, method and type.
3604
3605 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
3606
3607         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
3608
3609         * loader.c (method_from_memberref): Generate type load error instead of method missing
3610         if the type is not found.
3611
3612 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
3613
3614         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
3615         some of the conversions caused the generation of a marshal directive exception.
3616
3617 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
3618
3619         verify.c: Report which exception should be thrown by the JIT.
3620         Added a lot of FIXME notes.
3621
3622 2008-02-22  Mark Probst  <mark.probst@gmail.com>
3623
3624         * generic-sharing.c: Runtime generic context slots are not
3625         instantiated on init anymore.  Instead, provide function to do the
3626         instantiating on demand.
3627
3628         * class-internals.h: Added vtable to runtime generic context.
3629         Macros for encoding direct and indirect slot offsets in one
3630         guint32.
3631
3632 2008-02-21  Mark Probst  <mark.probst@gmail.com>
3633
3634         * object.c, generic-sharing.c: Moved some generic sharing code
3635         from object.c to generic-sharing.c.
3636
3637         * generic-sharing.c: Added support for extensible runtime generic
3638         context.
3639
3640         * metadata-internals.h: Two new hash tables in MonoImage for
3641         extensible runtime generic context support.
3642
3643         * domain.c: Unregister generic vtables upon domain unloading.
3644
3645         * image.c: Destroy new hash tables upon image unloading.
3646
3647         * metadata.c: Unregister generic subclasses upon image unloading.
3648
3649         * class-internals.h: New data structure for runtime generic
3650         context template.  New fields in the runtime generic context for
3651         extensible part.
3652
3653         * Makefile.am: Added generic-sharing.c.
3654
3655 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
3656
3657         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
3658         there is a pending loader exception, raise it.
3659
3660         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
3661         same.
3662
3663         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
3664         same.
3665
3666         Fixes #363450.
3667
3668 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
3669
3670         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
3671
3672         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
3673         
3674         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
3675         ref-only requests for compatibility with MS.
3676
3677 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3678
3679         * reflection.c (mono_custom_attrs_from_method): Don't silently
3680         return an empty list for generic method instances.
3681         (mono_custom_attrs_from_param): Likewise.
3682
3683 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
3684             Raja R Harinath  <harinath@hurrynot.org>
3685
3686         Fix #354757
3687         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
3688         * class.c (mono_class_inflate_generic_method_full): Initialize it
3689         when a fully-open method is instantiated.
3690         * metadata.c (inflated_method_equal, inflated_method_hash): Update
3691         to new field.
3692         * reflection.c (inflate_mono_method): Don't create a temporary context.
3693
3694 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3695
3696         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
3697         Compute correct value, to prepare for imethod->reflection_info going away.
3698
3699 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
3700
3701         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
3702
3703 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
3704
3705         * verify.c: Implement skip visibility flag.
3706
3707 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
3708
3709         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
3710         which contains an extra field to tell the kind of exception that should be thrown.
3711
3712         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
3713
3714 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
3715
3716         * loader.c (mono_method_get_param_names): Initialize 'klass' after
3717         'method' is updated.
3718
3719 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
3720
3721         * class.c (mono_class_layout_fields): Set class->min_align for classes using
3722         explicit layout as well. Fixes #360375.
3723
3724 2008-02-11  Geoff Norton  <gnorton@novell.com>
3725
3726         * loader.c: Guard and dereference against inflated generic methods
3727
3728 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
3729
3730         * class.c: Include Retargetable spec in assembly name.
3731         * assembly.c: Always include PublicKeyToken spec in assembly name
3732         (with value "null" if assembly is not signed), and include
3733         Retargetable spec.
3734         * icall-def.h: Added icall for Assembly.get_fullname.
3735         * icall.c: Added icall returning the fullname of an assembly.
3736
3737 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
3738
3739         * class.c (mono_class_setup_vtable_general): Add a missing call to
3740         mono_class_setup_methods () which is needed in the AOT case.
3741
3742 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
3743
3744         * verify.c (mono_type_get_stack_name): Added. Return the name for the
3745         stack type of the given MonoType.
3746
3747         * verify.c (verify_type_compatibility_full): Handle the void type.
3748
3749         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
3750         way stack merging works.
3751
3752         * verify.c (store_local): Improved verification message.
3753
3754         * verify.c (do_branch_op): If the merging is invalid, the method
3755         is unverifiable and not invalid. Improved error message.
3756
3757         * verify.c (merge_stacks): Properly merge a boxed valuetype and
3758         a reference type diferent than System.Object. Improved error
3759         message.
3760
3761 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
3762
3763         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
3764
3765         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
3766         type of an enum even if the argument is byref.
3767
3768         * verify.c: Replace all explicit uses of enumtype and enum_basetype
3769         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
3770
3771         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
3772
3773         *verify.c (verify_type_compatibility_full): Make enum types
3774         compatible with their base types.
3775
3776         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
3777         types are compatible for the special case of a boxed valuetype and
3778         System.Object.
3779
3780         * verify.c (verify_stack_type_compatibility): The function
3781         is_compatible_boxed_valuetype was extracted from here.
3782
3783         * verify.c (push_arg): Only set ctx->has_this_store if the method
3784         is not static.
3785
3786         * verify.c (do_ldelem): Fixed a typo in an error message and added
3787         strict check for mixing int32 and native int as the array type
3788         and ldelem type.
3789
3790         * verify.c (merge_stacks): Consider boxed valuetypes in the
3791         compatibility checks.
3792
3793 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
3794         * profiler.h: (MonoGCEvent): Added start-stop the world events.
3795
3796 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
3797         *class.c: use_new_interface_vtable_code: renamed the env var to have
3798         a "MONO_" prefix, and fix the logic to enable it by default.
3799
3800 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
3801         *class.c:
3802         mono_class_setup_vtable_general: rewrote the way in which interface
3803         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
3804         makes the code more maintainable.
3805         For now the old code is still there, and can be activated setting
3806         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
3807
3808 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
3809
3810         * verify.c: guarded some debug functions around and #ifdef.
3811
3812         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
3813
3814 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
3815
3816         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
3817         changes for now since they seem to break too many things.
3818
3819 2008-02-05  Mark Probst  <mark.probst@gmail.com>
3820
3821         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
3822         mono_marshal_find_nonzero_bit_offset): Added macro and function
3823         for finding the byte- and bit-offset of a bitfield within a
3824         struct.
3825
3826 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
3827
3828         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
3829         (mono_marshal_get_struct_to_ptr): Ditto.
3830
3831         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
3832         cctor_signature.
3833
3834 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
3835
3836         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
3837         between methods for non-corlib types.
3838
3839 2008-02-02  Geoff Norton  <gnorton@novell.com>
3840
3841         * loader.c (mono_method_get_param_names): Populate the parameter name for 
3842         generic parameters as well. (Fixes #342536)
3843
3844 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
3845
3846         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
3847
3848         * verify.c (do_invoke_method): Fix for calling with byref structs.
3849
3850         * verify.c (do_cast): push a boxed value type based on the type token and not
3851         the type of stack.
3852
3853 2008-01-31  William Holmes  <billholmes54@gmail.com>
3854
3855         * process.c (process_module_string_read): Check the size returned form 
3856           VerQueryValue to avoid out of memory exception. 
3857
3858 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
3859
3860         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
3861         Handle properly modules which are not in the moduleref table. Fixes
3862         #356938.
3863
3864 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
3865
3866         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
3867         the dynamic case which is now in managed code.
3868         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
3869
3870         * marshal.c (mono_string_to_bstr): Fix a warning.
3871         (init_com_provider_ms): Ditto.
3872
3873         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
3874
3875         * exception.c (mono_get_exception_out_of_memory): New helper function.
3876
3877 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
3878
3879         * marshal.c: Add support for BSTR marshalling
3880         using other COM systems.
3881
3882         Code is contributed under MIT/X11 license.
3883
3884 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
3885
3886         * object.c (mono_runtime_invoke_array): reverted previous
3887         commit as it breaks the build.
3888
3889 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
3890
3891         * object.c (mono_runtime_invoke_array): Verify arguments for
3892         invalid types. Fixes #348522.
3893
3894 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
3895
3896         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
3897         non-final virtual calls using call. 
3898
3899         * verify.c (do_invoke): fixed some TODOs.
3900
3901         * verify.c (push_arg): set has_this_store for "ldarga 0".
3902
3903 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
3904
3905         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
3906         which belong to an inflated class. Fixes #356531.
3907
3908 2008-01-26  Robert Jordan  <robertj@gmx.net>
3909
3910         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
3911         which resort to FindFirstFile when a certain error condition
3912         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
3913         Code is contributed under MIT/X11 license.
3914
3915 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
3916
3917         * marshal.c (emit_marshal_string): Fix out string marshalling
3918         to use specified encoding. Fixes #323900.
3919
3920         Code is contributed under MIT/X11 license.
3921
3922 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
3923
3924         * class.c (mono_class_inflate_generic_method_full): Don't modify
3925         iresult->context after cache check.
3926
3927 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
3928
3929         * class.c (mono_class_inflate_generic_method_full): Change the
3930         struct assignments to memcpy for better visibility and add some comments.
3931
3932 2008-01-23  Dick Porter  <dick@ximian.com>
3933
3934         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
3935         procedure, and make it work on windows.
3936
3937 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
3938
3939         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
3940         a MonoReflectionTypeBuilder since it is always of that type.
3941
3942         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
3943
3944         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
3945
3946         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
3947         
3948         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
3949
3950         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
3951
3952         * reflection.c (mono_reflection_create_runtime_class): Remove already created
3953         instantiations from the type cache.
3954
3955 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
3956
3957         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
3958
3959         * verify.c (do_unbox_value): push a controled mutability managed pointer.
3960
3961 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
3962
3963         * verify.c (do_ldstr): added, verifies if the #US token is valid.
3964
3965         * verify.c (mono_method_verify): removed old TODO
3966
3967 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
3968
3969         * verify.c (do_newobj): add visibility check.
3970
3971 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
3972
3973         * verify.c (do_load_function_ptr): add visibility check.
3974
3975 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
3976         *class.c:
3977         mono_generic_class_get_class: hook profiler events.
3978         mono_field_get_offset: added to support heap-shot in the new profiler.
3979         *class.h: exported mono_field_get_offset.
3980         * reflection.c:
3981         mono_reflection_setup_internal_class: hook profiler events.
3982
3983 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
3984
3985         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
3986         argument here too and use it to avoid checking for pending exceptions if 
3987         possible.
3988
3989 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
3990
3991         * assembly.c (build_assembly_name): add arg for passing the assembly
3992         flags. Do not consider a PublicKey with value "null" valid.
3993         (mono_assembly_name_parse_full): added boolean argument that will be
3994         set if the assembly name contains a PublicKeyToken spec. Added support
3995         for the Retargetable spec for which only Yes or No are allowed as valid
3996         value. Consider assembly name invalid if Retargetable spec is set, but
3997         either version, culture or public key (token) are not specified.
3998         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
3999         with implementation in assembly.c.
4000         * icall.c (fill_reflection_assembly_name): also copy assembly flags
4001         from MonoAssemblyName.
4002         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
4003         introduced argument for mono_assembly_name_parse_full to know if the
4004         assembly name has a PublicKeyToken spec, and if it has instruct
4005         fill_reflection_assembly_name to use default value for keyToken (if
4006         PublicKeyToken is null).
4007
4008 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
4009
4010         * verify.c (mono_method_verify): fixed ovf ops with
4011         float values. They are unverifiable now.
4012
4013 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
4014
4015         * class.c (set_failure_from_loader_error): add BadImageException to the
4016         list of exceptions that can cause a type to fail to load.
4017
4018         * class.c (mono_class_get_exception_for_failure): same.
4019
4020 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
4021
4022         * verify.c (in_any_exception_block): added, check if offset
4023         is part of any exception handling clause.
4024
4025         * verify.c (get_stack_type): added VAR and MVAR types.
4026
4027         * verify.c (do_stobj): better error messages.
4028
4029         * verify.c (do_cpobj): added, check cpobj.
4030
4031         * verify.c (do_initobj): added, check initobj.
4032
4033         * verify.c (do_sizeof): added, check sizeof.
4034
4035         * verify.c (do_localloc): added, check localloc.
4036
4037         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
4038
4039 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
4040
4041         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
4042         save_lmf/restore_lmf opcodes.
4043
4044         * threads.c (mono_threads_install_notify_pending_exc): New function to
4045         install a callback notifying the JIT there is a pending exception on a thread.
4046         (mono_thread_request_interruption): Call the new callback.
4047         (mono_thread_get_and_clear_pending_exception): New function to return the
4048         exception pending on a thread.
4049
4050         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
4051         to turn off checking for pending exceptions.
4052         (mono_marshal_get_native_wrapper): Ditto.
4053
4054 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4055
4056         * threads-types.h: Get rid of the unnecessary extern declarations.
4057
4058 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
4059
4060         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
4061         return field from parent class if not private.
4062         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
4063         returns fields from parent class if they are not private.
4064         (method_nonpublic): added function to determine if a given method
4065         should be considered non-public. Returns false for private methods
4066         on parent class, and internal methods from parent on the 1.0 profile.
4067         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
4068         use method_nonpublic function to determine whether method should be
4069         returned.
4070         (property_accessor_public): use newly introduced method_nonpublic
4071         function to determine whether accessor is non-public. 
4072         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
4073         event from parent class if not private. Only return static event if
4074         Static flag is set, and only return static event from parent class if
4075         FlattenHierarchy flag is set.
4076         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
4077         include non-private events from parent class.
4078
4079 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4080
4081         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
4082         warning.
4083
4084 2008-01-16  Wade Berrier <wberrier@novell.com>
4085
4086         * security.c: Add assembly.h header to appease some warnings
4087
4088 2008-01-16  Dick Porter  <dick@ximian.com>
4089
4090         * process.c (process_module_string_read): Remove trailing null
4091         when saving string.
4092
4093 2008-01-16  Mark Probst  <mark.probst@gmail.com>
4094
4095         * class-internals.h: A new data structure describing the layout of
4096         a runtime generic context (MonoRuntimeGenericContextTemplate).
4097
4098         * metadata-internals.h: Added a hash table to MonoDomain that maps
4099         from open generic classes to their runtime generic context
4100         templates.
4101
4102         * object.c: Building of the runtime generic context, including
4103         proper handling of generic type arguments of superclasses.
4104         Building of the runtime generic context according to the template.
4105
4106 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
4107
4108         * class.c (mono_class_setup_fields): Set field.count for generic instances.
4109         Fixes #350856.
4110
4111         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
4112         mono_portability_find_file (). Fixes #325466.
4113         (mono_image_get_public_key): Fix a warning.
4114
4115 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
4116
4117         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
4118         Fixes #353550.
4119         (mono_class_from_name_case): Ditto.
4120
4121 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
4122
4123         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
4124           common storage for the tables used in the System/NumberFormatter class.
4125
4126 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
4127
4128         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
4129
4130 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
4131
4132         * verify.c (get_boxable_mono_type): check if the token is valid.
4133
4134         * verify.c (set_stack_value): changed to add an error if an
4135         invalid type is set on stack. Changed all callers due to signature change.
4136
4137         * verify.c (do_stobj): implement stobj validation.
4138
4139 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
4140
4141         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
4142         set container->is_method, it was set earlier.
4143
4144         * metadata.c (type_in_image): Handle MVARs which belong to not finished
4145         generic methods.
4146
4147         * reflection.c (mono_reflection_initialize_generic_parameter): Set
4148         is_method of the generic container to TRUE for methods.
4149
4150 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
4151
4152         * metadata.c (type_in_image): Handle type parameters properly.
4153
4154         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
4155         memory ownership of this structure.
4156
4157 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
4158
4159         * verify.c (get_boxable_mono_type): make typedref types been just
4160         unverifiable. check for void type.
4161
4162         * verify.c (do_unbox_any): added, verify opcode unbox.any.
4163
4164         * verify.c (do_load_function_ptr): accept method spec tokens.
4165
4166 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
4167
4168         * marshal.c (mono_class_native_size): Always set *align even if this is called
4169         recursively.
4170
4171 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
4172
4173         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
4174         out-of-date.
4175
4176 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
4177
4178         * verify.c: removed some old unused tables. A huge bunch of small fixes
4179         to things found while testing the verifier with mono basic.
4180
4181         * verify.c (dump_stack_value): dump null literal flag to.
4182
4183         * verify.c (verify_type_compatibility_full): fix comparison
4184         for types that have a generic super type.
4185
4186         * verify.c (verify_stack_type_compatibility): fix compatibility
4187         between null literals and reference types. fix compatibility between
4188         boxed valuetypes and object. fix corner case test for enums.
4189
4190         * verify.c (do_cmp_op): proper verification of cgt.un in case
4191         of reference types.
4192
4193         * verify.c (do_invoke_method): fix error message.
4194
4195         * verify.c (do_store_indirect
4196
4197         * verify.c (check_is_valid_type_for_field_ops): proper verification
4198         of managed pointers to valuetypes and boxed valuetypes. proper verification
4199         of null literals.
4200
4201         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
4202         allow token to be a reference type.
4203
4204         * verify.c (do_cast): proper handling of boxes valuetypes.
4205
4206         * verify.c (do_stelem): proper handling of storing a boxed valuetype
4207         in object[].
4208
4209         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
4210         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
4211         fixed the decoding of unbox_any
4212
4213 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
4214
4215         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
4216
4217 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
4218
4219         * verify.c (do_newobj): do delegate verification.
4220
4221         * verify.c (verify_delegate_compatibility): perform delegate
4222         verification.
4223
4224         * verify.c (verify_ldftn_delegate): perform tests related to
4225         ldftn delegates.
4226
4227         * verify.c (mono_delegate_signature_equal): perform the
4228         slightly diferent signature comparison required by delegates.
4229
4230         * metadata.c (mono_metadata_type_equal_full): added and exported
4231         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
4232         allows signature only comparison.
4233
4234         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
4235         as MONO_INTERNAL.
4236
4237 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
4238
4239         * verify.c: added a bunch of stack_slot_* functions to
4240         make access to stack slot type easier. This is required to
4241         allow optional flags, like null literal, boxed value and
4242         this pointer.
4243         All access paths to IlStackDesc::stype have been changed 
4244         to use these new funcions.
4245         Removed a bunch of unused functions and cleared all warnings.
4246         This patch introduces the usage of the this pointer and 
4247         boxed value flags.
4248
4249 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
4250
4251         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
4252
4253 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
4254
4255         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
4256         match managed version.
4257
4258         * appdomain.c: Bump corlib version.
4259         
4260         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
4261         argument.
4262
4263 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
4264
4265         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
4266         Set public key token to zero-length byte array if assembly is not
4267         strongnamed.
4268
4269 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
4270
4271         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
4272         writing a vtype array elem.
4273
4274 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
4275
4276         * assembly.c (build_assembly_name): return FALSE if length of token is
4277         not 16 (if not "null").
4278         (mono_assembly_name_parse_full): return FALSE if value of version,
4279         culture, token or key is 0.
4280         * icall.c (fill_reflection_assembly_name): add boolean arguments to
4281         specify whether public key and public key token must be set to default
4282         value (zero-length byte array) if not available. Set versioncompat to
4283         SameMachine. If public key is available or the default is set, then
4284         set PublicKey flag.
4285         (ves_icall_System_Reflection_Assembly_FillName): if no public key
4286         is available, use empty byte array as default value. On the 2.0
4287         profile, use default value for public key token if not set.
4288         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
4289         profile, use default value for public key if not set. On the 2.0
4290         profile, use default value for public key token if not set.
4291         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
4292         default values for public key and public key token.
4293
4294 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
4295
4296         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
4297         field to keep it in synch with the managed object.
4298
4299         * marshal.c (emit_marshal_object): Add support for byref marshalling of
4300         delegates. Fixes #351520.
4301
4302         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
4303         contains defined memory.
4304         
4305         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
4306
4307         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
4308         
4309         * sgen-gc.c (check_consistency): New helper function to do a consistency check
4310         of the GC data structures.
4311
4312         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
4313
4314         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
4315         
4316         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
4317         barrier.
4318         (mono_array_clone_in_domain): Ditto.
4319         (mono_array_clone_in_domain): Ditto.
4320
4321         * threads.c (start_wrapper): Register the thread start argument as a GC root.
4322         (cache_culture): Use a write barrier.
4323
4324         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
4325         (ves_icall_get_property_info): Ditto.
4326
4327         * object.h (MONO_STRUCT_SETREF): New macro.
4328
4329         * class-internals.h (MonoStats): Add some GC statistics.
4330
4331         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
4332
4333 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
4334
4335         * exception.c (mono_exception_from_name_two_strings):
4336         Break from loop after method is found.
4337
4338 2008-01-04  Dick Porter  <dick@ximian.com>
4339
4340         * process.c (process_module_string_read): Rename variable to
4341         reflect correct usage, after fixing bug 345972.
4342
4343 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
4344
4345         * verify.c (mono_type_create_fnptr_from_mono_method): 
4346         created a MonoType function pointer instance to be used during
4347         verification. The verifier releases this memory at end.
4348
4349         * verify.c (mono_method_is_constructor): extracted repeated
4350         checks for constructor into a single class.
4351
4352         * verify.c (do_push_field): use new extracted method
4353         for constructor check.
4354
4355         * verify.c (do_newobj): same.
4356
4357         * verify.c (do_ldftn): renamed to do_load_function_ptr
4358         and make it verify ldvirtftn too.
4359
4360         * verify.c (mono_method_verify: proper verification
4361         of ldvirtftn. release created MonoMethod instances.
4362
4363 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
4364
4365         * verify.c (token_bounds_check): added.
4366
4367         * verify.c (do_ldftn): added.
4368
4369         * verify.c (mono_method_verify): proper verificartion of ldftn.
4370
4371 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
4372
4373         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
4374         than the table row count. It's the resposibility of the caller to
4375         make the bounds check and raise the correct error.
4376
4377         * metadata.c (mono_metadata_decode_row_col): Same.
4378
4379         * loader.c (mono_get_method_from_token): perform bounds check
4380         on token for methoddef table.
4381
4382 2007-12-29  Miguel de Icaza  <miguel@novell.com>
4383
4384         * icall.c
4385         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
4386         assert into a negative result, the managed code already coped with
4387         that.
4388
4389         Some folks on Windows reported this error. 
4390
4391 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
4392
4393         * appdomain.c: Bump corlib version.
4394         * icall.c:
4395         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
4396         CultureInfo.CreateCulture to create CultureInfo for name.
4397         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
4398         create CultureInfo for name. Fixes bug #347174.
4399
4400 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
4401
4402         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
4403         flags.
4404
4405         * verify.c (is_valid_branch_instruction): allow branching to the
4406         first instruction of the protected block.
4407
4408         * verify.c (is_valid_cmp_branch_instruction): same.
4409
4410         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
4411         avoid double initialization.
4412
4413         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
4414         detect which cases the eval stack should just be copied.
4415
4416         * verify.c (mono_method_verify): check if the eval stack
4417         is empty when entering a protected block.
4418
4419 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
4420
4421         * verify.c: added is_clause_in_range, is_clause_inside_range,
4422         is_clause_nested and verify_clause_relationship. They perform
4423         the verifications stated in P1 12.4.2.7.
4424
4425         * verify.c (mono_method_verify): remove some unused variables,
4426         add the new exception clause checks, add instruction border
4427         checks for protected block start/end, improved some error 
4428         messages and fixed a bug in the way invalid instruction access
4429         is detected.
4430
4431 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
4432
4433         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
4434         from GC 7.0 if available.
4435
4436         * object.c: Remove an unused define.
4437         
4438         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
4439
4440         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
4441
4442         * null-gc.c (mono_gc_make_descr_for_array): Implement.
4443
4444         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
4445
4446         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
4447         to take the same arguments as the other make_descr functions.
4448
4449         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
4450
4451         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
4452         directly.
4453
4454         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
4455         mini.c.
4456
4457         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
4458         call to boehm-gc.c.
4459
4460         * boehm-gc.c (mono_gc_register_root): Fix a warning.
4461
4462         * null-gc.c (mono_gc_register_root): Fix a warning.
4463
4464         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
4465
4466         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
4467         (mono_gc_base_init): Call GC_init ().
4468
4469         * null-gc.c: Define mono_gc_register_root () as a no-op.
4470
4471         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
4472
4473 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
4474
4475         * verify.c: add prototype for merge_stacks at top
4476
4477         * verify.c (do_switch): added.
4478
4479         * verify.c (merge_stacks): on some cases the stack merging
4480         was not happening properly. Unequal stack sizes at merge
4481         points should be invalid.
4482
4483         * verify.c (mono_method_verify): added more debug info on stack state.
4484         verify switch properly.
4485
4486 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
4487
4488         * method-builder.h: New file, moved the mono_mb_ declarations here from 
4489         marshal.h.
4490
4491         * boehm-gc.c marshal.c: Include method-builder.h.
4492
4493         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
4494
4495         * marshal.c: Remove some code which is now in method-builder.c.
4496
4497 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
4498
4499         * method-builder.c: New file, extraction of the method builder functionality 
4500         from marshal.c.
4501
4502         * marshal.c: Move the mb functions into method-builder.c.
4503
4504         * marshal.h marshal.c: Export some mono_mb_... functions.
4505
4506         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
4507
4508         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
4509         the caller.
4510
4511         * class.c (mono_class_get_full): Check the token type in the dynamic case.
4512
4513         * loader.c (mono_field_from_token): Ditto.      
4514
4515         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
4516         type as well.
4517         
4518         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
4519         Fixes #342565.
4520
4521         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
4522         a helper function for setting it.
4523
4524         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
4525
4526         
4527         * assembly.c: Significally simplify code now that referenced assemblies are 
4528         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
4529
4530         * threads.h: Don't include  the internal threads-types.h header file. Fixes
4531         #349952.
4532
4533 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
4534
4535         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
4536         instructions that were target of branches or are at protected block boundaries.
4537
4538         * verify.c (in_same_block): handle filter clauses.
4539
4540         * verify.c (is_valid_branch_instruction): added. checks the target of
4541         instructions br or brtrue/false.
4542
4543         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
4544         binary branch instructions such as beq and bge.
4545
4546         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
4547         and made it pin the instruction as been part of the exception block.
4548
4549         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
4550         of in_same_block.
4551
4552         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
4553         of in_same_block.
4554
4555         * verify.c (do_ret): ret from a protected block is unverifiable and
4556         not invalid.
4557
4558         * verify.c (do_static_branch): verify br and br.s instructions.
4559
4560         * verify.c (merge_stacks): add extra param to support detection
4561         of branches in the middle of instructions.
4562         
4563         * verify.c (mono_method_verify): verify branches and exception blocks
4564         that target the middle of instructions. Proper verification of br and br.s.
4565
4566 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
4567
4568         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
4569         skip_visibility field.
4570         (reflection_methodbuilder_from_dynamic_method): Ditto.
4571
4572         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
4573         registrations. Fixes #348193.
4574
4575         * threads.h: Move the internal mono_thread_get_pending_exception () to
4576         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
4577
4578 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
4579
4580         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
4581         icall registration. Fixes #348193.
4582
4583         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
4584         for corlib classes into object. Fixes #349621.
4585
4586 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
4587
4588         * icall.c (property_accessor_nonpublic): new function to determine
4589         whether an accessor allows a property to be considered non-public.
4590         Returns false for private accessor(s) from parent class, and internal
4591         accessor(s) from parent on 2.0 profile (and higher).
4592         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
4593         to determine whether property should be included if NonPublic flag
4594         is set. Fixes bug #349078.
4595
4596 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
4597
4598         * verify.c (init_stack_with_value): added.
4599
4600         * verify.c (mono_method_verify): extracted common
4601         code for exception initialization into init_stack_with_value.
4602
4603         * verify.c (mono_method_verify): initialize the exception
4604         for handler clauses as well.
4605
4606         * verify.c (mono_method_verify): fix the exception clause
4607         ordering rules, it should use handler end offset and not
4608         start offset.
4609
4610 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
4611
4612         * rawbuffer.c: remove useless warning.
4613
4614 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
4615
4616         * threads.h, threads-types.h: move functions to the correct header
4617         (fixes bug#349952).
4618
4619 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
4620
4621         * verify.c (mono_method_verify): proper verification
4622         of exception handling clauses ranges and fallthru in
4623         and out of protected blocks.
4624
4625 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
4626
4627         * verify.c (mono_method_verify): fixed compilation issue.
4628
4629 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
4630
4631         * verify.c (mono_method_verify): a printf slipped in, changed
4632         to use verifier debug macro.
4633
4634 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
4635
4636         * verify.c (is_correct_leave): check for filter clauses.
4637
4638         * verify.c (do_filter): added.
4639
4640         * verify.c (mono_method_verify): property verification of leave.
4641
4642
4643 2007-12-18  Mark Probst  <mark.probst@gmail.com>
4644
4645         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
4646         Win32 build, until we figure out how to do the proper thing on
4647         Win32.
4648
4649 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
4650
4651         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
4652         by the previous patch.
4653         
4654         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
4655         the assembly resolve handler for refonly assemblies.
4656
4657 2007-12-17  Mark Probst  <mark.probst@gmail.com>
4658
4659         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
4660         Make sure only one thread is allowed to commence shutdown, and
4661         don't allow new threads to be started once shutdown is in
4662         progress.
4663
4664 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
4665
4666         * verify.c (is_correct_endfilter): added.
4667
4668         * verify.c (is_unverifiable_endfilter): added.
4669
4670         * verify.c (do_endfilter): added.
4671
4672         * verify.c (mono_method_verify): property verification of endfilter
4673         and fixed a corner case or endfinally.
4674
4675 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
4676
4677         * verify.h: new flags to support fail fast of unverifiable code and
4678         do non-strict verification. Non-strict verification is required to
4679         have MS runtime compatibility. There are a huge amount of unverifiable
4680         code that it accepts as verifiable. The strict mode verifies the code
4681         as the specs says.
4682         Non-strict mode will be required in cases where code needs to be
4683         accepted as verifiable but fails under strict mode.
4684
4685         * pedump.c: added support to fail fast and non-strict verification.
4686
4687         * verify.c: added support for both fail fast and non-strict verification.
4688
4689 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
4690
4691         * verify.c (is_correct_endfinally): added.
4692
4693         * verify.c (mono_method_verify): property verification of endfinally.
4694
4695 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
4696
4697         * verify.c (in_any_block): check for filter clauses.
4698
4699         * verify.c (is_correct_rethrow): added.
4700
4701         * verify.c (mono_method_verify): property verification of rethrow.
4702
4703         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
4704
4705 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
4706
4707         * verify.c (do_throw): added.
4708
4709         * verify.c (mono_method_verify): property verification of throw
4710
4711 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
4712
4713         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
4714         assemblies. Fixes #346425.
4715
4716 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
4717
4718         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
4719         FieldBuilders.
4720
4721         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
4722
4723         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
4724         prevent asserts when this is called with a token which might not be valid.
4725
4726         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
4727         lookup_dynamic_token_class with valid_token == FALSE.
4728
4729         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
4730
4731         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
4732
4733         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
4734         
4735 2007-12-10  Mark Probst  <mark.probst@gmail.com>
4736
4737         * gc.c: Don't delay threadpool thread finalization unless Mono is
4738         shutting down.
4739
4740 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
4741
4742         * threads.c: turn an assert into a non-fatal warning.
4743
4744 2007-12-09  Robert Jordan  <robertj@gmx.net>
4745
4746         * icall.c (GetVirtualMethod): Add missing argument validation.
4747
4748 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
4749
4750         * verify.c (do_cast): added.
4751
4752         * verify.c (mono_method_verify): property verification of castclass and isinst.
4753
4754
4755 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
4756
4757         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
4758
4759         * verify.c (do_stelem): added.
4760
4761         * verify.c (mono_method_verify): property verification of stelem.X.
4762
4763 2007-12-07  Mark Probst  <mark.probst@gmail.com>
4764
4765         * class.c, class-internals.h: Introduce an environment variable
4766         (MONO_GENERIC_SHARING) through which the extent of generic code
4767         sharing can be controlled (share all classes, share only corlib
4768         classes, or share nothing).
4769
4770         * object.c: Only create runtime generic context for classes for
4771         which sharing is enabled.
4772
4773 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
4774
4775         * verify.c (do_ldelem): refactor it to work with ldelem.any.
4776
4777         * verify.c (mono_method_verify): property verification of ldelem.any.
4778
4779 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
4780
4781         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
4782         added ldelem.X opcodes.
4783
4784         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
4785
4786         * verify.c: proper verification of ldelem.X 
4787
4788 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
4789
4790         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
4791
4792 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
4793
4794         * verify.c (mono_method_verify): null literal requires special handling,
4795         the value pushed on stack need to be flagged as so.
4796
4797         * verify.c (do_ldelema): Verify ldelema properly.
4798
4799 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
4800
4801         * verify.c: Verify ldlen properly.
4802
4803 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
4804
4805         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
4806         to the target object's type. Fixes #346160.
4807
4808 2007-12-05  Dick Porter  <dick@ximian.com>
4809
4810         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
4811         Solaris needs the same workaround as BSD-derived systems.  Fixes
4812         bug 323524, patch by Burkhard Linke
4813         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
4814
4815 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
4816
4817         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
4818         handle to use when error dialog is shown; otherwise, update mask
4819         to show no error dialog when an error occurs.
4820
4821 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
4822
4823         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
4824
4825         * class.c (mono_class_get_field_default_value): New helper function to initialize
4826         field->def_type and field->data.
4827
4828 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
4829
4830         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
4831         the general one.
4832
4833         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
4834
4835         * marshal.c: Avoid depending on delegate->method_info being set.
4836
4837         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
4838         
4839         * object.c (mono_delegate_ctor): Set delegate->method.
4840
4841         * object-internals.h (struct _MonoDelegate): Add 'method' field.
4842
4843         * appdomain.c: Bump corlib version.
4844
4845 2007-11-27  Raja R Harinath  <harinath@gmail.com>
4846
4847         * metadata.c (mono_generic_inst_equal_full): Short-circuit
4848         equality check if we're comparing canonicalized MonoGenericInsts.
4849
4850 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
4851
4852         * class.c (generic_array_methods): Call mono_class_setup_methods () before
4853         accessing class->methods.
4854
4855 2007-11-22  Dick Porter  <dick@ximian.com>
4856
4857         * threads.c: Ensure that the synch_cs is set before trying to use
4858         it.
4859
4860 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
4861
4862         * profiler.c: r89126 broke the statistial profiler, unbreak.
4863
4864 2007-11-22  Martin Baulig  <martin@ximian.com>
4865
4866         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
4867
4868         * mono-debug.c
4869         (mono_debug_debugger_version): Bump to 3.
4870         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
4871         -> mono_debugger_class_initialized().
4872
4873         * mono-debug-debugger.c
4874         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
4875
4876         * class.c
4877         (mono_debugger_start_class_init_func): Removed.
4878         (mono_debugger_class_loaded_methods_func): Added.
4879         (mono_class_setup_methods): Call it here.
4880
4881 2007-11-22  Martin Baulig  <martin@ximian.com>
4882
4883         * mono-debug.c
4884         (mono_debug_add_delegate_trampoline): New public method.
4885         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
4886
4887         * mono-debug.h
4888         (MonoSymbolTable): Added `global_data_table'.
4889         (MonoDebuggerTypeKind): Removed.
4890
4891 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
4892
4893         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
4894         these methods.
4895
4896         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4897         
4898 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
4899
4900         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
4901
4902 2007-11-20  Martin Baulig  <martin@ximian.com>
4903
4904         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
4905
4906         * mono-debug-debugger.c
4907         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
4908         (mono_debugger_remove_breakpoint): Likewise.
4909         (mono_debugger_check_breakpoints): Likewise.
4910         (mono_debugger_register_class_init_callback): New public method.
4911         (mono_debugger_remove_class_init_callback): Likewise.
4912         (mono_debugger_add_type): Likewise.
4913
4914         * mono-debug-debugger.h
4915         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
4916
4917 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
4918
4919         * class.c: more interface implementations needed for the
4920         array enumerator (fixes bug #341112).
4921
4922 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
4923
4924         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
4925         fix ParamName of ArgumentNullExceptions.
4926
4927 2007-11-17  Miguel de Icaza  <miguel@novell.com>
4928
4929         * reflection.c (mono_reflection_encode_sighelper): Generate the
4930         modopts and modreqs.   I have a useless test that crashes monodis,
4931         but that shows the code working.
4932
4933 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
4934
4935         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
4936         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
4937
4938 2007-11-15  Dick Porter  <dick@ximian.com>
4939
4940         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
4941         When joining a thread, it's the thread that's calling Join that
4942         gets WaitSleepJoin state not the target.  Fixes the standalone
4943         test case in bug 334740, and hopefully the whole bug too.
4944
4945 2007-11-15  Dick Porter  <dick@ximian.com>
4946
4947         * process.c: Read file version info from the files pointed at by
4948         process modules, not the current process.  Fixes bug 315969.
4949
4950         Use windows typedef names in some places to fix warnings on the
4951         windows build.
4952
4953 2007-11-15  Mark Probst  <mark.probst@gmail.com>
4954
4955         * image.c, metadata-internals.h: Added a generic_class_cache hash
4956         to MonoImage for looking up generic classes when sharing generics.
4957
4958 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
4959
4960         * sgen-gc.c: warning cleanups.
4961
4962 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
4963
4964         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
4965         inherited properties.
4966
4967 2007-11-14  Mark Probst  <mark.probst@gmail.com>
4968
4969         * object.c, class-internals.h: Added more information to the
4970         runtime generic context.
4971
4972 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
4973
4974         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
4975         instead of just the target method. Generalize the abstract method handling to
4976         handle any non-static method.
4977
4978         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
4979         mono_marshal_get_delegate_invoke () signature change.
4980
4981 2007-11-13  Mark Probst  <mark.probst@gmail.com>
4982
4983         * class.c, class-internals.h: Made
4984         mono_type_get_basic_type_from_generic () public.  Fixed member
4985         access check for shared generics.
4986
4987         * loader.c: Don't insert field into field cache if it's part of a
4988         non-inflated generic class.
4989
4990         * domain.c, domain-internals.h: The generic sharing context is now
4991         part of the jit info data structure.  Added two accessor
4992         functions.
4993
4994 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
4995
4996         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
4997         the array Get/Set/Address methods, since the JIT inlines them.
4998
4999         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
5000
5001         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
5002         (mono_image_init): Initialize runtime_invoke_direct_cache.      
5003
5004         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
5005         mono_marshal_get_delegate_invoke signature change.
5006
5007         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
5008         an additional argument. Add support for invoking abstract methods.
5009
5010         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
5011
5012         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
5013
5014 2007-11-09  Mark Probst  <mark.probst@gmail.com>
5015
5016         * class.c: Do field layout for open generic classes as well.
5017
5018 2007-11-09  Mark Probst  <mark.probst@gmail.com>
5019
5020         * gc.c, gc-internal.h: Don't finalize threadpool threads with
5021         other objects, because the threadpool is still around.  Put them
5022         in a list instead and after finalizing all other objects in the
5023         root domain shut down the thread pool and then finalize the
5024         threads.  Fixes bug #337383.
5025
5026         * threads.c, thread-types.h: New mono_thread_create_internal()
5027         function for marking a thread with the threadpool flag before it
5028         started.  Set synch_cs to NULL after freeing it.
5029
5030         * threadpool.c: Mark threadpool threads before they start.
5031
5032 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
5033
5034         * reflection.h, reflection.c: don't export random functions
5035         and lazy load dbnull and missing objects.
5036
5037 2007-11-07  Jonathan Chambers <joncham@gmail.com>
5038
5039         * class.c: Initialize COM types if COM interfaces
5040         are present (not just COM classes).
5041         
5042         Code is contributed under MIT/X11 license.
5043
5044 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
5045         * reflection.c:
5046         create_dynamic_mono_image: hook module profiler events (dynamic case).
5047         mono_image_basic_init: hook assembly profiler events (dynamic case).
5048
5049 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
5050         * profiler.c:
5051         simple_appdomain_unload: completely terminate the profiler
5052         instead of only processing the statistical samples.
5053         simple_shutdown: make sure this is really called exactly once,
5054         even in multithreaded applications, and always listen to
5055         appdomain events.
5056         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
5057         here, the "[un]load" functions will do it.
5058         Fixes bugs #333791 and #325261.
5059
5060 2007-11-07  Geoff Norton  <gnorton@novell.com>
5061
5062         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
5063         rather than depend on __APPLE__.
5064
5065 2007-11-07  Mark Probst  <mark.probst@gmail.com>
5066
5067         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
5068
5069 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
5070
5071         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
5072         UTF16 MonoString. Fix the crash from bug #335488
5073
5074 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
5075
5076         * marshal.c: Correct (for non-Win32 OS) length != size in 
5077         mono_string_from_bstr. Fix #339530.
5078
5079 2007-11-06  Geoff Norton  <gnorton@novell.com>
5080
5081         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
5082         to succeed
5083
5084 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
5085
5086         * process.c: Added run-time GetProcessId API detection for Windows.
5087
5088 2007-11-04  Miguel de Icaza  <miguel@novell.com>
5089
5090         * reflection.c  (mono_param_get_objects): If a parameter has the
5091         attribute [System.Runtime.InteropServices.Optional] we should
5092         set the DefaultValue of the ParameterInfo to be
5093         System.Reflection.Missing instead of DBNull.
5094
5095         See bug #339013.
5096
5097         (mono_get_reflection_missing_object): New method,
5098         returns the System.Reflection.Missing.Value singleton instance.
5099
5100 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
5101
5102         * culture-info-table.h : regenerated.
5103
5104 2007-11-02  Jonathan Chambers <joncham@gmail.com>
5105
5106         * icall.c: Use GetEnvironmentStrings on windows
5107         so we are using the same environment block as 
5108         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
5109         #333740.
5110         
5111         Code is contributed under MIT/X11 license.
5112
5113 2007-10-31  Martin Baulig  <martin@ximian.com>
5114
5115         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
5116
5117         * mono-debug-debugger.h
5118         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
5119
5120 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
5121
5122         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
5123         classes.
5124
5125 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
5126
5127         * culture-info-table.h : regenerated.
5128
5129 2007-10-30  Robert Jordan  <robertj@gmx.net>
5130
5131         * icall-def.h, icall.c:
5132         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
5133
5134         Code is contributed under MIT/X11 license.
5135
5136 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
5137
5138         * class.c (mono_class_setup_vtable): Find the inflated methods in the
5139         inflated class instead of inflating them again.
5140         
5141         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
5142         dynamic case.
5143
5144         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
5145         Call setup_supertypes () after klass->parent is set.
5146         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
5147
5148         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
5149         for inflated instances of not yet created dynamic generic classes.
5150         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
5151         times from inflated_method.
5152         (methodbuilder_to_mono_method): Ditto.
5153
5154 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
5155
5156         * gc.c: code cleanup and removed old untested option of not creating the
5157         finalizer thread.
5158
5159 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
5160
5161         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
5162         creating a jump trampoline for dynamic methods.
5163
5164 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
5165
5166         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
5167         generic TypeBuilders when called from another method of the same type (bug #335131).
5168
5169
5170 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
5171
5172         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
5173         doesn't seem to work perfectly.
5174         
5175         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
5176         called multiple times.
5177         (methodbuilder_to_mono_method): Ditto.
5178         (resolve_object): Inflate FieldBuilder's.
5179
5180 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
5181
5182         * string-icalls.c, string-icalls.h, appdomain.c: patch from
5183         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
5184         RemoveEmptyEntries in the string.Split implementation (bug #322375).
5185
5186 2007-10-26  Dick Porter  <dick@ximian.com>
5187
5188         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
5189         Thread initialisation changes
5190
5191 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
5192
5193         * verify.c: fix compatibility check between arrays and System.Array
5194
5195 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
5196
5197         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
5198         too. Fixes #336999.
5199
5200 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
5201
5202         * object.c (mono_value_box): Use typed allocation here.
5203
5204 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
5205
5206         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
5207         trampoline instead of compiling the method right away.
5208
5209         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
5210
5211 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
5212
5213         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
5214         related fields for dynamic classes. Fixes #334493.
5215
5216 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
5217
5218         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
5219         
5220         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
5221
5222         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
5223         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
5224
5225         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
5226
5227         * reflection.c (create_generic_typespec): Initialize klass->generic_container
5228         if needed.
5229         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
5230
5231 2007-10-18  Jonathan Chambers <joncham@gmail.com>
5232
5233         * marshal.c: Use correct key when removing item
5234         from ccw_hash.
5235         
5236         Code is contributed under MIT/X11 license.
5237
5238 2007-10-17  William Holmes  <billholmes54@gmail.com>
5239
5240         *marshal.c: Adding a case to marshal booleans to U1
5241
5242         Code is contributed under MIT/X11 license.
5243
5244 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
5245
5246         * class.c (mono_class_from_name): Search the modules compromising dynamic
5247         assemblies. Fixes #331601.
5248
5249 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
5250
5251         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
5252         exception if the type name contains an assembly component. Fixes #334203.
5253
5254         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
5255         modules inside dynamic assemblies. Fixes #334200.
5256         
5257         * reflection.c: Set image->public_key and image->public_key_length;
5258
5259         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
5260         fields.
5261
5262         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
5263         
5264 2007-10-16  Mark Probst  <mark.probst@gmail.com>
5265
5266         * metadata.c: Implemented correct comparing of generic classes.
5267         An inflated generic class can be equal to a non-inflated one if it
5268         is inflated with generic type variables as type arguments.  Fixes
5269         bug #333798.
5270
5271 2007-10-15  Dick Porter  <dick@ximian.com>
5272
5273         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
5274         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
5275         81646.
5276
5277         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
5278         instead of a monitor lock.  This means that monitor_try_enter and
5279         co can set the thread state safely.
5280         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
5281         thread_interrupt_requested, so interrupt actually works.
5282
5283         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
5284         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
5285         state accessor function
5286
5287 2007-10-15  Martin Baulig  <martin@ximian.com>
5288
5289         * mono-debug.h
5290         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
5291         the debugger with the current runtime.
5292
5293 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
5294
5295         * object.c, object-internals.h: added the ability to set a single
5296         trampoline for all the slots in a vtable.
5297
5298 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
5299
5300         * marshal.c: deal with a possible race condition during multicast
5301         delegate invocation.
5302
5303 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
5304
5305         * class.c: ensure value type methods don't have the synchronized
5306         flag set.
5307
5308 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
5309
5310         * string-icalls.c, string-icalls.h: reverted unapproved patch that
5311         breaks the build.
5312
5313 2007-10-11  Joel Reed  <joelwreed@comcast.com>
5314
5315         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
5316         to take an options parameter so that empty entries can be removed during
5317         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
5318
5319 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
5320
5321         * marshal.c: make sure we don't store the signature from a dynamic
5322         method into the runtime invoke cache (bug #327189).
5323
5324 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
5325
5326         * marshal.c: make sure the wrapper methods are properly initialized.
5327
5328 2007-10-11  Mark Probst  <mark.probst@gmail.com>
5329
5330         * metadata.c, metadata-internals.h: Generalized
5331         mono_type_stack_size() to mono_type_stack_size_internal() which
5332         takes an additional argument specifying whether it allows open
5333         types.
5334
5335 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
5336
5337         * verify.c (do_invoke_method): handle typedbyref params
5338         correctly and check for unverifiable return values.
5339
5340         * verify.c (do_newobj): fix a warning.
5341
5342 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
5343
5344         * verify.c: don't tread typedbyref as allways unverifable,
5345         so uses, like (ld/st)loc.0 are valid. verify for the cases
5346         that it matters, like boxing related operations.
5347
5348 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
5349
5350         * verify.c: add verification of the newobj opcode. verification
5351         of delegate instantation still missing due ldftn and virldftn not
5352         pushing the function type on stack
5353
5354 2007-10-08  Mark Probst  <mark.probst@gmail.com>
5355
5356         * class-internals.h: Runtime generic context data structure
5357         definition.
5358
5359         * object.c: Initialization of runtime generic context at runtime
5360         vtable creation time.
5361
5362 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
5363         * class.c (mono_class_create_from_typedef,
5364         mono_class_from_generic_parameter, mono_ptr_class_get,
5365         mono_fnptr_class_get, mono_bounded_array_class_get)
5366         * domain.c (mono_domain_create, mono_domain_free)
5367         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
5368         * image.c (do_mono_image_load, mono_image_close):
5369         Hooked up load-unload profiler events.
5370
5371 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
5372
5373         * domain.c: track statistics about the actual amount of native code
5374         allocated.
5375
5376 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
5377
5378         * class.c: the valuetype enumerators don't have the additional
5379         supertypes interfaces.
5380
5381 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
5382
5383         * class.c: need more interfaces setup for the IEnumerator<T>
5384         object created for arrays (tests/ienumerator-interfaces.2.cs).
5385
5386 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
5387
5388         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
5389
5390 2007-10-05  Alp Toker  <alp@atoker.com>
5391
5392         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
5393         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
5394         #315863.
5395
5396 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
5397
5398         * verify.c (verify_type_compatibility_full): verification of
5399         compatibility improved, validates correctly non-strict checks between
5400         native int and I4 types different than (unsigned)int32.
5401
5402         * verify.c (do_store_indirect): added, do all verification of
5403         ldind.X opcodes. 
5404
5405         * verify.c (get_load_indirect_mono_type): renamed to
5406         get_indirect_op_mono_type, as it now returns the MonoType for 
5407         ldind.X and stind.X opcodes.
5408
5409 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
5410
5411         * reflection.c: Fix the encoding of generic type definition for
5412         TypeBuilders.
5413
5414         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
5415         mono_image_typedef_or_ref but allows to specify if typespec lookups should
5416         be made. Typespec check is done prior to typeref cache lookup.
5417
5418         * reflection.c (mono_image_typedef_or_ref): now just delegate to
5419         mono_image_typedef_or_ref_full.
5420
5421         * reflection.c (encode_generic_class): encode the generic class
5422         directly instead of calling encode_type.
5423
5424         * reflection.c (encode_type): encode the generic type definition
5425         MonoClass as a generic instantiation.
5426
5427         * reflection.c (create_typespec): cache typespec tokens in
5428         the assembly->typespec cache. Don't create typespec for a generic
5429         instance MonoClass. Create typespec for the generic type defintion.
5430
5431         * reflection.c (create_generic_typespec): encode the generic
5432         class directly instead of calling encode_type.
5433
5434         * reflection.c (mono_image_create_token): encode the generic
5435         type definition not using a typespec for MonoType instances.
5436
5437
5438 2007-10-04  Raja R Harinath  <rharinath@novell.com>
5439
5440         Fix #328812
5441         * class.c (mono_image_init_name_cache): Don't return nested
5442         'protected internal' classes.
5443         (mono_class_from_name_case): Likewise.
5444
5445 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
5446
5447         * icall-def.h, icall.c : get_bundled_machine_config() is now the
5448           common function used by both DefaultConfig in System.dll and
5449           InternalConfigurationHost in System.Configuration.dll.
5450
5451 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
5452
5453         * class.c: automatically add to vectors only a few essential explicit
5454         generic interfaces. The rest of the interfaces that arrays should
5455         provide are currently implicitly added (but still not lazily, see the
5456         design in the discussion of bug#325495 for the details of what is
5457         needed for that). Additionally, implicit interfaces are assigned the
5458         same vtable slot as the explicit interfaces (as they are compatible):
5459         this enables huge memory savings since we don't need to instantiate
5460         as many memthods and as large vtables anymore. Also, Since
5461         GetEnumerator<T> returns an instance of a type that is required to
5462         support a similarly large set of interfaces as arrays, we add
5463         implicit interfaces and interface offset sharing support to those
5464         types, too. This change adds all the required interfaces so that
5465         the anonarray.cs test case in the bug report works (we don't add
5466         all the interfaces to arrays of arrays 3-level deep and more because
5467         of the memory requirements explained in the bug and since they are much
5468         less common: the lazy-loading support will enabled them to work, too).
5469
5470 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
5471
5472         * verify.c (merge_stacks): major clean up, all type compatibility
5473         checks are done by verify_type_compatibility. This fix my earlier lack
5474         of understanding of the CLR type system and merge_stacks no longer looks
5475         scary.
5476
5477         * verify.c: fixed some bad spelling.
5478
5479 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
5480
5481         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
5482         a given stack slock.
5483         
5484         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
5485         verify_type_compatibility_full. This removed a near indentical function and fixed
5486         handling of Int32 and IntPtr across all opcodes.
5487
5488 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
5489
5490         * class.c: only vectors have the additional generic interfaces.
5491
5492 2007-10-01  Jonathan Chambers <joncham@gmail.com>
5493
5494         * mono-config.c: Use g_strcasecmp instead of
5495         strcasecmp like everywhere else to fix
5496         compilation with MSVC.
5497         
5498         Code is contributed under MIT/X11 license.
5499
5500 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
5501
5502         * object.c, object-internals.h: refactored the IMT code to enable
5503         building a single slot at a time and lazily creating the IMT trampolines
5504         and thunks.
5505
5506 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
5507
5508         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
5509
5510         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
5511         Fixes #328501.
5512         
5513 2007-09-29  Raja R Harinath  <harinath@gmail.com>
5514
5515         * loader.c (method_from_methodspec): Rearrange to avoid
5516         un-necessary exposition.  Don't assert out if the method's
5517         declaring type is a generic type definition.
5518
5519 2007-09-28  Martin Baulig  <martin@ximian.com>
5520
5521         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
5522
5523 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
5524
5525         * class-internals.h: optimize field layout of MonoClass to
5526         requires less cachelines at runtime and save a few bytes on 64 bit
5527         systems.
5528
5529 2007-09-28  Jb Evain  <jbevain@novell.com>
5530
5531         * reflection.c: when encoding type names in custom attributes,
5532         if the type is a closed generic type, its generic arguments
5533         have to be serialized as AssemblyQualifiedName, so that when
5534         they are deserialized, it's possible to re-create them properly.
5535         Fixes #329450.
5536
5537
5538 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
5539
5540         * object.c, class-internals.h: added delegate-creation counter.
5541
5542 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
5543
5544         * class.c: cleanup of the code that synthetizes interfaces for
5545         arrays in 2.0: saves quit a bit of corlib mempool memory.
5546         Code to fix bug #325495 ifdeffed out for now until the issues
5547         with memory usage and O(n^2) behaviour are fixed.
5548
5549 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
5550
5551         * marshal.c: when possible, do not duplicate the name of the methods
5552         in the method builder and in the generated MonoMethod.
5553
5554 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
5555         * verify.c: added support for type checking ldind_* opcodes.
5556
5557 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
5558
5559         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
5560         which is used to distinguish the fully open instantiation of a TypeBuilder
5561         with the rest. This temporary hack is required to restore the property that
5562         the fully open instantiation is the same type of the generic type definition.
5563
5564         * class-internals.h (mono_generic_class_is_generic_type_definition):
5565         new function as part of the internal API.
5566
5567         * class.c (inflate_generic_type): return NULL when the generic inst is
5568         fully open. The fully open generic type is now the same as the generic type
5569         definition for non TypeBuilder types.
5570
5571         * class.c (mono_generic_class_get_class): removed assert since it is
5572         no longer valid, gklass->cached_class can point to the generic type definition.
5573
5574         * class.c (mono_generic_class_is_generic_type_definition): new.
5575
5576         * metadata.c (mono_generic_class_hash): added is_tb_open field
5577         to the hash calculation.
5578
5579         * metadata.c (free_generic_class): if the generic class is associated
5580         with the generic type definition, its field will come from the mempool and
5581         must not be freed.
5582
5583         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
5584         new, this function identifies the corner case of a TypeBuilder fully open
5585         instantiation.
5586
5587         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
5588         for lookup. Set gclass->cached_class to be the container class in case of
5589         the fully open instantiation of non TypeBuilder types.
5590
5591         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
5592         to compare generic classes.
5593
5594         * reflection.c (method_encode_methodspec): remove assert that
5595         no longer is valid.
5596
5597         * reflection.c (mono_reflection_generic_class_initialize): add
5598         an aditional assert to ensure the proper type is used.
5599
5600 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
5601
5602         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
5603         to enjoy it.
5604
5605 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
5606
5607         * verify.c (push_arg): Fixed support for ldarga
5608         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
5609         MonoType used as first arg in case of instance calls.
5610
5611 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
5612
5613         * verify.c: Support for verifying VAR and MVAR types, 
5614
5615 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
5616
5617         * icall.c (ves_icall_get_property_info): Set the reflected type of the
5618         accessors correctly.
5619
5620 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
5621
5622         * threads.c: support OSX and other systems in
5623         mono_thread_get_stack_bounds (bug #328026).
5624
5625 2007-09-25  Martin Baulig  <martin@ximian.com>
5626
5627         * mono-debug.h
5628         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
5629
5630 2007-09-24  Martin Baulig  <martin@ximian.com>
5631
5632         * mono-debug.h
5633         (MonoDebugClassEntry): Moved the definition of this struct into
5634         mono-debug.c to make it private.
5635
5636         * mono-debug.c
5637         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
5638         type table per symbol file, we don't need to store the symfile id
5639         any longer.
5640
5641 2007-09-24  Martin Baulig  <martin@ximian.com>
5642
5643         Create one type table per symbol file, since a `MonoClass *' gets
5644         invalid when its image is unloaded.
5645
5646         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
5647         (MonoDebugHandle): Added `type_table'.
5648
5649 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
5650
5651         * mempool.c, mempool.h: added mono_mempool_new_size () API
5652         to be able to specify a smaller initial size for the pool.
5653         Adjusted the code to slowly increase pool size before using
5654         the previous default size.
5655         * image.c: use a small initial size for image mempools.
5656
5657 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
5658
5659         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
5660         Fixes ##320990.
5661
5662         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
5663         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
5664
5665 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
5666
5667         * metadata.c (mono_type_create_from_typespec): Remove an invalid
5668         free. Fixes #327438.
5669
5670 2007-09-21  Raja R Harinath  <harinath@gmail.com>
5671
5672         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
5673         generic instantiations, etc.
5674         <MONO_TYPE_ARRAY>: Likewise.
5675
5676 2007-09-21  Martin Baulig  <martin@ximian.com>
5677
5678         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
5679         these structs were never defined.
5680         (MonoDebugHandle): Removed the `_priv' field, it was never used.
5681
5682 2007-09-21  Martin Baulig  <martin@ximian.com>
5683
5684         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
5685
5686 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
5687
5688         * image.c: removed the guid hash tables: we can get the same info
5689         without the additional memory usage hit (partially fixes also bug #327052).
5690
5691 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
5692
5693         * profiler.h, profiler-private.h, profiler.c: add a new profiler
5694         event to handle unloading methods. After the event is called, the
5695         corresponding MonoMethod* must be considered invalid.
5696         * loader.c (mono_free_method): call the new mono_profiler_method_free
5697         event.
5698
5699 2007-09-20  Mark Probst  <mark.probst@gmail.com>
5700
5701         * domain-internals.h: New flag in MonoJitInfo which marks shared
5702         generic methods.  New hash table (shared_generics_hash) in
5703         MonoDomain to keep track of shared generic methods.  Prototypes
5704         for functions to register and lookup shared generic methods.
5705
5706         * domain.c: Support for registering and looking up shared generic
5707         methods via a hash table (shared_generics_hash) in MonoDomain.
5708
5709         * class-internals.h: New exception to signal failure of shared
5710         compilation of a generic method.  New counters for generics
5711         sharing in MonoStats.
5712
5713 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
5714
5715         * image.c, metadata-internals.h: don't keep a file descriptor open
5716         for loaded assemblies (bug#325988).
5717
5718 2007-09-19  Raja R Harinath  <rharinath@novell.com>
5719
5720         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
5721         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
5722         use the corresponding datatypes.
5723         (type_in_image): Update to changes.
5724         (CleanForImageUserData): Simplify.
5725         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
5726         Avoid quadratic behaviour in handling the "stolen" list by
5727         separating the filter predicate out, and by prepending the stolen
5728         items rather than appending them.
5729         (steal_ginst_in_image): Likewise.
5730         (mono_metadata_clean_for_image): Update to changes.
5731
5732 2007-09-19  Martin Baulig  <martin@ximian.com>
5733
5734         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
5735
5736 2007-09-19  Martin Baulig  <martin@ximian.com>
5737
5738         * mono-debug.c (mono_debug_cleanup): Don't call
5739         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
5740
5741 2007-09-19  Raja R Harinath  <harinath@gmail.com>
5742
5743         Fix crash on 'make run-test' in mcs/errors
5744         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
5745         Avoid more potential allocations in mono_class_from_mono_type.
5746         (ginst_in_image): Update to changes.
5747         (gclass_in_image): Rearrange slightly.
5748
5749 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
5750
5751         * class.c (mono_class_init): Move the code that sets up class->methods to 
5752         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
5753
5754         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
5755         canonical instance of an inflated generic signature.
5756         (mono_type_create_from_typespec): Remove an invalid free.
5757
5758         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
5759
5760 2007-09-18  Marek Habersack  <mhabersack@novell.com>
5761
5762         * domain-internals.h: added a declaration of the
5763         mono_assembly_load_full_nosearch internal function.
5764
5765         * assembly.c (mono_assembly_load_with_partial_name): use
5766         mono_try_assembly_resolve return value properly.
5767         (mono_assembly_load_full_nosearch): copied the function body from
5768         mono_assembly_load_full, without the code to invoke assembly
5769         search hooks.
5770         (mono_assembly_load_full): calls the above new function and if the
5771         assembly is not resolved, invokes the search hooks.
5772
5773         * appdomain.c (mono_runtime_init): restore the global postload
5774         assembly search handlers.
5775
5776 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
5777
5778         * class.c (mono_class_init): Make sure class->methods and class->properties
5779         are never NULL in the generics case.
5780
5781         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
5782
5783 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
5784
5785         * metadata.c (free_generic_class): Disable some code to fix the build.
5786
5787         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
5788
5789         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
5790         from the image mempool.
5791
5792         * metadata.c (free_generic_class): Free more data from the inflated class.
5793
5794         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
5795
5796         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
5797         mempool.
5798         (mono_type_create_from_typespec): Ditto.
5799
5800         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
5801         MonoImage to the caller.
5802         (mono_init_internal): Save the opened image in a global variable.
5803         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
5804
5805         * reflection.c (resolve_object): Fix a leak.
5806
5807         * metadata.c: Fix the freeing of data in the generics caches.
5808         
5809         * metadata.c (free_generic_inst): Comment this out to fix the build.
5810         (free_generic_class): Ditto.
5811
5812         * metadata.c: Free cached generic methods, instantinations and classes when
5813         they are removed from the caches.
5814         (mono_metadata_free_type): Free the type itself.
5815
5816         * class.c: Free the result of mono_class_inflate_generic_type () in a few
5817         places.
5818
5819 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
5820
5821         * boehm-gc.c: restrict managed allocs to __thread supporting
5822         architectures.
5823
5824 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
5825
5826         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
5827         (mono_generic_class_get_class): Fix a leak.
5828
5829         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
5830         mono_metadata_free_type ().
5831         (mono_metadata_inflate_generic_inst): Fix a leak.
5832
5833 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
5834
5835         * mono-debug.c (free_header_data): Fix a leak missed earlier.
5836
5837         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
5838         mempool.
5839
5840         * mono-debug.c (mono_debug_close_image): Fix call to 
5841         g_hash_table_remove ().
5842
5843 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
5844
5845         * icall-def.h: redirect all the string ctor to the managed
5846         CreateString () methods.
5847         * string-icalls.c, string-icalls.h: removed dead code for string
5848         ctors and icalls.
5849
5850 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
5851
5852         * mono-debug.c: Fix memory leaks.
5853
5854 2007-09-14  Jonathan Chambers <joncham@gmail.com>
5855
5856         * threads-types.h: Implement mono_hazard_pointer_set and 
5857         mono_hazard_pointer_clear macros using do/while(0) to fix
5858         compilation with MSVC.
5859         
5860         Code is contributed under MIT/X11 license.
5861
5862 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
5863
5864         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
5865         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
5866
5867 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
5868
5869         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
5870         icalls.
5871
5872 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
5873
5874         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
5875         managed-code allocated as well.
5876
5877 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
5878
5879         * class.c (mono_class_is_assignable_from): Add support for generic variance.
5880
5881 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
5882
5883         * boehm-gc.c: fixed the build after the AOT changes.
5884
5885 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
5886
5887         * wrapper-types.h: Add an ALLOC wrapper type.
5888
5889         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
5890         reference managed allocator methods.
5891
5892 2007-09-12  Marek Safar  <marek.safar@gmail.com>
5893
5894         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
5895         of Type array and not MonoType, a fix suggested by Hari.
5896         
5897 2007-09-12  Jonathan Chambers <joncham@gmail.com>
5898
5899         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
5900         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
5901         
5902         Code is contributed under MIT/X11 license.
5903
5904 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
5905
5906         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
5907
5908 2007-09-12  Marek Habersack  <mhabersack@novell.com>
5909
5910         * image.c (do_mono_image_open): if assembly file fails to open and
5911         MONO_IOMAP is in effect, try to find the path in a
5912         case-insensitive way.
5913
5914         * appdomain.c (mono_runtime_init): do not install postload hooks -
5915         tests show that MS.NET doesn't use anything of that sort to
5916         trigger the AppDomain.AssemblyResolve event.
5917         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
5918         made non-static.
5919         (mono_runtime_init): init portability helpers here.
5920
5921         * assembly.c (mono_assembly_load_with_partial_name): if other   
5922         attempts fail, trigger the AppDomain.AssemblyResolve event handler
5923         to resolve the assembly.
5924
5925         * domain-internals.h: added mono_try_assembly_resolve and marked
5926         it as internal.
5927
5928 2007-09-11  Jb Evain  <jbevain@novell.com>
5929
5930         * object-internals.h (MonoReflectionDynamicMethod): add
5931         a `MonoReflectionType *owner` field. The owner is used
5932         * reflection.c:
5933         (mono_reflection_create_dynamic_method): use the owner of the dynamic
5934         method as the class declaring the dynamic method.
5935         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
5936         dynamic method to the declaring type of the methodbuilder.
5937
5938 2007-09-11  Mark Probst  <mark.probst@gmail.com>
5939
5940         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
5941         rules for calling methods via reflection.
5942
5943 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
5944
5945         * reflection.c (resolve_object): Add support for MonoGenericClass. 
5946         Inflate MonoType's.
5947
5948 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
5949
5950         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
5951         provide a managed method that does fast allocations without needing
5952         a managed->unmanaged transition. Boehm GC implementation currently
5953         enabled for ptrfree objects on sane architectures.
5954
5955 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
5956
5957         * marshal.c, marshal.h: exported a couple of useful functions and
5958         added mono_mb_get_label () to easily handle backward branches.
5959
5960 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
5961
5962         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
5963
5964 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
5965
5966         * loader.c (find_method): Fixed the regression introduced while
5967         fixing bug #81466.
5968
5969 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
5970
5971         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
5972         well.
5973         
5974         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
5975         icall.c reflection.c: Pass a MonoGenericContext argument to 
5976         mono_lookup_dynamic_token ().
5977
5978         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
5979         #82744.
5980         
5981 2007-09-09  Robert Jordan  <robertj@gmx.net>
5982
5983         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
5984         for generic methods.
5985
5986         * object.c (mono_object_get_virtual_method): Handle generic methods.
5987         Fixes bug #78882.
5988
5989         Code is contributed under MIT/X11 license.
5990
5991 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
5992
5993         * image.c: fix locking in mono_image_load_file_for_image ().
5994
5995 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
5996
5997         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
5998         used only as a cache: added an icall to fill it.
5999
6000 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
6001
6002         * reflection.h: exposed mono_reflection_free_type_info
6003         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
6004         since mono_reflection_bind_generic_parameters makes a copy of it.
6005         * reflection.c (free_type_info): subinfos should be freed.
6006         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
6007         made non static.
6008         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
6009         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
6010         this fixes #82695 and #81726.
6011    
6012
6013 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
6014
6015         * process.h, process.c:  added support for user profile/info in
6016           ProcessStartInfo. For now only Windows works.
6017
6018 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
6019
6020         * metadata.c: consider the generic arguments when comparing
6021         signatures (bug #82614).
6022
6023 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
6024
6025         * cil-coff.h, image.c: updated assembly loader to cope with the
6026         PE32+ 64 bit file format.
6027
6028 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
6029
6030         * assembly.c, class.c, domain.c, loader.c: remove useless
6031         inclusion of cil-coff.h.
6032
6033 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
6034
6035         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
6036         if interface is marked with CoClassAttribute. 
6037    
6038         Code is contributed under MIT/X11 license.
6039
6040 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
6041
6042         * sgen-gc.c: ensure no object from the to space is copied again or finalized
6043         if it's seen twice in major collections.
6044
6045 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
6046
6047         * sgen-gc.c: big objects are not copied to the gray area, but they
6048         need to be considered for scanning, too, if they are brought alive
6049         by an object ready for finalizations or a survived one.
6050
6051 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6052
6053         * sgen-gc.c: properly account the number of disappearing links when
6054         they are nullified.
6055
6056 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
6057
6058         * sgen-gc.c: share the code to scan the registered roots between the
6059         different types of collections.
6060
6061 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
6062
6063         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
6064
6065 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
6066
6067         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
6068         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
6069
6070 2007-08-28  Mark Probst  <mark.probst@gmail.com>
6071
6072         * security-manager.c (mono_security_manager_get_methods):
6073         LinkDemandSecurityException now has 2 arguments instead of 3.
6074
6075 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
6076
6077         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
6078         platforms which need it.
6079
6080 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
6081
6082         * sgen-gc.c: unregister thread data structures with a pthread_key_t
6083         dtor.
6084
6085 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
6086
6087         * threads.c: free the thread static data on thread exit.
6088
6089 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
6090
6091         * class.c: walk the hierarchy to find the generic definition for
6092         a class (fixes runtime part of bug #82498).
6093
6094 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
6095
6096         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
6097         ...
6098
6099         * image.c (mono_image_close): Here. Hopefully fixes #82510.
6100
6101 2007-08-24  Mark Probst  <mark.probst@gmail.com>
6102
6103         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
6104
6105 2007-08-24  Robert Jordan  <robertj@gmx.net>
6106
6107         * appdomain.c: don't perform the ':'->';' substitution on Win32.
6108
6109 2007-08-24  Jb Evain  <jbevain@novell.com>
6110
6111         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
6112         for byref types.
6113
6114 2007-08-24  Mark Probst  <mark.probst@gmail.com>
6115
6116         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
6117         #82286.
6118
6119 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
6120
6121         * assembly.c: Fix a warning.
6122         
6123 2007-08-23  Marek Habersack  <mhabersack@novell.com>
6124
6125         * appdomain.c: parse the <runtime> section looking for the probing
6126         element with the 'privatePath' attribute, which sets additional
6127         directories in which the runtime should look for assemblies.
6128
6129 2007-08-23  Robert Jordan  <robertj@gmx.net>
6130
6131         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
6132         Fixes #82499.
6133
6134 2007-08-23  Martin Baulig  <martin@ximian.com>
6135
6136         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
6137         _mono_debug_init_corlib() and remove it from the header file.
6138
6139 2007-08-23  Martin Baulig  <martin@ximian.com>
6140
6141         * mono-debug-debugger.c
6142         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
6143         don't notify the debugger about it.
6144
6145         * mono-debug-debugger.h
6146         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
6147
6148 2007-08-23  Robert Jordan  <robertj@gmx.net>
6149
6150         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
6151         Code is contributed under MIT/X11 license.
6152
6153 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
6154
6155         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
6156
6157 2007-08-22  Martin Baulig  <martin@ximian.com>
6158
6159         * mono-debug.c: Store debugging info on a per-domain basis and
6160         free it on domain unload.  Add support for unloading symbol files.
6161
6162         * mono-debug.h
6163         (MonoDebugList): New typedef.
6164         (MonoSymbolTable):
6165         - add `data_tables and `type_table'.
6166         - replace 'symbol_files' and `num_symbol_files' with a
6167           `MonoDebugList *'.
6168         (mono_debug_data_table): Removed.
6169         (mono_debug_list_add): New public function.
6170         (mono_debug_list_remove): New public function.
6171         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
6172         (mono_debug_init_2_memory): Renamed into
6173         mono_debug_open_image_from_memory().
6174         (mono_debug_close_image): New public function.
6175         (mono_debug_domain_create): Likewise.
6176         (mono_debug_domain_unload): Likewise.
6177         (MONO_DEBUGGER_VERSION): Bump to 60.
6178
6179         * mono-debug-debugger.h
6180         (MonoDebuggerEvent):
6181         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
6182         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
6183         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
6184         - rename `THREAD_CREATED' and `THREAD_EXITED' into
6185           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
6186         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
6187           meaning.
6188         (mono_debugger_add_symbol_file): Removed.
6189         (mono_debugger_add_type): Removed.
6190         (mono_debugger_lookup_type): Removed.
6191         (mono_debugger_lookup_assembly): Removed.
6192
6193         * domain.c
6194         (mono_domain_create): Call mono_debug_domain_create().
6195         (mono_init_internal): Call mono_debug_init_corlib().
6196
6197         * assembly.c
6198         (mono_assembly_close): Call mono_debug_close_image().
6199
6200 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
6201
6202         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
6203         mmap call.
6204
6205 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
6206
6207         * sgen-gc.c: ensure section->pin_queue_end is initialized
6208         correctly when non pinning objects in the section have been found.
6209
6210 2007-08-22  Marek Habersack  <mhabersack@novell.com>
6211
6212         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
6213         containing a list of directories separated by ':'. MSDN docs say
6214         the directories should be separated with ';'. Part of a bugfix for
6215         bug #81446
6216
6217 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
6218
6219         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
6220         it should MonoType and not MonoClass.
6221
6222 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
6223
6224         * culture-info-table.h : regenerated.
6225
6226 2007-08-20  William Holmes  <billholmes54@gmail.com>
6227
6228         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
6229          to call ReplaceFile Kernel32 on windows or in io-layer.
6230         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
6231         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
6232          as an internal call.
6233
6234         Code is contributed under MIT/X11 license.
6235
6236 2007-08-20  Jb Evain  <jbevain@novell.com>
6237
6238         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
6239         and MONO_EXCEPTION_FIELD_ACCESS.
6240
6241         * debug-helpers.[c|h]: new mono_field_full_name function.
6242
6243 2007-08-20  Mark Probst  <mark.probst@gmail.com>
6244
6245         * class.c: Removed class_security_level() and moved it to
6246         security-core-clr.c.
6247
6248         * security-core-clr.c, security-core-clr.h: class_security_level()
6249         is now public and renamed to mono_security_core_clr_class_level().
6250         It also looks for security attributes in the classes a class is
6251         nested in.
6252
6253 2007-08-20  Mark Probst  <mark.probst@gmail.com>
6254
6255         * security-core-clr.c, security-core-clr.h: CoreCLR security
6256         utility functions.
6257
6258         * Makefile.am: Added security-core-clr.[ch].
6259
6260         * security-manager.c, security-manager.h: Functions and enum for
6261         setting and getting the security mode.
6262
6263         * class.c: CoreCLR security checks.
6264
6265 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
6266
6267         * icall-def.h, process.c, process.h: implemented icall to get
6268         user/system processor times.
6269
6270 2007-08-17  Mark Probst  <mark.probst@gmail.com>
6271
6272         * domain.c, threads.c, class-internals.h, domain-internals.h: New
6273         reader-lock-free jit_info_table.
6274
6275 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
6276
6277         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
6278
6279         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
6280
6281         * object-internals.h (MonoException): Add missing _data member.
6282
6283 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
6284
6285         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
6286         checking that only methods with matching qname or fqname are picked
6287         from implemented interfaces.
6288
6289 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
6290
6291         * verify.c (do_newarr):added, do type verification of
6292         newarr ops, push the right value on the eval stack.
6293         * verify.c (mono_method_verify): use do_newarr
6294
6295
6296 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
6297
6298         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
6299         factored the common code into get_boxable_mono_type, which
6300         is now using mono_type_get_full, this fixed byref related tests.
6301
6302 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
6303
6304         * class.c: added mono_type_get_full, this function has the same
6305         behavior of mono_class_get_full but the returned MonoType has
6306         all metadata of the associated token in case of a typespec token.
6307         * class.c: added mono_type_retrieve_from_typespec, used by 
6308         mono_type_get_full to retrieve the token type.
6309         * class.c (mono_class_create_from_typespec): changed to use
6310         mono_type_retrieve_from_typespec.
6311         * class.c (mono_ldtoken): changed to use mono_type_get_full
6312         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
6313         * class-internals.h: exported mono_type_get_full for internal use.
6314
6315 2007-08-16  Jb Evain  <jbevain@novell.com>
6316
6317         * domain.c (supported_runtimes): add entry for
6318         the 'moonlight' runtime version.
6319
6320 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
6321
6322         * verify.c (mono_method_verify): small typo sliped in.  
6323
6324 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
6325
6326         * verify.c (do_unbox_value): added, do type verification of
6327         unboxing ops
6328         * verify.c (mono_method_verify): use do_unbox_value
6329
6330
6331 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
6332
6333         * verify.c (dump_stack_value): fixed typo, was printing string
6334         instead of object on stack.
6335         * verify.c (do_box_value): moved the byref check up as it leads
6336         to invalid code and should be done earlier.
6337         * verify.c: improved error messages for and ldobj
6338
6339 2007-08-15  William Holmes  <billholmes54@gmail.com>
6340
6341         * marshal.c (emit_marshal_custom): Omit the call to 
6342           marshal_native_to_managed when calling native to managed 
6343           and the argument is specified as an out argument.
6344
6345         Code is contributed under MIT/X11 license.
6346
6347 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
6348
6349         * verify.c: fixed the type checks for generics, function pointers and vectors.
6350         Added type verification for ldobj and ldtoken. The verifier
6351         would segfault if header or signature of a method contained references
6352         to non-existant types.
6353
6354 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
6355
6356         * marshal.c (cominterop_get_ccw): Patch from
6357         Bill Holmes to no walk up interface hierarchy. 
6358         All parent methods should be present in the interface for COM.
6359    
6360         Code is contributed under MIT/X11 license.
6361
6362 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
6363
6364         * marshal.c (emit_marshal_com_interface): Patch from
6365         Bill Holmes to handle COM Interfaces as return values
6366         for native->managed calls.
6367    
6368         Code is contributed under MIT/X11 license.
6369
6370 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
6371
6372         * marshal.c (cominterop_get_idispatch_for_object): Implement
6373         for runtime callable wrappers.
6374    
6375         Code is contributed under MIT/X11 license.
6376
6377 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
6378
6379         * pedump.c (main): changed from mono_init to mono_init_from_assembly
6380         so 2.0 types are accessible
6381
6382
6383 2007-08-13  Miguel de Icaza  <miguel@novell.com>
6384
6385         * domain.c (mono_init_internal): Call mono_assembly_load_friends
6386         once we load mscorlib.   Due to the order in which we initialize,
6387         the mono_assembly_load_full routine that loads mscorlib did not
6388         load friends.   We now load it once we load the
6389         mono_defaults.internals_visible_class class. 
6390
6391         * assembly.c: Expose the mono_load_friend_assemblies method.
6392
6393 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
6394
6395         * verify.c: improved the handling of boxing, better
6396         type checking for unary ops and conversion. Fix bug
6397         regarding managed pointer compatibility checking
6398
6399 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
6400
6401         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
6402
6403         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
6404
6405 2007-08-09  Raja R Harinath  <rharinath@novell.com>
6406
6407         * reflection.c (dup_type): Remove.
6408         * class.c (dup_type): Remove.
6409         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
6410         instead of the dodgy 'dup_type'.
6411         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
6412         handle the case where 'dup_type' needed the second argument.
6413
6414 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
6415
6416         * domain.c: Fix a warning.
6417
6418 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
6419
6420         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
6421         checking that methods with the same fqname are not overridden
6422         with a method from an ancestor.
6423
6424 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
6425
6426         * threads.c (free_thread_static_data_helper): Avoid a crash if
6427         thread->static_data is not yet set.
6428
6429 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
6430
6431         * marshal.c: Use correct image when emitting
6432         native wrapper for COM calls.
6433    
6434         Code is contributed under MIT/X11 license.
6435
6436 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
6437
6438         * icall-def.h, security.c, security.h :
6439           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
6440
6441 2007-08-07  Martin Baulig  <martin@ximian.com>
6442
6443         * mono-debug-debugger.h
6444         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
6445
6446         * domain.c (mono_domain_free): Call
6447         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
6448
6449 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
6450
6451         * verify.c (check_underflow, check_overflow): error message now returns IL offset
6452         * verify.c (in_same_block): code should test if either offset is inside the clauses
6453         * verify.c (mono_method_verify): push the exception into the eval stack of exception
6454         and filter blocks
6455
6456 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
6457
6458         * image.c (mono_image_close): Fix a leak.
6459
6460         * object.c (mono_runtime_invoke_array): Avoid using alloca.
6461
6462         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
6463
6464 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
6465
6466         * domain.c, threads.c, threads-types.h: fix memory retention issue
6467         with thread static variables not being cleared on domain unload.
6468         Reuse thread static slots after domain unload.
6469
6470 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
6471
6472         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
6473         nullable type.
6474
6475         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
6476         now done in mono_runtime_invoke_array.
6477
6478         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
6479         receiver is a nullable type.
6480
6481         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
6482         generic parameter.
6483
6484 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
6485
6486         * marshal.c: Implement COM Objects as return type for 
6487         managed->unmanaged calls. Added Release calls for COM Object
6488         out/return values in managed->unmanaged calls.
6489
6490         Code is contributed under MIT/X11 license.
6491
6492 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
6493
6494         * threads.h, threads-type.h: move the hazard pointer declarations
6495         to the private header.
6496
6497 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
6498
6499         * file-io.c, appdomain.c: memory leak fixes.
6500
6501 2007-08-02  Dick Porter  <dick@ximian.com>
6502
6503         * socket-io.c
6504         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
6505         SO_REUSEADDR setting into io-layer/sockets.c.
6506
6507 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
6508
6509         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
6510         from Object when called on a generic parameter. Fixes #82211.
6511
6512 2007-08-01  Dick Porter  <dick@ximian.com>
6513
6514         * file-io.c (convert_share): Test FileShare values bit-by-bit.
6515         Fixes bug 79250 yet again.
6516
6517 2007-07-30  Martin Baulig  <martin@ximian.com>
6518
6519         Merged the `debugger-dublin' branch.
6520
6521         * mono-debug.h
6522         (MonoDebugDataTable): New typedef.
6523         (MonoDebugMethodAddressList): New typedef.
6524         (MonoDebugWrapperData): Removed.
6525         (MonoDebugSymbolTable): Removed `current_data_table',
6526         `current_data_table_size', `current_data_table_offset'.
6527         (MonoDebugDataItemType): Moved into mono-debug.c.
6528         (MonoDebugMethodJitInfo): Remove `address'.
6529         (mono_debug_data_table): New global variable.
6530         (mono_debug_lookup_method_addresses): New public function.
6531         (mono_debug_find_method): Take a `MonoMethod *', not a
6532         `MonoDebugMethodInfo *'.
6533
6534         * mono-debug.c: Drop support for the old symbol tables.
6535
6536 2007-06-28  Martin Baulig  <martin@ximian.com>
6537
6538         * mono-debug.c (mono_debug_debugger_version): New public variable.
6539
6540 2007-07-31  William Holmes  <billholmes54@gmail.com>
6541
6542         * metadata.c Changed mono_type_create_from_typespec to not insert
6543           the type into the hash map until after
6544           do_mono_metadata_parse_type has completed.
6545         Fixes Bug #82194
6546         Code is contributed under MIT/X11 license.
6547
6548 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
6549
6550         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
6551         generic parameter. Fixes #82211.
6552
6553 2007-07-27  Jb Evain  <jbevain@novell.com>
6554
6555         * pedump.c (dump_metadata, dump_metadata_header): dump
6556         versions contained in the metadata header.
6557
6558 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
6559
6560         * threads.c: register small_id_table with the GC.
6561
6562 2007-07-27  Mark Probst  <mark.probst@gmail.com>
6563
6564         * threads.c, threads.h, class-internals.h, object-internals.h:
6565         Hazard pointers, to be used by lock-free parallel algorithms.
6566
6567 2007-07-26  Dick Porter  <dick@ximian.com>
6568
6569         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
6570         routine on non-windows platforms, as I've not managed to think of
6571         a non-kludgy way of doing this.  Finishes off bug 78739.
6572
6573 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
6574
6575         * object.c: properly setup interface_bitmap in proxy vtables.
6576
6577 2007-07-25  Marek Habersack  <mhabersack@novell.com>
6578
6579         * appdomain.c (get_shadow_assembly_location): do not use TickCount
6580         to create unique shadow copy target directories, use the domain's
6581         serial number instead. Each domain gets a unique target directory
6582         that way.
6583
6584         * domain.c (mono_domain_create): added code to increment domain
6585         shadow copy serial number and cache the value in the current
6586         domain structure.
6587
6588         * domain-internals.h (struct _MonoDomain): added a new field -
6589         shadow_serial to hold the serial number used in generation of
6590         shadow-copy directories. This is to make sure that the directory
6591         name is unique for each and every domain created. We avoid a race
6592         condition with overriding assemblies already in use by other app
6593         domains.
6594
6595 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
6596
6597         * class.c (mono_bounded_array_class_get): fixed memory leak when 
6598         binding generic parameters.
6599
6600 2007-07-24  Raja R Harinath  <rharinath@novell.com>
6601
6602         * metadata.c (do_mono_metadata_parse_generic_class): Use
6603         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
6604         error.
6605
6606 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
6607
6608         * loader.c, class-internals.h, reflection.c: removed the per-method
6609         generics hashtable: we use the global one through the call of
6610         mono_class_inflate_generic_method ().
6611
6612 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
6613
6614         * class.c, metadata.c, class-internals.h: introduce yet another
6615         generics global cache for inflated methods (fixes 98% of the perf
6616         issue in bug #81806).
6617
6618 2007-07-23  Raja R Harinath  <rharinath@novell.com>
6619
6620         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
6621         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
6622         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
6623         return a MonoGenericInst containing (a copy) of those types.
6624         (mono_metadata_inflate_generic_inst): Update to changes.
6625         (mono_metadata_parse_generic_inst): Likewise.
6626         (mono_get_shared_generic_inst): Likewise.
6627         * reflection.c (mono_class_bind_generic_parameters): Likewise.
6628         (mono_reflection_bind_generic_method_parameters): Likewise.
6629         * metadata-internals.h: Likewise.
6630         * icall.c (free_generic_context): Kill.
6631         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
6632
6633         * reflection.c (reflection_methodbuilder_to_mono_method): Use
6634         mono_metadata_type_dup.
6635         * marshal.c (mono_mb_create_method): Likewise.
6636
6637         * metadata.c (mono_metadata_type_dup): Rename from
6638         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
6639         MonoImage.  Handle a few more cases, esp. when no mempool is given.
6640         * marshal.c, metadata-internals.h: Update to changes.
6641
6642 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
6643
6644         * class.c: fixed a small leak for array classes and removed warning.
6645
6646 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
6647
6648         * loader.c (mono_method_get_param_token): Make this work on generic methods.
6649         Return 0x8000000 for return parameters. Fixes #82161.
6650
6651 2007-07-21  Marek Habersack  <grendello@gmail.com>
6652
6653         * appdomain.c (get_shadow_assembly_location): append the current
6654         ticks value to the path. Avoids overwriting the same assemblies by
6655         several threads at the same time.
6656
6657 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
6658         and Raja R Harinath  <rharinath@novell.com>
6659
6660         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
6661         Simplify slightly.
6662         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
6663         property for testing if a method is a generic method definition.
6664
6665 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
6666
6667         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
6668
6669 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
6670
6671         * verify.c: used function from private branch, reverted to the one in class.h 
6672
6673 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
6674
6675         * verify.c: a typo slipped in and the code wont compile
6676
6677 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
6678
6679         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
6680         disabled box instruction as it is doing the wrong thing
6681         improved stack dump messages, now it is easier to debug type related issues
6682
6683
6684 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
6685
6686         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
6687
6688 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
6689
6690         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
6691         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
6692         grouped with class and valuetype. This change will simply 
6693         the code as it should be handled just like unmanaged pointers.
6694
6695 2007-07-19  Mark Probst  <mark.probst@gmail.com>
6696
6697         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
6698
6699 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
6700
6701         * verify.c: several stack merge issues fixed, reference comparisons now
6702         check the type size. strict type check now works correctly.
6703         added more uses of IS_MANAGED_POINTER macro.
6704         fixed issues pointed by running the test suite against .net.
6705         
6706
6707 2007-07-19  Mark Probst  <mark.probst@gmail.com>
6708
6709         * class.c, loader.c, class-internals.h: Removed the
6710         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
6711         defines.
6712
6713         * icall.c: Better error checking in some internal reflection
6714         methods.
6715
6716 2007-07-18  William Holmes  <billholmes54@gmail.com>
6717
6718         * filewatcher.c : removed unused variable 'filename' in 
6719           ves_icall_System_IO_FSW_SupportsFSW
6720
6721 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
6722
6723         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
6724         obsolete, removed.
6725
6726 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
6727
6728         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
6729         
6730         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
6731
6732 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
6733
6734         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
6735         Implement generics support.
6736         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
6737
6738         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
6739         type_args and method_args arguments.
6740         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
6741         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
6742         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
6743
6744 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
6745
6746         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
6747           It adds a rootimage parameter to mono_reflection_get_type_internal,
6748           adds new function mono_reflection_get_type_with_rootimage and use
6749           the rootimage to resolve the types instead of the current image
6750
6751 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
6752
6753         * culture-info-table.h: Forgot to update after r78304.
6754
6755 2007-07-13  Raja R Harinath  <rharinath@novell.com>
6756
6757         * class.c (mono_class_is_open_constructed_type)
6758         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
6759
6760 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
6761
6762         * class.c (mono_bounded_array_class_get):  method fails if used with
6763         an incomplete TypeBuilder enum (no basetype field), fixed it by 
6764         avoiding calculating the size for such array as it cannot be instantiated.
6765         Fix bug #82015
6766
6767 2007-07-12  Raja R Harinath  <rharinath@novell.com>
6768
6769         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
6770         field.
6771         * metadata.c, reflection.c: Update to changes.
6772
6773 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
6774
6775         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
6776         mono_class_is_valid_enum, they are used to valide a enum when loading.
6777         * reflection.c: used new functions to throw TypeLoadException when and
6778         invalid enum is build with TypeBuilder. Fixes #82018
6779   
6780 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
6781
6782         * object.c: forgot commit of mono_class_setup_methods () to access
6783         iface->methods.
6784         * object-internals.h: added a few more handy fields to
6785         MonoIMTCheckItem.
6786
6787 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
6788
6789         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
6790         iface->methods.
6791
6792 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
6793
6794         * class-internals.h, object-internals.h, object.c: IMT-based
6795         interface invocation core from Massimiliano Mantione
6796         (massi@ximian.com) with a reworked arch-specific interface,
6797         bsearch implementation and a few bugfixes and memory savings by me.
6798
6799 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
6800
6801         * class.c (mono_class_create_from_typedef): mono would segfault if 
6802         an enum did not have a __value field. It now throws a TypeLoadException
6803         for such cases. Fix bug #82022
6804
6805 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
6806
6807         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
6808
6809 2007-07-09  Mark Probst  <mark.probst@gmail.com>
6810
6811         * class.c (mono_class_init): If a class is already inited but has
6812         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
6813
6814 2007-07-09  Mark Probst  <mark.probst@gmail.com>
6815
6816         * class.c: Properly handle the case of an unimplemented interface
6817         method.  Fixes: 81673.
6818
6819 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
6820
6821         * class-internals.h, object.c: cleanup patch from massi: use
6822         MonoVTable->interface_bitmap since the vtable interfaces offset array
6823         is going away.
6824
6825 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
6826
6827         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
6828         GetMDStreamVersion icall instead.
6829
6830 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
6831
6832         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
6833         not use mono_dl_build_path() with a full library name: makes
6834         fallbacks to libgaim and libfam work.
6835
6836 2007-07-06  William Holmes  <billholmes54@gmail.com>
6837
6838         * assembly.c: Added a continue statement in probe_for_partial_name when
6839          parse_assembly_directory_name fails.  Fixes : 82002
6840
6841 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
6842
6843         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
6844         and added a verification  for TYPEDBYREF.
6845         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
6846         make native int interchangeable with int32 and some small cleanup and formating.
6847         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
6848         handle byref of byref.
6849         * verify.c (push_local): handle byref of byref.
6850         * verify.c (do_binop): invalid mix of values is unverifiable
6851         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
6852         added visibility checks
6853         * verify.c (field related method): added visibility checks
6854         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
6855
6856 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
6857
6858         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
6859         string.
6860
6861 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
6862
6863         * profiler.c (mono_profiler_load): Fix an off-by-one error.
6864
6865         * marshal.c (emit_marshal_string): When returning a string from managed code,
6866         allways make a copy even for unicode strings. Fixes #81990.
6867
6868 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
6869
6870         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
6871         of byref generic inst types (bug #81997).
6872
6873 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
6874
6875         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
6876         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
6877
6878 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
6879
6880         * marshal.c (emit_marshal_string): Add support for unicode strings in
6881         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
6882
6883 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
6884
6885         * verify.c: field load/store are now verified, missing only access checks now
6886
6887 2007-06-28  Martin Baulig  <martin@ximian.com>
6888
6889         * mono-debug.c (mono_debug_debugger_version): New public variable.
6890
6891 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
6892
6893         * locales.c: When constructing DateTimeFormat or NumberFormat for
6894         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
6895         MonoCultureInfo contructed from the current locale is always
6896         read-only and has UseUserOverride set to true. All MonoCultureInfo
6897         instances returned for GetCultures have both IsReadOnly and
6898         UseUserOverride set to true. Fixes part of bug #81930.
6899
6900 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
6901
6902        * icall-def.h: Update System.__ComObject icalls
6903        * marshal.c: Avoid managed transition (and object creation)
6904        when looking up COM interface in RCW.
6905        * marshal.h: Ditto.
6906        
6907        Code is contributed under MIT/X11 license.
6908
6909 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
6910
6911         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
6912         to avoid crashes during assembly unloading.
6913
6914 2007-06-22  Raja R Harinath  <rharinath@novell.com>
6915
6916         Fix MethodInfo.IsGenericMethodDefinition
6917         * reflection.c (mono_reflection_bind_generic_method_parameters):
6918         Rearrange code to ensure we always uses a generic method definition.
6919         * class.c (mono_class_inflate_generic_method_full): Set
6920         'generic_container' field only for generic method definitions.
6921         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
6922         Use presense of 'generic_container' field as indication of being a
6923         generic method definition.
6924
6925 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
6926
6927         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6928
6929         * object-internals.h: Reflect changes in the layout of the managed Delegate
6930         class.
6931         
6932         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
6933         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
6934         runtime memory used by the dynamic method. Fixes #77146.
6935
6936 2007-06-21  Dick Porter  <dick@ximian.com>
6937
6938         * file-io.h: 
6939         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
6940         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
6941         81767.
6942
6943 2007-06-21  Raja R Harinath  <rharinath@novell.com>
6944
6945         * reflection.c (method_encode_methodspec): Add a tripwire.
6946         * class.c (inflate_generic_type): The fully open generic type is
6947         not the same as the generic type definition.
6948
6949 2007-06-21  Martin Baulig  <martin@ximian.com>
6950
6951         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
6952
6953         * mono-debug-debugger.h
6954         (MonoDebuggerBreakpointInfo): Removed.
6955         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
6956         (mono_debugger_remove_breakpoint): Likewise.
6957         (mono_debugger_breakpoint_callback): Likewise.
6958         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
6959
6960 2007-06-21  Raja R Harinath  <rharinath@novell.com>
6961
6962         * metadata.c (mono_metadata_lookup_generic_class): The fully open
6963         generic type is not the same as the generic type definition.
6964         * class.c (mono_generic_class_get_class): Likewise.
6965
6966 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
6967
6968         * icall.c: The second argument to 
6969         System.Reflection.MethodBase.GetMethodFromHandleInternalType
6970         is a MonoType not a MonoClass.
6971
6972 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
6973
6974         * verify.c: support for function pointers in the verifier
6975
6976 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
6977
6978         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
6979
6980 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6981
6982         * assembly.c: removed Mono.Data.SqliteClient from the list of
6983         forward-compatible assemblies as it breaks the ABI (bug #81899).
6984
6985 2007-06-19  Raja R Harinath  <rharinath@novell.com>
6986
6987         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
6988         lookup/update with the loader lock.
6989         * reflection.c (mono_class_bind_generic_parameters): No need to
6990         protect mono_metadata_lookup_* with the loader lock.
6991         * class.c (inflate_generic_type): Likewise.
6992         
6993         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
6994         on a generic instantiated type.
6995
6996 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
6997
6998         *verify.c: produce meanfull error messages on verification error
6999         *verify.c: fixed some cases of verification errors reported as validation errors
7000         *pedump.c: fixed the error name array, now it shows validation errors properly
7001         *verify.h: fixed the contant that should be used for verification errors
7002
7003 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
7004
7005         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
7006         for bug #77596, 81858 and 80743 (generics data structures on domain
7007         unload).
7008
7009 2007-06-15  Raja R Harinath  <rharinath@novell.com>
7010
7011         Avoid allocating 'MonoGenericContext' on the heap.
7012         * class-internals (_MonoMethodInflated::context): Make field
7013         inline, not a pointer.
7014         * loader.c (method_from_methodspec): Allocate 'new_context' on the
7015         stack.  Use the context embedded within the inflated method as the
7016         hash key, rather than 'new_context'.
7017         * class.c (inflate_generic_context): Simplify.  Return a struct
7018         rather than allocating on the heap.
7019         (mono_class_inflate_generic_method_full): Update to changes.  Now,
7020         doesn't salt away a copy of the context -- simplifying the
7021         lifetime rules of a 'MonoGenericContext *'.
7022         (mono_method_get_context): Return pointer to embedded context.
7023         (setup_generic_array_ifaces): Allocate temporary context on stack.
7024         * reflection.c (inflate_mono_method): Likewise.
7025         (mono_reflection_bind_generic_method_parameters): Likewise.
7026         Use the context embedded within the inflated method as the hash key.
7027
7028         Avoid a source of allocation of 'MonoGenericContext'.
7029         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
7030         and 'cached_context' fields into embedded 'MonoGenericContext' field.
7031         * class.c: Update to changes.
7032         (mono_generic_class_get_context): Simplify drastically.  Now just
7033         returns a pointer to the field.
7034         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
7035         argument as a const pointer.
7036         (mono_metadata_generic_context_equal): Likewise.
7037         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
7038         Update to changes.
7039
7040 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
7041
7042         * verify.c improved the handling of brtrue/brfalse, factored out common code
7043
7044 2007-06-14  Raja R Harinath  <rharinath@novell.com>
7045
7046         Kill MonoGenericMethod.
7047         * class-internals.h (MonoGenericContext::method_inst): Rename from
7048         'gmethod' and convert to a MonoGenericInst.
7049         (MonoGenericMethod): Remove.
7050         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
7051         * loader.c (method_from_methodspec): Update to changes.  Use a
7052         MonoGenericContext as the key to the hashtable.
7053         * metadata.c (mono_metadata_generic_context_equal): Rename from 
7054         'mono_metadata_generic_method_equal' and take MonoGenericContext.
7055         (mono_metadata_generic_context_hash): Likewise from
7056         'mono_metadata_generic_method_hash'.  Change hash function.
7057         (mono_metadata_load_generic_params): Update to changes.
7058         (mono_get_shared_generic_method): Remove.
7059         * metadata-internals.h (mono_get_shared_generic_method): Remove.
7060         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
7061         (inflate_generic_context): Likewise.
7062         (mono_class_inflate_generic_method_full): Likewise.
7063         (setup_generic_array_ifaces): Likewise.
7064         (mono_class_create_from_typespec): Likewise.
7065         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
7066         (method_encode_methodspec): Update callsite.
7067         (reflection_methodbuilder_to_mono_method): Update to changes.
7068         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
7069         MonoGenericContext as the key to the hashtable.
7070         (inflate_mono_method): Update to changes.
7071
7072         * class-internals.h (MonoGenericMethod::container): Remove.
7073         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
7074
7075 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
7076
7077         * profiler-private.h, profiler.c, profiler.h: added API to profile
7078         exception events.
7079
7080 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
7081
7082         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
7083
7084 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
7085
7086         * verify.c: method invocation is now validated, now we verify parameter types on stack.
7087         Fixed overflow and underflow not aborting the verification process.
7088
7089 2007-06-13  Mark Probst  <mark.probst@gmail.com>
7090
7091         * class-internals.h (MonoStats): Added stats entries for dynamic
7092         code allocations.
7093
7094 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
7095
7096         * loader.c (mono_free_method): Free header->locals and header->clauses.
7097
7098         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
7099         dynamic case.
7100
7101         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
7102
7103         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
7104
7105 2007-06-12  Raja R Harinath  <rharinath@novell.com>
7106
7107         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
7108         the tables.
7109
7110 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
7111
7112         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
7113
7114 2007-06-11  Raja R Harinath  <harinath@gmail.com>
7115
7116         MonoGenericMethod on a diet
7117         * class-internals.h (_MonoMethodInflated::reflection_info): Move
7118         here ...
7119         (_MonoGenericMethod::reflection_info): ... from here.
7120         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
7121         Update to changes.
7122         * reflection.c (inflate_mono_method): Likewise.
7123         (mono_reflection_bind_generic_method_parameters): Likewise.
7124
7125 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
7126
7127         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
7128         *verify.c: factored long ldarg forms to share code with short forms
7129
7130 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
7131
7132         *verify.c: fixed code formating factored some duplicate code
7133         into a new function
7134
7135         *verify.h: fixed binary incompatibility introduced earlier
7136
7137         *pedump.c: fixed formating
7138
7139 2007-06-11  Raja R Harinath  <harinath@gmail.com>
7140
7141         Fix assertion when disassembling Mono.C5.dll
7142         * loader.c (method_from_methodspec): Avoid inflating a method
7143         twice with the same context.  If the methodref is inflated, use
7144         the declaring method instead.
7145
7146         * class.c (mono_class_from_generic_parameter): Fix case similar to
7147         bug #81830 handled below, but for method containers.
7148
7149 2007-06-10  Raja R Harinath  <harinath@gmail.com>
7150
7151         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
7152         get_shared_generic_class.  Directly inflate the instance.
7153         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
7154         (inflate_generic_class): Delete.
7155         (get_shared_generic_class): Delete.  Move setting of
7156         'cached_class' and 'cached_context' ...
7157         * metadata.c (mono_metadata_lookup_generic_class): ... here.
7158
7159         * metadata.c (mono_metadata_lookup_generic_class): Change
7160         signature to take the components of a MonoGenericClass rather than
7161         an allocated MonoGenericClass.  Change semantics to be intern-like.
7162         * reflection.c (mono_class_bind_generic_parameters): Update to
7163         changes.  Make locking region tighter.
7164         * class.c (inflate_generic_class): Update to changes.
7165         (get_shared_generic_class): Likewise.
7166         * metadata-internals.h: Likewise.
7167
7168         * reflection.c (mono_class_bind_generic_parameters): Take and
7169         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
7170         (mono_reflection_bind_generic_parameters): Use
7171         'mono_class_bind_generic_parameters' rather than duplicate the code.
7172         * class.c (mono_bounded_array_class_get): Update to changes.
7173         * object-internals.h: Likewise.
7174
7175         * reflection.c (mono_class_bind_generic_parameters): Only support
7176         parameterizing generic type definitions.  Remove support for other
7177         open types.
7178
7179 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
7180
7181         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
7182
7183         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
7184         in the dynamic case.
7185
7186 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
7187
7188         * threads.c: When cleaning up thread, reset the Background bit.
7189         Fixes bug #81720.
7190
7191 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
7192
7193        * metadata.c: Move variable declarations to top of scope.
7194        * verify.c: Move variable declarations to top of scope.
7195
7196        Code is contributed under MIT/X11 license.
7197
7198 2007-06-08  Raja R Harinath  <rharinath@novell.com>
7199
7200         * reflection.c (mono_class_bind_generic_parameters): Replace
7201         open-coded loop with mono_metadata_inflate_generic_inst.
7202
7203         * class.c (get_shared_generic_class): Don't call
7204         mono_get_shared_generic_inst.  Use the container's own
7205         'class_inst'.
7206
7207         * metadata.c (mono_metadata_load_generic_params): Move
7208         initialization of 'context' field here from ...
7209         * class.c (mono_class_create_from_typedef): ... here, and ...
7210         * loader.c (mono_get_method_from_token): ... here.
7211
7212         * class.c (get_shared_generic_class): Rename from
7213         mono_get_shared_generic_class and make static.
7214         (mono_get_shared_generic_inst): Move to metadata.c.
7215         * loader.c (mono_get_shared_generic_method): Likewise.
7216         * class-internals.h, metadata-internals.h: Update to changes.
7217
7218         Fix #81830
7219         * class.c (mono_class_from_generic_parameter): Don't assume a
7220         generic container owner exists.  Generic containers from monodis
7221         don't have any.
7222
7223 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
7224
7225         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
7226         * verify.h: new typedefs to returns the non-verifiable status
7227         * verify.c: initial implementation of generics, stack merging and object compatibility check
7228
7229 2007-06-06  Mark Probst  <mark.probst@gmail.com>
7230
7231         * class.c, image.c, class-internals.h (MonoImage): class_cache is
7232         a MonoInternalHashTable again (fixed bug in internal hash table
7233         code).
7234
7235 2007-06-06  Mark Probst  <mark.probst@gmail.com>
7236
7237         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
7238         MonoInternalHashTable again (fixed bug in internal hash table
7239         code).
7240
7241 2007-06-06  Mark Probst  <mark.probst@gmail.com>
7242
7243         * class.c, image.c, class-internals.h, domain.c,
7244         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
7245         changes.  Have to figure out what makes them break the SWF
7246         regression.
7247
7248 2007-06-04  Mark Probst  <mark.probst@gmail.com>
7249
7250         * class.c, image.c, class-internals.h (MonoImage): class_cache is
7251         a MonoInternalHashTable now.
7252
7253 2007-06-04  Mark Probst  <mark.probst@gmail.com>
7254
7255         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
7256         MonoInternalHashTable now.
7257
7258 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
7259
7260         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
7261         invoke_impl code.
7262
7263         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
7264
7265         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
7266         dependent trampoline.
7267
7268         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7269
7270         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
7271
7272 2007-05-29  Robert Jordan  <robertj@gmx.net>
7273
7274         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
7275
7276 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
7277
7278         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
7279
7280 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
7281
7282        * marshal.c: Fix interface lookup loops for
7283        cominterop_get_com_slot_for_method and 
7284        cominterop_get_method_interface. Only need to lookup
7285        if type is a class, else use interface type method is on.
7286
7287        Code is contributed under MIT/X11 license.
7288
7289 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
7290
7291         * reflection.c: HasSecurity can be present even if no specially 
7292         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
7293         SecurityAttribute). Fix CAS regression tests on buildbot.
7294
7295 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
7296
7297        * appdomain.c: Add configure checks for header files.
7298        * image.c: Add configure checks for header files.
7299        * file-io.c: Add configure checks for header files.
7300        * debug-mono-symfile.c: Add configure checks for header files.
7301        * threadpool.c: Add configure checks for header files.
7302        * console-io.c: Add configure checks for header files.
7303        * profiler.c: Add configure checks for header files.
7304        * rawbuffer.c: Add configure checks for header files.
7305        * icall.c: Add configure checks for header files.
7306        * rand.c: Add configure checks for header files.
7307        * socket-io.c: Add configure checks for header files.
7308
7309        Code is contributed under MIT/X11 license.
7310
7311 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
7312
7313         * reflection.c (mono_custom_attrs_from_builders): Remove the 
7314         assertion as it breaks the build.
7315         
7316         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
7317
7318         * reflection.c (lookup_custom_attr): Make a copy here too.
7319
7320         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
7321         dynamic images.
7322
7323         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
7324         images.
7325
7326         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
7327         info.
7328
7329 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
7330
7331         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
7332         (load_cattr_value): Ditto.
7333
7334 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
7335
7336         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
7337
7338 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
7339
7340         * threads.c: In "start_wrapper", set apartment_state to MTA if
7341         apartment_state is Unknown and we're running on 2.0 profile or
7342         higher.
7343         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
7344         to main method, then set apartment_state to Unknown on 1.0 profile,
7345         and MTA on 2.0 profile.
7346
7347 2007-05-16  Jb Evain  <jb@nurv.fr>
7348
7349         * class-internals.h (MonoDefaults): Add an attribute_class and
7350           customattribute_data_class.
7351         * domain.c (mono_init_internal): Populate them.
7352         * reflection.c: Use them to remove duplicates. Make a vew
7353         MonoClass variables `static'.
7354
7355 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
7356
7357         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
7358         step in implementing IMT, so that all isinst checks now can go
7359         through the bitmap.
7360         This was needed because vtables for TransparentProxy need to look
7361         like the vtable of the "target" class, so they need to point to
7362         its interface bitmap directly.
7363
7364         * object.c: inside "mono_class_create_runtime_vtable" and
7365         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
7366
7367 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
7368
7369         * object-internals.h
7370           culture-info.h : added territory field in MonoCulture and
7371           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
7372         * locales.c : fill territory field above too.
7373         * culture-info-table.h : regenerated.
7374
7375 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
7376
7377         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
7378         Fixes #81599.
7379
7380 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
7381
7382         * object.c: Always initialize apartment, even if 
7383         there is no custom attributes on entry point.
7384         
7385         Code is contributed under MIT/X11 license.
7386
7387 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
7388
7389         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
7390         * metadata.c: If no encoding is set, check for unicode
7391         on class.
7392         
7393         Code is contributed under MIT/X11 license.
7394
7395 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
7396
7397         * threads.c: Handle if mono_thread_current returns NULL 
7398         
7399         Code is contributed under MIT/X11 license.
7400
7401 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
7402
7403         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
7404         in start_wrapper. Added mono_thread_init_apartment_state and
7405         mono_thread_cleanup_apartment_state.
7406         * object.c: Initialize thread apartment state on main thread
7407         by checking for STAThreadAttribute on entry point.
7408         * object-internals.h: Add apartment_state field to MonoThread.
7409         * threads-types.h: Add unmanaged definition of 
7410         System.Threading.ApartmentState, MonoThreadApartmentState.
7411         
7412         Code is contributed under MIT/X11 license.
7413         
7414 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
7415
7416         * class.c: Fix windows build.
7417         * class-internals.h: Fix windows build.
7418         
7419         Code is contributed under MIT/X11 license.
7420
7421 2007-05-08  Robert Jordan  <robertj@gmx.net>
7422
7423         * process.c (CreateProcess_internal):
7424         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
7425         .CreateNoWindow was specified. Fixes #81496.
7426
7427 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
7428
7429         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
7430         step in implementing IMT, replaced it with two compact arrays
7431         (interfaces_packed and interface_offsets_packed) and a bitmap that
7432         is used for isinst checks (interface_bitmap).
7433
7434         * class.c: (compare_interface_ids): compare function to pass to
7435         bsearch when looking for an interface with a given id.
7436         (mono_class_interface_offset): reimplemented using bsearch on
7437         interfaces_packed, getting the offset from interface_offsets_packed.
7438         (print_implemented_interfaces): utility debugging function.
7439         (setup_interface_offsets): reworked to initialize interfaces_packed,
7440         interface_offsets_packed and interface_bitmap.
7441
7442         * object.c: replaced all accesses to "MonoClass.interface_offsets"
7443         with uses of interfaces_packed and interface_offsets_packed.
7444
7445 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
7446
7447         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
7448         mono_class_interface_offset prototype to wrap all accesses to
7449         "MonoClass.interface_offsets".
7450
7451         * class.c: Implemented mono_class_interface_offset, and wrapped all
7452         accesses to "MonoClass.interface_offsets".
7453
7454         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
7455         "MonoClass.interface_offsets".
7456
7457 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
7458
7459         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
7460         GetMethodFromHandle overloads (bug #78637).
7461
7462 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
7463
7464         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
7465         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
7466
7467 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
7468
7469         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
7470         #81498.
7471
7472         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
7473         gracefully.
7474         (mono_custom_attrs_from_index): Ditto.
7475
7476         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
7477         Fixes #81501.
7478
7479 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
7480
7481         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
7482         is now allocated from a mempool.
7483
7484 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
7485
7486         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
7487         caller holds threads_lock, leading to deadlocks. Fixes #81476.
7488
7489 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
7490
7491         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
7492         mono_loader_clear_error () too late. Fixes #81463.
7493
7494 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
7495
7496         * culture-info-table.h : regenerated.
7497
7498 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
7499
7500         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
7501         is missing.
7502
7503 2007-04-25  Dick Porter  <dick@ximian.com>
7504
7505         * Makefile.am: Put the mingw enforced-optimisation back into the
7506         PLATFORM_WIN32 section.
7507
7508 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
7509
7510         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
7511         patch.
7512
7513         * image.c (mono_image_load_module): New API function to load a module reference.
7514
7515         * image.c (load_modules): Load modules lazily. Fixes #80812.
7516
7517         * class.c (mono_class_from_typeref): Use mono_image_load_module.
7518         
7519         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
7520
7521         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
7522         to mono_image_load_module_dynamic.
7523
7524 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
7525
7526         * marshal.c: Fix calling convention for CCW on non-windows
7527         platforms. STDCALL on windows, CDECL everywhere else to work 
7528         with XPCOM and MainWin COM.
7529         
7530         Code is contributed under MIT/X11 license.
7531
7532 2007-04-23  Martin Baulig  <martin@ximian.com>
7533
7534         Fix #80969.
7535
7536         * loader.c
7537         (method_from_memberref): Added `gboolean *used_context' argument.
7538         (mono_get_method_from_token): Likewise.
7539         (mono_get_method_full): Don't insert the method in the cache when
7540         `used_context' is true.
7541
7542 2007-04-23  Raja R Harinath  <rharinath@novell.com>
7543
7544         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
7545
7546         * reflection.c (mono_reflection_bind_generic_parameters): Don't
7547         create new MonoTypes for returned types.
7548         * class.c (mono_generic_class_get_class): Export mono-internal.
7549         * class-internals.h: Update to changes.
7550
7551 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
7552
7553         * threadpool.c, threadpool.h, icall-def.h: patch from
7554         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
7555
7556 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
7557
7558         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
7559         
7560         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
7561
7562         * threads.c (mono_thread_get_stack_bounds): New helper function.
7563
7564         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
7565         Correctly compute stack bounds when attaching. Fixes #81394.
7566
7567 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
7568
7569         * reflection.c: fix handling of doubles in custom attributes
7570         for the arm-fpa format (bug #81368).
7571
7572 2007-04-18  Raja R Harinath  <rharinath@novell.com>
7573
7574         * reflection.c (assembly_add_win32_resources): Mildly relax an
7575         bounds check to let the end pointer point just past the end of the
7576         allocated buffer.  (may fix #81384)
7577
7578 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
7579
7580         * culture-info-table.h : regenerated.
7581
7582 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
7583
7584         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
7585         the thread is aborted early.
7586
7587 2007-04-05  Dick Porter  <dick@ximian.com>
7588
7589         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
7590         FindFirstFile()/FindNextFile() to find entries.  This lets the
7591         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
7592         81038.
7593
7594         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
7595         the parameters of
7596         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
7597
7598 2007-04-04  Martin Baulig  <martin@ximian.com>
7599
7600         * debug-helpers.c
7601         (mono_method_desc_full_match): Add support for nested classes.
7602
7603 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
7604
7605         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
7606
7607 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
7608
7609         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
7610         waiting for too many threads.
7611
7612 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
7613
7614         * environment.c: Fix return value check on uname so we can get the 
7615         executing version on Solaris operating systems.
7616
7617 2007-03-28  Jb Evain  <jbevain@gmail.com>
7618
7619         * class.c (mono_type_get_name_recurse): Complete the
7620         fix for the creation of assembly qualified names for
7621         pointer types. Fixes #81208.
7622
7623 2007-03-27  Dick Porter  <dick@ximian.com>
7624
7625         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
7626         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
7627         changed.
7628
7629         * threads.c
7630         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
7631         the value of ReleaseMutex().
7632
7633 2007-03-27  Dick Porter  <dick@ximian.com>
7634
7635         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
7636         in little-endian order, not network endian, so must be converted
7637         to host endian here.  Fixes bug 80593.
7638
7639 2007-03-22  Jb Evain  <jbevain@gmail.com>
7640
7641         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
7642         qualified names for pointer types. Fixes #81208.
7643
7644 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
7645
7646         * marshal.c: Add support for PreserveSigAttribute. 
7647         
7648         Code is contributed under MIT/X11 license.
7649
7650 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
7651
7652         * process.c: Fix endianness issues. Fixes #81126.
7653
7654         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
7655         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
7656
7657         * image.c (mono_image_lookup_resource): Make this work on big-endian
7658         machines.Change API contract so the caller needs to free the return value.
7659         
7660         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
7661         API change.
7662         
7663 2007-03-14  Martin Baulig  <martin@ximian.com>
7664
7665         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
7666         mono_type_get_desc() as well.
7667
7668 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
7669
7670         * icall.c:  Fix environ access in VS.  
7671         
7672 2007-03-13  Alp Toker  <alp@atoker.com>
7673
7674         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
7675         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
7676         #63841.
7677
7678 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
7679
7680         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
7681         circular references among dynamic methods. Fixes #81091.
7682
7683         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
7684
7685 2007-03-09  Martin Baulig  <martin@ximian.com>
7686
7687         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
7688
7689 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
7690
7691         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
7692         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
7693         
7694         Code is contributed under MIT/X11 license.
7695         
7696 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
7697
7698         * loader.c: Reapply patch for bug #79424.
7699
7700 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
7701
7702         * metadata.c (mono_type_to_unmanaged): Only convert object to
7703         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
7704
7705 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
7706
7707         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
7708         (and incorrectly set) is_reference field from MonoGenericInst.
7709
7710 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
7711
7712         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
7713         a little earlier.
7714
7715         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
7716
7717         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
7718
7719 2007-03-05  Miguel de Icaza  <miguel@novell.com>
7720
7721         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
7722         FileOptions.1 value to mean "temporary", map that to
7723         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
7724
7725         Fixes 80688
7726
7727 2007-03-03  Marek Habersack  <mhabersack@novell.com>
7728
7729         * appdomain.c: implement MS .Net style shadow copying. Copies of
7730         the assemblies are made in a subdirectory of the dynamic base
7731         directory, the assembly names are preserved.
7732         Copy .mdb and .config files along with the assemblies being shadowed.
7733
7734 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
7735
7736         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
7737         (emit_marshal_handleref): Ditto.
7738
7739         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
7740         on Visual C++. Fixes #80671.
7741
7742 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
7743
7744         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
7745         for clone operations.
7746
7747 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
7748
7749         * marshal.c: Fix warnings.
7750
7751 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
7752
7753         * loader.c: allow case-insensitive matching of the dll name
7754         in dllmap handling when prefixed with "i:".
7755
7756 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
7757
7758         * threads.c: Fix #ifdef for dummy_apc function for VS.
7759
7760 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
7761
7762         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
7763
7764 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
7765         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
7766         giving precedence to the methods with a fully qualified name
7767         (InterfaceName.MethodName) when building the interface sections
7768         of the vtable.
7769
7770 2007-02-16  Dick Porter  <dick@ximian.com>
7771
7772         * threadpool.c (append_job): Fix fast-path array handling, so it's
7773         less likely the array will grow exponentially when the load is
7774         heavy.
7775
7776 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
7777
7778         * metadata-internals.h, loader.c: fix dllmap lookup order
7779         for non-function maps, too, and prepare for fallback code.
7780
7781 2007-02-12  Robert Jordan  <robertj@gmx.net>
7782
7783         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
7784         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
7785         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
7786         GlobalFree. Fixes a part of bug #77075.
7787
7788 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
7789
7790         * loader.c: implemented typedef parent in field memberref.
7791
7792 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
7793
7794         * marshal.c: Fix warnings and remember to call Release on
7795         IUnknown of RCW.
7796         
7797         Code is contributed under MIT/X11 license.
7798
7799 2007-02-10  Miguel de Icaza  <miguel@novell.com>
7800
7801         * class-internals.h: Add MonoHandleRef definition, and
7802         handleref_class to mono_defaults. 
7803
7804         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
7805         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
7806
7807         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
7808         (do nothing on this stage)
7809         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
7810         (emit_marshal_handleref): New method, used for argument handling
7811         of HandleRefs. 
7812
7813 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
7814
7815         * class.c (mono_class_setup_parent): Lazily init com types.
7816         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
7817         init com types.
7818         * object.c (mono_remote_class_vtable): Lazily init com types.
7819         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
7820         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
7821         * domain-internals.h: Expose mono_init_com_types.
7822         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
7823         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
7824         Add support for COM Callable Wrapper marshalling.
7825         * marshal.h: Add icall definitions.
7826         * gc.c: Handle freeing of CCWs in finalizer code.
7827         
7828         Code is contributed under MIT/X11 license.
7829
7830 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
7831
7832         * reflection.c: changed all the signature encoding code to use
7833         a variable-sized buffer.
7834
7835 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
7836
7837         * marshal.c: locking fixes: never take the loader lock
7838         or other runtime locks when holding the marshal lock
7839         (fixes bug#80664).
7840
7841 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
7842
7843         * marshal.c: make the delegate function pointer mapping
7844         work for the moving GC.
7845
7846 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
7847
7848         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
7849         for bug #80618.
7850
7851 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
7852
7853         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
7854         gmodule.
7855
7856 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
7857
7858         * threadpool.c: made the code moving-GC safe.
7859
7860 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
7861
7862         * assembly.c, boehm-gc.c, class-internals.h, class.c,
7863         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
7864         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
7865         warning cleanup.
7866         * reflection.c: warning cleanup, some threading and moving GC fixes.
7867
7868 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
7869
7870         * class.c, loader.c: create the needed Set/Get/Address array methods
7871         as well as the .ctors in mono_class_init (), fixes bug #80567.
7872
7873 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
7874
7875         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
7876         we doesn't decrease its alignment. Should fix the sparc build.
7877
7878 2007-01-24  Dick Porter  <dick@ximian.com>
7879
7880         * socket-io.c
7881         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
7882         Create the returned object if we need to ignore an unsupported
7883         socket option.  Fixes a segfault reported by Atsushi.
7884
7885 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
7886
7887         * class.c, object.c: restrict GC-tracked fields to
7888         UIntPtr fields used inside corlib, so we provide better
7889         type info to the GC and also allow broken packing as in
7890         bug #80580.
7891
7892 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
7893
7894         * sgen-gc.c: removed duplicated function.
7895
7896 2007-01-19  Miguel de Icaza  <miguel@novell.com>
7897
7898         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
7899         value that means that the value is not supported, but that we
7900         should not return a failure, but instead report this as a
7901         successful operation.
7902
7903 2007-01-19  Raja R Harinath  <rharinath@novell.com>
7904
7905         Fix tests/bug79956.2.il
7906         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
7907         (mono_generic_class_get_class): If the generic definition in an
7908         enum, copy over other fields related to it.
7909
7910 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
7911
7912         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
7913         genericinst enums (bug #79215).
7914
7915 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
7916         * class.c: Fix bug 80307.
7917
7918 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
7919
7920         * image.c: if the file table is not present, try to load
7921         all the modules, since we don't have info about them
7922         having or not metadata (bug #80517).
7923         * assembly.c: allow mono_assembly_load_references () to
7924         work for netmodules.
7925
7926 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
7927
7928         * image.c, metadata-internals.h, object.c: execute module
7929         cctors when running on the 2 runtime if present (bug #80487).
7930
7931 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
7932
7933         * icall.c: optimized InitializeArray() on bigendian.
7934
7935 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
7936
7937         * icall.c: fix for the broken ARM FPA double format.
7938
7939 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
7940
7941         * icall.c: handle endian issues for r4 and r8 types, too, in
7942         the InitializeArray() icall.
7943
7944 2007-01-15  Miguel de Icaza  <miguel@novell.com>
7945
7946         * loader.c (mono_loader_error_prepare_exception): Clear the error
7947         once we have extracted the information from it, do this before we
7948         call into the JIT's class loading mechanisms.
7949
7950         * object.c (mono_class_create_runtime_vtable): Do not clear the
7951         loader error before calling mono_class_get_exception_for_failure
7952         as the loader error is needed inside
7953         mono_class_get_exception_for_failure to throw the error (thinko).
7954
7955         Fixes #80521
7956         
7957 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
7958
7959         * reflection.c: align fields rva data so it's faster to load at
7960         runtime.
7961
7962 2007-01-12  Raja R Harinath  <rharinath@novell.com>
7963
7964         Prepare to simplify GenericMethod handling.
7965         * class-internals.h (mono_method_get_context): New accessor function.
7966         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
7967         rather than directly accessing '->context' field.
7968
7969         * class-internals.h (_MonoGenericParam.method): Move ...
7970         (_MonoGenericContainer): ... here.  Add into union with klass field.
7971         * class.c, icall.c, loader.c, metadata.c, reflection.c:
7972         Update to changes.
7973
7974 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
7975
7976         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
7977         the wrapper type enum and reduce relocations.
7978
7979 2007-01-12  Raja R Harinath  <rharinath@novell.com>
7980
7981         * reflection.c (inflate_mono_method): Reuse method instantiation
7982         from the generic method, if available.
7983
7984 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
7985
7986         * marshal.c (emit_marshal_variant): Fix conv_arg
7987         type in last commit, based on whether parameter is byref.
7988         
7989 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
7990
7991         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
7992         marshalling.
7993         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
7994         MONO_TYPE_OBJECT back for VARIANT support.
7995
7996 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
7997
7998         * marshal.c, marshal.h, icall-def.h: Implement 
7999         Marshal.ReAllocCoTaskMem.
8000
8001 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
8002
8003         * marshal.c: memory retention fixes: use the proper
8004         image cache for runtime_invoke method lookups.
8005
8006 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
8007
8008         * mempool.c: added code to help debug mempool allocations.
8009
8010 2007-01-11  Dick Porter  <dick@ximian.com>
8011
8012         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
8013         support (experimenting with faking it with IP_MTU_DISCOVER for
8014         systems that don't have IP_DONTFRAGMENT.)
8015         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
8016         icall.
8017
8018         * icall-def.h: new System.Net.Sockets.Disconnect icall.
8019
8020         * socket-io.h: Add new fields to MonoSocketAsyncResult
8021         corresponding to the new ones in Socket.cs.
8022
8023 2007-01-11  Raja R Harinath  <rharinath@novell.com>
8024
8025         Fix IronPython regression mentioned in #80249
8026         * metadata.c (do_mono_metadata_parse_generic_class): Clear
8027         'cached_context' field, since it may have been initialized as a
8028         side-effect of metadata parsing.
8029
8030         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
8031         (_MonoGenericClass.cached_class): Move here and rename from lone
8032         remaining field of ...
8033         (_MonoInflatedGenericClass): ... this.  Remove.
8034         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
8035         to changes.
8036
8037         Fix mcs/tests/test-128.cs regression.
8038         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
8039         2007-01-10 change below.
8040         [MONO_TYPE_OBJECT]: Recurse into array case.
8041
8042 2007-01-11  Raja R Harinath  <harinath@gmail.com>
8043
8044         * class-internals.h (mono_get_inflated_generic_class): Remove.
8045         * class.c (mono_get_inflated_generic_class): Remove.
8046         (mono_generic_class_get_class): Rename from
8047         mono_class_create_generic.
8048         (mono_class_from_mono_type) [GENERICINST]: Use it.
8049         * reflection.c, metadata.c: Update to changes.  Use
8050         'mono_class_from_mono_type'.
8051
8052 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
8053
8054         * reflection.c: use passed type when encoding an array element
8055         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
8056
8057 2007-01-09  Robert Jordan  <robertj@gmx.net>
8058
8059         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
8060         result arguments (someDelegate.EndInvoke (unrelatedAres)).
8061         Fixes bug #80392.
8062
8063 2007-01-09  Raja R Harinath  <rharinath@novell.com>
8064
8065         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
8066
8067         * object.c (set_value): Avoid aliasing between type->data.klass
8068         and type->data.generic_class.
8069
8070         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
8071
8072 2007-01-08  Raja R Harinath  <rharinath@novell.com>
8073
8074         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
8075         between type->data.klass and type->data.generic_class.
8076
8077 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
8078
8079         * marshal.c: In MS.NET, StringBuilder objects are not copied by
8080         value in out parameters.
8081
8082 2007-01-08  Raja R Harinath  <rharinath@novell.com>
8083
8084         Simplify invariant for MonoGenericClass::klass field.
8085         * class.c (mono_class_create_generic): Verify 'klass' is null.
8086         * metadata.c (do_mono_metadata_parse_generic_class): Don't
8087         initialize 'klass' field.
8088
8089 2007-01-05  Raja R Harinath  <rharinath@novell.com>
8090
8091         Ongoing work to avoid redundant data and simplify invariants.
8092         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
8093         'generic_class', and change type to a GenericInst.
8094         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
8095         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
8096
8097 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
8098
8099         * class.c : skip io-layer under PLATFORM_WIN32.
8100
8101 2007-01-03  Tor Lillqvist  <tml@novell.com>
8102
8103         Fix #80305: In a bundled executable, look in the bundled exe
8104         assembly to determine the runtime version. Add the possibility to
8105         bundle also the machine.config file.
8106         
8107         * assembly.c (mono_assembly_open_from_bundle): Make
8108         non-static. Allow being called even if we have no bundled
8109         assemblies, and return NULL right away in that case.
8110
8111         * domain-internals.h: Declare mono_assembly_open_from_bundle()
8112         here.
8113
8114         * domain.c (app_config_parse): Take an assembly exe file name as
8115         parameter instead of a config file name. Check for a bundled
8116         config file for that assembly by calling
8117         mono_config_string_for_assembly_file() (see below) before looking
8118         for one in the file system.
8119         (get_runtimes_from_exe): Corrsponding change to call of
8120         app_config_parse().
8121         (get_runtimes_from_exe): Check for bundled assembly exe file first
8122         by calling mono_assembly_open_from_bundle(). If no bundled
8123         assembly exe file is found, call mono_image_open() as before to
8124         look it up in the file system.
8125
8126         * mono-config.c: Add variable bundled_machinec_onfig.
8127         (mono_config_string_for_assembly_file): New function.
8128         (mono_config_for_assembly): Move code snippet that looks for a
8129         bundled assembly .config file into the above new function. Call
8130         it.
8131         (mono_register_machine_config, mono_get_machine_config): New
8132         functions to set and retrieve
8133
8134         * assembly.h: Declare mono_register_machine_config().
8135
8136         * mono-config.h: Declare mono_get_machine_config() and
8137         mono_config_string_for_assembly_file().
8138
8139         * icall.c: No declaration of environ necessary on Win32. It is
8140         declared (as a macro expanding to a function call) in stdlib.h.
8141         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
8142         New internal mono function. Returns the value of
8143         mono_get_machine_config() as a Mono string.
8144
8145         * icall-def.h: Add get_bundled_machine_config().
8146
8147 2007-01-04  Raja R Harinath  <rharinath@novell.com>
8148
8149         Remove redundant field
8150         * class-internals.h (_MonoGenericContext.container): Remove field.
8151         * loader.c (mono_method_get_signature_full): Don't parse a
8152         "container" for a signature parse when the signature is inflated
8153         immediately.
8154         (method_from_methodspec): Likewise, for a generic_inst.
8155         * class.c, metadata.c, reflection.c: Update to changes.
8156
8157 2006-01-04  Raja R Harinath  <rharinath@novell.com>
8158
8159         * class-internals.h (_MonoGenericClass): Rename 'context' field to
8160         'cached_context', and change semantics -- it starts off NULL, and
8161         is initialized on demand.
8162         * class.c (mono_generic_class_get_context): New accessor to
8163         replace 'context' field accesses.
8164         (mono_class_get_context): New helper.
8165         (*): Update to changes.
8166         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
8167
8168 2007-01-03  Miguel de Icaza  <miguel@novell.com>
8169
8170         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
8171         before the memcpy.   Fixes Marshal2 regression.
8172
8173 2007-01-02  Jb Evain  <jbevain@gmail.com>
8174
8175         * blob.h: add a MONO_TYPE_ENUM definition
8176         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
8177         fix the encoding of arrays of enums in custom attributes.
8178
8179         Fixes #79666.
8180
8181 2007-01-01  Miguel de Icaza  <miguel@novell.com>
8182
8183         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
8184         string is null terminated, but only cut the string short if it
8185         overflows the buffer.   
8186         
8187         (mono_string_to_byvalstr): Also fix this routine.   The code here
8188         was not properly terminating a string (it was only terminated
8189         because of the previous catch-all memset). 
8190
8191         I left the memset, because I do not know if applications expect
8192         the runtime to clear this region. 
8193
8194         Fixes #79944.
8195
8196         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
8197         Clear the error before returning to unmanaged code to prevent the
8198         runtime from being confused later on (fixes  80420).
8199         (ves_icall_type_from_name): Always call mono_loader_clear_error
8200         after parsing a type that could have failed.
8201         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
8202
8203         * loader.c (mono_loader_clear_error): Fix indentation.
8204
8205 2006-12-28  Martin Baulig  <martin@ximian.com>
8206
8207         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
8208
8209 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
8210
8211         * reflection.c: patch from Rolf Bjarne Kvinge to fix
8212         getting a token for an EnumBuilder.
8213
8214 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
8215
8216         * reflection.c: be more careful in case resource generation
8217         fails to create the data array.
8218
8219 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
8220
8221         * sgen-gc.c: write barrier for clone and fix unregister handles.
8222
8223 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
8224
8225         * reflection.c: some fixes needed in the generics code for the moving GC.
8226
8227 2006-12-22  Robert Jordan  <robertj@gmx.net>
8228
8229         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
8230         account. Fixes bug #80299.
8231
8232 2006-12-21  Raja R Harinath  <rharinath@novell.com>
8233
8234         Fix WaitHandle usage in delegates.
8235         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
8236         * object.c (mono_wait_handle_new): Use the property set method to
8237         initialize the handle.
8238         (mono_wait_handle_get_handle): New.
8239         * threadpool.c (mono_async_invoke): Use it.
8240         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
8241         Likewise.
8242         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
8243
8244 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
8245
8246         * marshal.c (emit_marshal): Call emit_marshal_variant and
8247         emit_marshal_com_interface when applicable.
8248         (emit_marshal_variant, emit_marshal_com_interface): Add
8249         methods for this case and remove if's from emit_marshal_object.
8250         
8251 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
8252
8253         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
8254
8255 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
8256
8257         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
8258         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
8259         and GlobalFree on Windows. Remove FIXME.
8260
8261 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
8262
8263         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
8264         implementation for managed objects.
8265
8266 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
8267
8268         * object.c: implemented code to be used for checking
8269         that no reference field overlaps with non-references.
8270
8271 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
8272
8273         * threadpool.c: fix queue code to be compatible with the
8274         moving GC.
8275
8276 2006-12-18  Miguel de Icaza  <miguel@novell.com>
8277
8278         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
8279         in structures by throwing ArgumentNullException.
8280
8281         (emit_marshal_safehandle): Also when they are null parameters.
8282
8283         (emit_marshal_safehandle): Add support for ref
8284         SafeHandles parameters
8285
8286 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
8287
8288         * profiler.c: updated to use the mono-dl API instead of
8289         gmodule.
8290
8291 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
8292
8293         * profiler.c: updated to use the mono-dl dynamic loading
8294         API instead of gmodule.
8295
8296 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
8297
8298         * profiler.c: use readlink, older versions of glib don't have
8299         g_file_read_link ().
8300
8301 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
8302
8303         * profiler.c: try to detect the path to mono if libc fails to provide
8304         a useful name (bug #80286).
8305
8306 2006-12-16  Raja R Harinath  <rharinath@novell.com>
8307
8308         Fix #80242
8309         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
8310         instance, use the generic type definition instead.
8311         (ves_icall_Type_GetNestedTypes): Likewise.
8312         * class.c (mono_class_create_generic): Always set the
8313         nested_classes of a generic instance to NULL, even if the generic
8314         type definition has nested types.
8315
8316 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
8317
8318         * marshal.c (mono_string_from_bstr): Revert previous Windows change
8319         and fix on Linux.
8320         
8321 2006-12-15  Miguel de Icaza  <miguel@novell.com>
8322
8323         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
8324         my arguments were in the wrong order.   I also fixed the Windows
8325         version which seems to have had the same issue.
8326
8327         (mono_free_bstr): On Unix, this is g_free.
8328         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
8329         conversions (for the tests in corlib to pass).
8330
8331 2006-12-14  Miguel de Icaza  <miguel@novell.com>
8332
8333         * marshal.c (emit_ptr_to_object_conv): For now, ignore
8334         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
8335         exception if a ref SafeHandle in a struct has changed).
8336         
8337         (emit_struct_conv): Do not perform layout checks for classes
8338         derived from SafeHandle, as those are specially handled. 
8339
8340         (emit_object_to_ptr_conv): Add support for
8341         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
8342
8343         (emit_marshal_safehandle): Implement conversion of return values
8344         of safehandles (MARSHAL_ACTION_CONV_RESULT).
8345         
8346         * threads.c: WaitHandle now is compiled with two different handles
8347         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
8348         for 2.0.
8349         
8350         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
8351         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
8352         these routines to cope with both kinds of fields.
8353
8354 2006-12-12  Miguel de Icaza  <miguel@novell.com>
8355
8356         * metadata.c (mono_type_to_unmanaged): Handle the case where
8357         type->data.klass is a SafeHandle, and in that case, return the
8358         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
8359         MONO_MARSHAL_CONV_SAFEHANDLE. 
8360
8361 2006-12-11  Miguel de Icaza  <miguel@novell.com>
8362
8363         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
8364         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
8365         calling emit_marshal_object.
8366
8367         (emit_marshal_safehandle): Implement marshalling of
8368         SafeHandle parameters (no ref support yet).
8369
8370         (MarshalAction): Document the defines as I implement
8371         them for SafeHandle.
8372
8373         (emit_marshal_object): indentation police.
8374
8375         * class-internals.h: Define MonoSafeHandle.
8376         Add safehandle_class to MonoDefaults type.
8377
8378         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
8379         list of classes to check for fields. 
8380
8381         * domain.c (mono_init_internal): Add SafeHandle to the list of
8382         mono_defaults loaded.
8383
8384 2006-12-15  Raja R Harinath  <rharinath@novell.com>
8385
8386         Fix #80253
8387         * reflection.c (mono_reflection_bind_generic_parameters): If the
8388         generic type definition is a type builder, ensure that it is fully
8389         initialized before instantiating it.  Kill some dead code.
8390
8391 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
8392
8393         * object.c: clear the loader_error () before loading
8394         more metadata stuff (bug #80258).
8395
8396 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
8397
8398         * icall.c, icall-defs.h: type modifiers icalls for
8399         parameters and properties.
8400
8401 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
8402
8403         * object.c, icall.c: fixed warnings.
8404
8405 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
8406
8407         * marshal.c: fixed a couple of leaks and coding style in a few places.
8408
8409 2006-12-08  Dick Porter  <dick@ximian.com>
8410
8411         * process.c: Cope with NULL ProcessStartInfo arguments on windows
8412         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
8413         80173.
8414
8415 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
8416
8417         * process.c: ProcessStartInfo may have only filename set and
8418         arguments can be NULL.
8419
8420 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
8421
8422         * icall.c: fix leak found by Robert Jordan.
8423
8424 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
8425
8426         * marshal.c, marshal.h: generate managed method to access an element
8427         of a multi-dimensional array.
8428
8429 2006-11-30  Paolo Molaro (lupus@ximian.com)
8430
8431         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
8432
8433 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
8434
8435         * icall.c: back out GetFields () fix until the serialization code is
8436         fixed to not depend on the incorrect behaviour.
8437
8438 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
8439
8440         * profiler.c: provide defaults if none are set.
8441
8442 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
8443
8444         * Makefile.am, attrdefs.h: new public header file with
8445         constants for attributes for use by embedders.
8446
8447 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
8448
8449         * icall.c: GetFields () fix for bug #80064.
8450
8451 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
8452
8453         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
8454         removed long unused icalls.
8455
8456 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
8457   
8458         * marshal.c: 
8459                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
8460                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
8461                 can be generated without a delegate class.
8462                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
8463         
8464         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
8465
8466 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8467
8468         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
8469         #80069.
8470
8471 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
8472
8473         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
8474         icall-def.h: added icalls needed by System.GC.
8475
8476 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
8477
8478         * loader.c: ensure the class in catch clauses is handled
8479         correctly for generics methods (fixes bug#79980).
8480
8481 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
8482
8483         * monitor.h, monitor.c: added mono_locks_dump () function
8484         to help debug deadlocks involving managed locks.
8485
8486 2006-11-13  Dick Porter  <dick@ximian.com>
8487
8488         * file-io.c (get_file_attributes): If the file is a symlink try
8489         and get the stat data for the target, but also add the
8490         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
8491         the specs for the windows symlink support, but will probably have
8492         to be reworked when I have test data from a vista machine.  Fixes
8493         bug 79887.
8494
8495 2006-11-13  Dick Porter  <dick@ximian.com>
8496
8497         * gc.c (mono_domain_finalize): 
8498         * marshal.c (mono_delegate_begin_invoke): 
8499         * threadpool.c (socket_io_init, mono_thread_pool_init)
8500         (mono_thread_pool_finish): 
8501         * monitor.c (mono_monitor_try_enter_internal): 
8502         * threads.c (mono_thread_resume, mono_thread_init)
8503         (mono_thread_suspend_all_other_threads)
8504         (mono_thread_execute_interruption): 
8505         * appdomain.c (mono_domain_unload): Check for NULL error returns
8506         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
8507         75733.
8508
8509 2006-11-11  Miguel de Icaza  <miguel@novell.com>
8510
8511         * process.c
8512         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
8513         Only close the handle if the value of the handle is not
8514         INVALID_HANDLE_VALUE.  This just makes the process a bit more
8515         robust.
8516
8517         Improvement for #75733, so that we do not run into this problem. 
8518
8519         
8520         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
8521         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
8522         internal variables.  Fixes #79462 
8523         
8524
8525 2006-11-09  Dick Porter  <dick@ximian.com>
8526
8527         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
8528         Use poll() not select().  Fixes bug 79397.
8529
8530 2006-11-09  Raja R Harinath  <rharinath@novell.com>
8531
8532         Fix #79872
8533         * assembly.c (mono_assembly_load_from_full): Check that the given
8534         image has an assembly manifest.
8535
8536 2006-11-09  Ankit Jain  <jankit@novell.com>
8537
8538         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
8539         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
8540         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
8541
8542 2006-11-07  Dick Porter  <dick@ximian.com>
8543
8544         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
8545         Put the old resolver behaviour back for pre-2.0 profiles.
8546
8547 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
8548
8549         * threadpool.c: precise GC and locking fixes.
8550
8551 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
8552
8553         * class.c: don't load types that have an explicit unaligned
8554         managed reference. Provide better info in the TypeLoad exception.
8555         Part of the fix for bug #79744.
8556         * object.c: use the correct check for class type load issues.
8557
8558 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
8559
8560         * class.c: enforce alignment of fields with managed references
8561         even when Pack=1 is forced by the user (bug #77788).
8562
8563 2006-11-03  Dick Porter  <dick@ximian.com>
8564
8565         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
8566         If the address reverse lookup fails, return it as the hostname
8567         anyway.  Fixes bug 79721.
8568
8569 2006-11-03  Dick Porter  <dick@ximian.com>
8570
8571         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
8572         Fix build on Windows.
8573
8574 2006-11-02  Dick Porter  <dick@ximian.com>
8575
8576         * icall-def.h: 
8577         * object-internals.h: 
8578         * exception.c (mono_get_exception_thread_interrupted): 
8579         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
8580         Fixes bug 74525.
8581
8582         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
8583         Check for pending Thread.Interrupt.
8584
8585 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
8586         * loader.c: Fixed bug 79684.
8587
8588 2006-10-27  Dick Porter  <dick@ximian.com>
8589
8590         * file-io.c (get_file_attributes): Force symlinks to directories
8591         to be returned as a regular file.  Fixes bug 79733.
8592 2006-10-26  Dick Porter  <dick@ximian.com>
8593
8594         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
8595         CreateFile to open a directory then we need to set the
8596         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
8597
8598 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
8599
8600         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
8601         friends.
8602
8603 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
8604
8605         * sgengc.c: small cleanup of timer code.
8606
8607 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
8608
8609         * sgen-gc.c: fix some warnings and start adding support for
8610         complete object removal on domain unload.
8611
8612 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
8613
8614         * assembly.c: build_assembly_name should not consider a version
8615         number without build or revision number invalid. Fixes bug #79715.
8616
8617 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
8618
8619         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
8620         call kernel32 function OutputDebugString directly.
8621         
8622         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
8623         
8624 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
8625
8626         * reflection.c: small cleanup, using a function to insert a MonoString
8627         in the string heap.
8628
8629 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
8630
8631         * reflection.c: moving GC fixes.
8632
8633 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
8634
8635         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
8636         all the objects with finalizers belonging to an unloading appdomain.
8637
8638 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
8639
8640         * sgen-gc.c: added ability to allocate even when the nursery is fully
8641         pinned and fixed a couple of bugs.
8642
8643 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
8644
8645         * threads.h: Revert the last change for now.
8646
8647         * threads.h (mono_thread_get_pending_exception): Rename this to
8648         mono_thread_get_undeniable_exception ().
8649
8650 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
8651
8652         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
8653         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
8654         when fname does not refer to valid assembly. This result in a more
8655         meaningful error message.
8656         * exception.c: added mono_get_exception_bad_image_format2 which 
8657         constructs a BadImageFormatException using the ctor taking a custom
8658         message and the file name. Passing in a NULL msg results in a default
8659         message.
8660         * exception.h: define mono_get_exception_bad_image_format2 function.
8661         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
8662         when file name pointed to an invalid IL image. Use 
8663         mono_get_exception_file_not_found2 to construct FileNotFoundException,
8664         as this results in a more meaningful error message.
8665
8666 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
8667
8668         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
8669         #79465.
8670
8671 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
8672
8673         * metadata.c (mono_type_size): Change the align parameter to guint32 for
8674         consistency with the other _size functions.
8675         (mono_type_stack_size): Ditto.
8676
8677         * class.c object.c icall.c: Fix warnings caused by the above change.
8678
8679         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
8680
8681         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
8682
8683         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
8684
8685 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
8686
8687         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
8688         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
8689         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
8690         threadpool.h, threads-types.h: mark more internal functions.
8691
8692 2006-10-11  Dick Porter  <dick@ximian.com>
8693
8694         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
8695         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
8696         reproduce the bug even before applying the fix.)
8697
8698 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
8699
8700         * reflection.c: allow retrieving attributes for arguments in generic
8701         methods (bug #79241).
8702
8703 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
8704
8705         * debug-mono-symfile.c: properly check fopen () result (found by
8706         coverity).
8707
8708 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
8709
8710         * reflection.c: make error message clearer and fixed two
8711         issuelets found by Coverity.
8712
8713 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
8714
8715         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
8716
8717 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
8718
8719         * object-internals.h, gc-internal.h, profiler-private.h:
8720         mark internal functions.
8721
8722 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
8723
8724         * reflection.c: put data in the text section.
8725         * icall.c: recognize more types in type_from_typename ().
8726         * process.c, marshal.c: added some GC FIXMEs.
8727
8728 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
8729
8730         * loader.c: check for NULL before initializing.
8731
8732 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
8733
8734         * gc.c (finalizer_thread): Use a non-alertable wait here.
8735
8736         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
8737         until the correct solution is found.
8738
8739 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
8740
8741         * reflection.c (mono_module_get_object): Avoid an assert when operating on
8742         modules with no metadata. Fixes #79596.
8743
8744         * image.c (load_metadata_ptrs): Put back the error message when
8745         the #- heap is encountered since the support is not complete yet.
8746
8747 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
8748
8749         * gc.c: do not allow the user to SuppressFinalize () a
8750         delegate because it would leak the trampoline if present.
8751
8752 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
8753
8754         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
8755         PropertyPtr table.
8756
8757 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
8758
8759         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
8760
8761         * metadata.c (mono_metadata_get_param_attrs): Ditto.
8762
8763         * row-indexes.h: Add definitions for *Ptr tables.
8764
8765         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
8766
8767         * metadata.c (mono_metadata_translate_token_index): New helper function to
8768         translate table indexes used in uncompressed metadata.
8769         (mono_metadata_decode_table_row): Ditto.
8770         (mono_metadata_decode_table_row_col): Ditto.
8771
8772         * metadata.c: Add table schema for *Ptr tables.
8773
8774         * class.c loader.c: Use the new helper function to access the affected metadata
8775         tables.
8776         
8777         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
8778         #38532.
8779         
8780 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
8781
8782         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
8783         sequences which can be unbounded in size. Fixes #79583.
8784
8785 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
8786
8787         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
8788         static initialization.
8789
8790         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
8791
8792         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
8793
8794         * domain.c (mono_domain_free): Free up type_init_exception_hash.
8795
8796         * object.c (mono_runtime_class_init): Implement correct semantics when a static
8797         ctor fails, i.e. throw the same exception on subsequent accesses.
8798         
8799 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
8800
8801         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
8802         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
8803         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
8804         Handle marshalling of interfaces and VARIANTs contained in structs.
8805         
8806         Code is contributed under MIT/X11 license.
8807         
8808 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
8809
8810         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
8811         
8812         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
8813         mempool.
8814
8815 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8816
8817         * console-io.c: ignore previous SIGINT handler.
8818
8819 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
8820
8821         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
8822         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
8823         #79460, #79461, #79485.
8824
8825         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
8826
8827         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
8828         #79217.
8829
8830 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
8831
8832         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
8833         could be generated from it.
8834
8835 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
8836
8837         * rand.c: fix read loop to correctly handle EINTR.
8838
8839 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
8840
8841         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
8842         internal calls are defined to keep methods closer to the declaring
8843         type and allow a significant reduction in runtime relocations and
8844         memory usage.
8845
8846 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
8847
8848         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
8849         exception message to have FileNotFoundException use the default
8850         assembly load error message. Fixes bug #79426.
8851         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
8852
8853 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8854
8855         * threadpool.c: (start_thread_or_queue) use the root domain when
8856         creating the thread instead of the async object one.
8857
8858 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
8859
8860         * class.c, object.c, class-internals.h, reflection.c:
8861         for arrays, store element_size inside MonoClass (speedup
8862         for array object creation).
8863
8864 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
8865
8866         * icall.c: fixed CodeBase to use the file name and not the module
8867         name (bug #79365).
8868
8869 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
8870
8871         * mono-debug.c, mono-debug.h: export find_method as
8872         mono_debug_find_method ().
8873
8874 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
8875
8876         * debug-helpers.c, class-internals.h: added a few functions useful
8877         when debugging under gdb.
8878
8879 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8880
8881         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
8882         characters that need special handling.
8883
8884 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
8885
8886         * mono-config.c: make the os/cpu specification more flexible,
8887         allowing lists and negation.
8888
8889 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
8890
8891         * marshal.c: COM Interop fixes. Handle case where method->klass.
8892         is interface. Handle BSTR/MonoString when null. Use CDECL as 
8893         calling convention on non-windows platforms. This is for
8894         compatibility with XPCOM and MainWin COM.
8895         
8896         Code is contributed under MIT/X11 license.
8897         
8898
8899 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
8900
8901         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
8902         correctly. Fixes #79217.
8903
8904         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
8905
8906 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
8907
8908         * mono-config.c: allow both an os and cpu attribute for dllmap
8909         and dllentry elemnets to enable a single config file to be used
8910         for multiple architectures.
8911
8912 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
8913
8914         * loader.c: MonoLoaderError was cleared too soon on load failure.
8915         Fixes bug #79424.
8916
8917 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
8918
8919         * icall.c: use the defining class vtable when accessing a
8920         static field, not a pobblibly derived class.
8921
8922 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
8923
8924         * icall.c string-icalls.c: Remove references to unicode.h.
8925
8926         * unicode.h unicode.c Makefile.am: Remove these unused source files.
8927
8928         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
8929
8930         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
8931         indicating the image where custom marshaller types should be looked up.
8932         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
8933         custom marshallers, instead of corlib. Fixes #79425.
8934
8935 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
8936
8937         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
8938
8939 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
8940
8941         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
8942         Implement Environment.ProcessorCount.
8943         
8944         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
8945         Implement Environment.ProcessorCount.
8946         
8947         * icall.c: 
8948         Add Environment.ProcessorCount icall.
8949         
8950         Patch by Jason McFall.
8951
8952 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8953
8954         * assembly.c: don't append .exe/.dll when the filename already contains
8955         one of those extensions.
8956
8957 2006-09-12  Martin Baulig  <martin@ximian.com>
8958
8959         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
8960         to array interfaces.
8961
8962 2006-09-11  Martin Baulig  <martin@ximian.com>
8963
8964         * reflection.c (mono_image_build_metadata): Create the
8965         MethodImpl's after emitting all types and methods, so we don't
8966         need another fixup pass for them.
8967
8968 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
8969
8970         * class.c (mono_class_from_name_case): Fix regression introduced by the last
8971         change.
8972
8973 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
8974
8975         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
8976         unload.
8977
8978 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
8979
8980         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
8981         args is not set. Fixes #78926.
8982
8983 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
8984
8985         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
8986
8987         * image.c (load_class_names): Move this to class.c, and rename it to 
8988         'mono_image_init_name_cache'.
8989         (load_modules): Fix a warning.
8990
8991         * class.c icall.c image.c: Initialize image->name_cache lazily.
8992
8993         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
8994         on its name using information in the AOT file.
8995
8996         * class.c (mono_class_from_name): Use the new hook function.
8997
8998 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
8999
9000         * reflection.c (mono_param_get_objects): Handle enum default parameter values
9001         correctly.
9002
9003         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
9004         Fixes #79289.
9005         
9006 2006-09-06  Martin Baulig  <martin@ximian.com>
9007
9008         * icall.c (mono_lookup_internal_call): Small fix.
9009
9010 2006-09-05  Raja R Harinath  <rharinath@novell.com>
9011
9012         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
9013         double g_free.
9014
9015 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
9016
9017         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
9018         when --debug is specified.
9019
9020 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
9021
9022         * class.c (setup_generic_array_ifaces): Fix a warning.
9023
9024 2006-09-04  Miguel de Icaza  <miguel@novell.com>
9025
9026         * Temporarily remove the patch to assemly.c that checks the
9027         assembly versions as it breaks our gacutil.
9028
9029 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
9030
9031         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
9032
9033         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
9034         a net 1.0 runtime.
9035
9036         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
9037         created using the default ctor. Fixes #79152.
9038         (mono_string_builder_to_utf16): Ditto.
9039
9040 2006-09-01  Martin Baulig  <martin@ximian.com>
9041
9042         Fix handling of the generic array interfaces.
9043
9044         * class-internals.h
9045         (MonoDefaults): Removed `generic_array_class' and added
9046         `generic_ilist' class.
9047
9048         * class.c
9049         (mono_bounded_array_class_get): Add the new generic array interfaces.
9050         (setup_generic_array_ifaces): New static method; create vtable
9051         entries for each method in the generic array interfaces.
9052
9053         * metadata.c
9054         (select_container): Allow "parent-less" generic methods.
9055
9056         * marshal.c
9057         (mono_marshal_get_generic_array_helper): New public method.
9058
9059         * icall.c
9060         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
9061         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
9062         moved the interncall into System.Array.
9063
9064 2006-09-01  Raja R Harinath  <rharinath@novell.com>
9065
9066         A few more cases of avoiding work on types with ->byref set.
9067         Has the real fix for #79238
9068         * icall.c (is_generic_parameter): New helper.
9069         (ves_icall_Type_GetGenericParameterPosition): Use it.
9070         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
9071         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
9072         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
9073         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
9074         reference types.
9075         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
9076         reference types.
9077         (ves_icall_Type_get_IsGenericInstance): Likewise.
9078         (ves_icall_Type_get_IsGenericType): Likewise.
9079
9080 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
9081
9082         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
9083         class if possible.
9084
9085         * mempool.h (mono_mempool_get_allocated): New helper function.
9086
9087         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
9088         change.
9089
9090         * mempool.c: Fix warnings and the calculation of stats.
9091
9092         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
9093
9094         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
9095
9096         * loader.c (mono_get_method_from_token): Update method_count stat.
9097
9098         * class-internals.h (MonoStats): Add some stats.
9099
9100 2006-08-31 Robert Jordan  <robertj@gmx.net>
9101
9102         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
9103         with managed variants.
9104         All code is contributed under the MIT/X11 license.
9105         
9106 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
9107
9108         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
9109         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
9110
9111         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
9112
9113         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
9114         with cycles in classes.
9115
9116         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
9117
9118         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
9119         missing a [MarshalAs] directive. Fixes #79203.
9120
9121         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
9122         klass->marshal_info. Fixes #79217.
9123
9124 2006-08-30  Martin Baulig  <martin@ximian.com>
9125
9126         Committing a patch from Joachim Ante <joe@otee.dk>:
9127         Add support for binary data symbol stores.
9128
9129         * debug-mono-symfile.c
9130         (mono_debug_open_mono_symbol_file): Renamed into
9131         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
9132         arguments.
9133
9134         * mono-debug.c
9135         (mono_debug_open_image): Added `raw_contents' and `size' args.
9136         (mono_debug_init_2_memory): New public function.
9137
9138 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
9139
9140         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
9141
9142 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9143
9144         * appdomain.c: implement support for ShadowCopyFiles.
9145
9146 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
9147
9148         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
9149         when value is NULL (and should remove CID #51).
9150
9151 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9152
9153         * image.c: moved 2 functions to ../utils.
9154
9155 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
9156
9157         * gc.c: cope with the target object of a GC handle being NULL
9158         (bug #78877).
9159
9160 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
9161
9162         * class.c: recursively check parent's explicit implementations
9163         of interface methods (fixes bug #79125).
9164
9165 2006-08-19  Miguel de Icaza  <miguel@novell.com>
9166
9167         * filewatcher.c: Avoid warnings when building, do not redefine
9168         constants that are defined.
9169
9170         Remove warnings.
9171
9172 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9173
9174         * image.c: don't fail when the link points to an absolute path.
9175
9176 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
9177
9178         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
9179         Fix CID #3.
9180
9181 2006-08-17  Miguel de Icaza  <miguel@novell.com>
9182
9183         * image.c (full_path): A new method used to obtain the actual path
9184         of an assembly even in the presence of symbolic links.  
9185
9186         This is necessary for the case where we are running a binary that
9187         has been GACed, but we are using the "published" path name
9188         ($prefix/mono/1.0/blah.exe) which happens to point to the real
9189         file in the GAC.
9190
9191         This was the source of the failure for the `xsp' command with the
9192         recent AppDomain changes, as far as the runtime was concerned,
9193         there were two different assemblies: $prefix/mono/1.0/blah.exe and
9194         $prefix/mono/gac/blah/version/blah.exe.
9195
9196         (do_mono_image_open): use full path
9197
9198 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
9199
9200         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
9201
9202 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
9203
9204         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
9205         domain_id is supplied. Fix CID #241 and corlib's unit tests.
9206
9207 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
9208
9209         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
9210         small structures. Fixes #78990.
9211
9212 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
9213
9214         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
9215
9216         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
9217
9218 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9219
9220         * appdomain.c:
9221         * marshal.c: don't load all the assemblies from a domain into newly
9222         created ones. The new domains might have different rules and load
9223         assemblies from different locations. Fixes bug #76757.
9224
9225         Patch by Lluis. Conflicts resolved by Brian Crowell.
9226
9227 2006-08-16  Alp Toker  <alp@atoker.com>
9228
9229         * socket-io.c: First half of the fix for #79084.
9230         Set sa_size to the length of the content, not that of the struct.
9231         Don't add NULL suffix to the content, this should be done in
9232         managed code if needed.
9233
9234 2006-08-14  Raja R Harinath  <rharinath@novell.com>
9235
9236         Fix part of #79012
9237         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
9238         mono_metadata_parse_type returns NULL.
9239
9240 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
9241
9242         * normalization-tables.h : new file for string normalization data.
9243         * locales.c, locales.h, icall.c :
9244           added load_normalization_resource() for string normalization,
9245           and icall as well.
9246         * Makefile.am : added normalization-tables.h to the sources.
9247
9248 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
9249
9250         * marshal.c: Add more helper functions to reduce code duplication and use them
9251         everywhere.
9252
9253 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
9254
9255         * marshal.c: Fix non-x86 stdcall warnings.
9256         
9257         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
9258         them everywhere.
9259
9260 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
9261
9262         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
9263         type check on multi-dimensional arrays. Fixes #79000.
9264
9265 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
9266
9267         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
9268         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
9269         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
9270         * class-internals.h: add is_com_object to class structure.
9271         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
9272         null checks to COM object marshalling. Fix .ctor call on RCW.
9273         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
9274         
9275         All code is contributed under the MIT/X11 license.
9276
9277 2006-08-09  Dick Porter  <dick@ximian.com>
9278
9279         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
9280         racing mono_monitor_allocator_lock() somewhere, so don't delete
9281         the critical section for now.  Found by running and exiting
9282         monodevelop.
9283
9284 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
9285
9286         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
9287         (ves_icall_System_ComObject_FindInterface): Ditto.
9288         (ves_icall_System_ComObject_CacheInterface): Ditto.
9289
9290         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
9291         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
9292
9293 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9294
9295         * threadpool.c: treat pipes from process asynchronous reads as sockets
9296         when reading from them, so we get select/poll or epoll to wait for
9297         data.
9298
9299 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
9300
9301         * loader.c: Fix a typo (CID #233) in the null check.
9302
9303 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
9304
9305         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
9306         Hopefully fixes #78949.
9307         
9308         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
9309         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
9310         bytes. Fixes #78972.
9311
9312 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9313
9314         * filewatcher.c: we need to set errno here.
9315
9316 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9317
9318         * filewatcher.c: let Win32Exception get the error value.
9319
9320 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9321
9322         * filewatcher.c: translate errno into win32 errors for Win32Exception
9323         to know what happened.
9324
9325 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
9326
9327         * threadpool.c: Fix more warnings.
9328
9329         * assembly.c (search_loaded): Fix warnings.
9330
9331         * threadpool.c (mono_thread_pool_finish): Fix warnings.
9332         (mono_async_invoke): Ditto.
9333
9334 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
9335
9336         * object.c (mono_remote_class_vtable): Need to create proxy vtable
9337         entries for __ComObject type in addition to ComImport types.
9338         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
9339         about hash table.
9340         
9341         All code is contributed under the MIT/X11 license.
9342
9343 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
9344
9345         * image.c: avoid tentative loading of modulerefs that contain
9346         no metadata (P/Invoke library names).
9347
9348 2006-07-28  Dick Porter  <dick@ximian.com>
9349
9350         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
9351         mono_loader_lock() somewhere, so don't delete the critical section
9352         for now.  Found by running and exiting monodevelop.
9353
9354 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9355
9356         * filewatcher.c: define the inotify syscalls when we're building on
9357         linux and have sys/syscall.h. The build system might not have support
9358         for inotify but the target system might have it.
9359
9360 2006-07-26  Miguel de Icaza  <miguel@novell.com>
9361
9362         * domain.c: Documentation updates.
9363
9364         * loader.c (mono_free_method): Do not release the method
9365         information if we are being profiled, as profilers will use this
9366         information at shut down to present some data to the user.
9367
9368         This is needed so that the profiler does not crash, as the
9369         profiler tends to keep MonoMethods around, and they might become
9370         invalid if we free these.
9371
9372         (mono_get_method_constrained): Return the original CIL stream
9373         method as well, so verification can be performed against it.
9374
9375 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9376
9377         * filewatcher.[ch]: support for inotify file system watcher.
9378         * icall.c: add new internal calls for the inotify file system watcher.
9379
9380 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9381
9382         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
9383         #78888.
9384
9385 2006-07-20  Dick Porter  <dick@ximian.com>
9386
9387         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
9388         warning.
9389
9390 2006-07-20  Dick Porter  <dick@ximian.com>
9391
9392         * threads.c (start_wrapper): Do the thread cleanup while we still
9393         hold a reference to its object.  Fixes bug 78123.
9394
9395 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
9396
9397         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
9398         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
9399           "managed-to-managed".
9400         * icall.c: Redirect string constructors that take sbyte* to
9401           ves_icall_System_String_ctor_RedirectToCreateString.
9402         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
9403           to CreateString () methods with matching signature.
9404         * reflection.c: Use original security informations for
9405           MONO_WRAPPER_MANAGED_TO_MANAGED.
9406         * security-manager.c: Use original security informations for
9407           MONO_WRAPPER_MANAGED_TO_MANAGED.
9408         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
9409           that is a placeholder and only its address should be used.
9410         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
9411           that is a placeholder and only its address should be used.
9412
9413 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
9414
9415         Begin implementing COM Interop.
9416         * appdomain.c: Increment corlib version.
9417         * class.c: Set ComImport classes' parent to __ComObject.
9418         * loader.c: Mark cominterop methods as such.
9419         * domain.c: Add __ComObject class to MonoDefaults structure.
9420         * image.c: Add 2 hashtables to the image for COM Interop related methods
9421         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
9422         using the mempool allocator
9423         
9424         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
9425         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
9426         declaration for mono_metadata_type_dup_mp.
9427         
9428         * debug-helpers.c: Added strings for two additional wrapper types
9429         * object.c: Create proxy objects for ComImport classes
9430         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
9431         and added __ComObject class to MonoDefaults structure.
9432         
9433         * object-internals.h: Finish MonoRealProxy definition, and add definition of
9434         MonoComInteropProxy and MonoComObject.
9435         
9436         * marshal.c: Added support for COM Interop
9437         (signature_cominterop): Converts managed signature to corresponding
9438         unmanaged COM signature.
9439         (cominterop_get_function_pointer): gets unmanaged function pointer via
9440         COM object vtable
9441         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
9442         (cominterop_get_method_interface): returns interface type that method is defined on
9443         (mono_mb_emit_cominterop_call): emits native call to function pointer
9444         gotten from vtable
9445         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
9446         that matches signature of unmanaged function.
9447         (cominterop_get_native_wrapper): wrapper around adjusted method call.
9448         (cominterop_get_invoke): forwards call from proxy to __ComObject
9449         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
9450         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
9451         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
9452         
9453         * marshal.h: Added Marshal icall declarations.
9454         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
9455         so we can access them in finalizer
9456         
9457 2006-07-14  Dick Porter  <dick@ximian.com>
9458
9459         * object.c (mono_type_initialization_cleanup): Fix a race
9460         condition by temporarily commenting out the critical section
9461         deletion.
9462
9463 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
9464
9465         * reflection.c (create_custom_attr): Fix some warnings.
9466         (create_custom_attr_data): Ditto.
9467         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
9468         types. Fixes #78855.
9469
9470 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
9471
9472         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
9473
9474         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
9475
9476 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
9477
9478         * reflection.c (resolve_object): Add support for DynamicMethod.
9479
9480         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
9481         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
9482
9483 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
9484
9485         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
9486         don't leak GPtrArray's pdata has we have no use (nor free) for it.
9487
9488 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
9489
9490         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
9491         Fixes #77888.
9492
9493 2006-06-30  Raja R Harinath  <rharinath@novell.com>
9494
9495         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
9496         slightly: remove a shadow local variable.
9497
9498 2006-06-29  Raja R Harinath  <rharinath@novell.com>
9499
9500         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
9501         definition that introduces the virtual function slot.
9502         Also fix Coverity #105.
9503
9504 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
9505
9506         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
9507         for dynamic assemblies. Fixes #78724.
9508
9509 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
9510
9511         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
9512         Fixes #78722.
9513
9514 2006-06-21  Martin Baulig  <martin@ximian.com>
9515
9516         * reflection.c
9517         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
9518         fixes #76484.
9519
9520 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
9521
9522         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
9523
9524 2006-06-20  Raja R Harinath  <rharinath@novell.com>
9525
9526         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
9527         nor TYPEREFs.
9528         * class.c (mono_class_create_from_typespec): Add 'context' argument.
9529         Inflate result if necessary.
9530         (mono_class_get_full): Remove old version.  Rename from
9531         'mono_class_get' and add 'context' argument.  Pass it to
9532         ..._create_from_typespec.
9533         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
9534         (mono_ldtoken): Revert change below.
9535
9536 2006-06-20  Martin Baulig  <martin@ximian.com>
9537
9538         * class.c (mono_ldtoken): Don't pass the generic context to
9539         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
9540
9541 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
9542
9543         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
9544         and later freeing it. Fixes #78638.
9545
9546 2006-06-15  Miguel de Icaza  <miguel@novell.com>
9547
9548         * icall.c (mono_class_get_throw): Revert over-zealous error
9549         throwing, the caller for mono_class_get_throw will cope with
9550         errors when classes are not properly initialized already.
9551
9552         The code still copes with loader exceptions though.
9553
9554         Fixes the regression in reftype1 and reftype3 from the CAS tests.
9555         
9556 2006-06-14  Miguel de Icaza  <miguel@novell.com>
9557
9558         Fixes the `make run1' version of RuntimeAbort (to be commited,
9559         source is in Bugzilla).
9560         
9561         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
9562         FALSE on class loading failure instead of returning true.
9563
9564         * class.c (mono_class_create_from_typedef): It is possible for
9565         mono_metadata_interfaces_from_typedef_full to fail if a class is
9566         not found, cope with this.
9567         
9568
9569 2006-06-14  Dick Porter  <dick@ximian.com>
9570
9571         * socket-io.c: 
9572         * process.c: Fix a bunch of signed/unsigned warnings from gcc
9573         4.1.1
9574
9575 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
9576
9577         * culture-info-table.h : oops, forgot to make it nsync with r61548.
9578
9579 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
9580
9581         * icall.c: Another fix for building mono in Visual Studio.
9582
9583 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
9584
9585         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
9586         
9587 2006-06-09  Martin Baulig  <martin@ximian.com>
9588
9589         * debug-mono-symfile.c: Put this back and really fix it this
9590         time. Sorry for all the trouble.
9591
9592 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
9593
9594         * icall.c (mono_class_get_throw): Fix a warning.
9595         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
9596         ReflectionTypeLoadException if needed. Fixes #78606.
9597
9598         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
9599         (mono_class_init): Ditto.
9600
9601         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
9602         ref_only exceptions.
9603         (mono_loader_clear_error): Make this work even if there is no error.
9604
9605 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
9606
9607         * object-internals.h marshal.c marshal.h icall.c: Implement method 
9608         Marshal.GetComSlotForMethodInfo using internal call.
9609
9610 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
9611
9612         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
9613         a function for signalling it.
9614
9615         * class.c (mono_class_from_typeref): Use the new kind of loader error when
9616         a referenced assembly is not found.
9617
9618         * loader.c (mono_loader_error_prepare_exception): Add support for 
9619         LOADER_ERROR_ASSEMBLY. Fix formatting.
9620
9621 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
9622
9623         * domain.c appdomain.c class-internals.h marshal.c: Add support 
9624         for VARIANT marshalling on windows and increment corlib version
9625         since Variant struct was added.
9626
9627 2006-06-03  Miguel de Icaza  <miguel@novell.com>
9628
9629         * debug-mono-symfile.c: Revert Martin's previous patch which broke
9630         stack trace line information:
9631
9632         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
9633         (Martin) when looking up B which is between A and C, return A not C.
9634
9635         Bug is #78573.
9636
9637         Thanks to Alexander Olk for tracking this down.
9638
9639 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
9640
9641         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
9642         
9643         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
9644         avoid clobbering its value.
9645         (mono_string_to_lpstr): Fix a warning on windows.
9646
9647 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
9648
9649         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
9650
9651         * reflection.c loader.c: Removed references to 'dummy' flag.
9652
9653         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
9654
9655         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
9656         it gets GC tracking.
9657
9658         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
9659         GC tracking.
9660         
9661         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
9662
9663         * marshal.c threadpool.c: Update callers of mono_async_result_new.
9664
9665         * appdomain.c: Bump corlib version.
9666
9667 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
9668
9669         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
9670         CEE_STIND_REF when working with object references.
9671
9672 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
9673
9674         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
9675         Fixes #78539.
9676
9677 2006-05-30  Miguel de Icaza  <miguel@novell.com>
9678
9679         * loader.c (method_from_memberref): Fix argument value for
9680         mono_loader_set_error_method_load (I was passing the MonoClass
9681         instead of the class name char *).
9682
9683 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
9684
9685         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
9686         CEE_STIND_REF when working with object references.
9687
9688 2006-05-30  Martin Baulig  <martin@ximian.com>
9689
9690         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
9691         mono_method_full_name() change and replace the ':' with a '.'
9692         here.
9693
9694 2006-05-30  Martin Baulig  <martin@ximian.com>
9695
9696         * debug-mono-symfile.c
9697         (mono_debug_symfile_lookup_location): Fix the algorithm:
9698         when looking up B which is between A and C, return A not C.
9699
9700 2006-05-29  Martin Baulig  <martin@ximian.com>
9701
9702         * mono-debug.h
9703         (MonoDebugMethodInfo): Make the typedef public.
9704         (MonoDebugSourceLocation): New public struct.
9705
9706         * mono-debug.c
9707         (mono_debug_source_location_from_address): Removed.
9708         (mono_debug_source_location_from_il_offset): Removed.
9709         (mono_debug_il_offset_from_address): Removed.
9710         (mono_debug_address_from_il_offset): Removed.
9711         (mono_debug_lookup_method): New public function.
9712         (mono_debug_lookup_source_location): New public function; replaces
9713         the old mono_debug_source_location_from_*() functions; see the
9714         inline documentation.
9715         (mono_debug_free_source_location): New public function.
9716         (mono_debug_print_stack_frame): New public function; see the
9717         inline documentation.
9718
9719         * debug-mono-symfile.c
9720         (mono_debug_find_source_location): Renamed into
9721         mono_debug_symfile_lookup_location(); only take a
9722         `MonoDebugMethodInfo *' and an `offset' argument; added inline
9723         documentation.
9724         (mono_debug_find_method): Renamed into
9725         mono_debug_symfile_lookup_method().
9726
9727 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
9728
9729         * assembly.c (mono_assembly_open_full): Dont overwrite the status
9730         returned by mono_image_open_full ().
9731
9732         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
9733         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
9734         #78517.
9735
9736         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
9737         #78518.
9738
9739 2006-05-27  Miguel de Icaza  <miguel@novell.com>
9740
9741         * class.c (mono_class_from_typeref): handle missing images
9742         earlier, deals with bug #78418.   Refactor code; 
9743
9744         Fix a warning introduced in my previous commit (some stale code
9745         from before I revisited my patch).
9746
9747         * class.c (mono_class_create_from_typedef): On failure, remove the
9748         class from the MonoImage->class_cache as the class is not
9749         initialized;   Fixes the leak pointed out by Paolo.
9750
9751 2006-05-25  Dick Porter  <dick@ximian.com>
9752
9753         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
9754         DeleteCriticalSections until I figure out which one may still be
9755         sometimes locked when mono_thread_cleanup is called.
9756
9757 2006-05-24  Dick Porter  <dick@ximian.com>
9758
9759         * threads.c (mono_thread_cleanup): Move the threading cleanup out
9760         of mono_thread_manage and back into its own function, so it can be
9761         called after the finalizer thread has finished.
9762
9763         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
9764
9765 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
9766
9767         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
9768         Fixes #78495.
9769
9770         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
9771         with non-blittable elements.
9772         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
9773
9774 2006-05-24  Martin Baulig  <martin@ximian.com>
9775
9776         * mono-debug-debugger.h (MonoDebuggerEvent): Added
9777         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
9778
9779         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
9780         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
9781         `mono_debugger_event_handler' to NULL.
9782
9783 2006-05-24  Martin Baulig  <martin@ximian.com>
9784
9785         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
9786
9787 2006-05-24  Martin Baulig  <martin@ximian.com>
9788
9789         * mono-debug-debugger.h
9790         (mono_debugger_create_notification_function): Added
9791         `MonoCodeManager *' argument.
9792
9793 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
9794
9795         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
9796
9797 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
9798
9799         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
9800         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
9801         implementation.
9802
9803 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
9804
9805         * icall.c: precise GC support: objects can't be stored in unmanaged
9806         memory anymore, even if they are kept alive by other references: since
9807         they can move the GC needs to be able to always find them.
9808
9809 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
9810
9811         * object.c: precise GC support for static fields. Support
9812         for moving GCs: write barriers and pinned allocation for interned
9813         strings.
9814
9815 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
9816
9817         * domain.c, domain-internals.h: precise GC support for the MonoDomain
9818         structure.
9819
9820 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
9821
9822         * class.c, gc.c: sgen and precise GC updates.
9823
9824 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
9825
9826         * marshal.h, marshal.c: added write barrier wrapper and precise type
9827         fixes.
9828
9829 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
9830
9831         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
9832         support.
9833
9834 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
9835
9836         * reflection.c: precise and sgen GC updates.
9837
9838 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
9839
9840         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
9841
9842 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
9843
9844         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
9845
9846 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
9847
9848         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
9849         MONO_TYPE_OBJECT. Fixes #78462.
9850
9851 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
9852
9853         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
9854         and blittable types.
9855
9856 2006-05-17  Miguel de Icaza  <miguel@novell.com>
9857
9858         * class.c (mono_class_get_exception_for_failure): Implement parts
9859         of a TODO: if the loader error is set (instead of the class
9860         error), we return a Loader exception that can be properly thrown
9861         elsewhere.
9862
9863         This was exposed by some Winforms 2.0 code that I tried to run
9864         (Atsushi pointed me to it).
9865
9866 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
9867
9868         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
9869         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
9870         
9871         * marshal.c (emit_marshal_vtype): Add limited support for 
9872         UnmanagedType.LPStruct. Fixes #78427.
9873
9874         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
9875         Applied a patch from kangaroo to fix #77523.
9876
9877 2006-05-17  Martin Baulig  <martin@ximian.com>
9878
9879         * threads.c
9880         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
9881         (debugger_thread_created): Removed.
9882         (debugger_thread_exited): Removed.
9883
9884 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
9885
9886         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
9887
9888         * object-internals.h (MonoReflectionResource): Sync with managed version.
9889
9890 2006-05-12  Wade Berrier <wberrier@novell.com>
9891
9892         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
9893
9894 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
9895
9896         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
9897         functions try to allocate from the image mempool.
9898
9899 2006-05-12  Dick Porter  <dick@ximian.com>
9900
9901         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
9902
9903 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
9904
9905         * object.c: The FieldGetter and FieldSetter methods require the full
9906         name of the class, not only the name. Fixes bug #78277.
9907
9908 2006-05-11  Miguel de Icaza  <miguel@novell.com>
9909
9910         * loader.c (method_from_memberref): Do not pass the NULL klass to
9911         mono_loader_set_error_() methods.  Pass the non-NULL value
9912         (class). 
9913
9914 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
9915
9916         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
9917         (mono_assembly_close): Null out assembly->image->references after freeing it.
9918
9919         * image.c (mono_image_close): Free image->references.
9920         
9921         * reflection.c (mono_image_basic_init): Fix a small memory leak.
9922
9923 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
9924
9925         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
9926         before checking if it's NULL (g_assert).
9927
9928 2006-05-10  Martin Baulig  <martin@ximian.com>
9929
9930         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
9931         I thought I already killed that two months ago, but now it somehow reappeared.
9932
9933 2006-05-10  Martin Baulig  <martin@ximian.com>
9934
9935         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
9936
9937 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
9938
9939         * reflection.c: Allocate memory for dynamically created methods in the image
9940         mempools.
9941
9942 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
9943
9944         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
9945         don't use the ad pointer before checking if it's NULL (g_assert).
9946
9947 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
9948
9949         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
9950         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
9951
9952         * marshal.c: Allocate all signatures from mempools.
9953
9954         * marshal.c: Allocate some more signatures from mempools.
9955
9956 2006-05-09  Miguel de Icaza  <miguel@novell.com>
9957
9958         * object.c (mono_load_remote_field): The code used to provide a
9959         temporary variable for returning results if the user did not
9960         provide a result pointer.  But our temporary variable was allocted
9961         on the satck.
9962
9963         Fix calling code to always pass a result area.   Coverity ID 103.
9964
9965 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
9966
9967         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
9968         value, not the old. Fixes #78312.
9969         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
9970
9971         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
9972         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
9973         per-image cache.
9974
9975         * assembly.c (mono_assembly_close): Free image->references.
9976
9977         * assembly.c (mono_assembly_names_equal): Fix a warning.
9978         (mono_assemblies_cleanup): Cleanup more global data.
9979
9980         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
9981
9982         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
9983         ptr_cache and image->modules.
9984
9985         * image.c (mono_image_init): Allocate array_cache lazily.
9986         
9987 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9988
9989         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
9990         behavior was changed recently and has bad side effects.
9991
9992 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
9993
9994         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
9995         
9996         * assembly.c (mono_assembly_close): Remove a debug printf.
9997
9998         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
9999
10000         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
10001         to also allow for temporary references between mono_image_open ()/close ().
10002
10003         * domain.c (get_runtimes_from_exe): Add a FIXME.        
10004
10005 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
10006
10007         * marshal.c: Fix support for dynamic methods.
10008
10009         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
10010
10011         * marshal.c (mono_marshal_cleanup): New cleanup function.
10012
10013         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
10014         image mempools.
10015
10016         * class.c (mono_class_init): Fix leaking class->nested_classes.
10017
10018         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
10019
10020         * image.c (mono_image_init): Initialize the new cashes.
10021
10022         * image.c (mono_image_close): Destroy the new cashes.
10023
10024         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
10025
10026         * mempool.c (mono_mempool_strdup): New helper function.
10027
10028         * class-internals.h: Add prototype for mono_loader_unlock ().
10029
10030         * domain.c (mono_jit_info_table_find): Fix a warning.
10031         (mono_debugger_check_runtime_version): Ditto.
10032
10033         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
10034         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
10035         functions to these modules.
10036
10037         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
10038         metadata modules.
10039         
10040         * marshal.c (mono_free_bstr): Fix a warning.
10041
10042         * assembly.c (mono_assembly_open_full): Fix another small leak.
10043
10044         * object.c: Fix some unload leaks in the remoting code.
10045
10046         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
10047         function.
10048
10049         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
10050
10051         * reflection.c: Fix some unload leaks in dynamic assemblies.
10052
10053 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
10054
10055         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
10056         * marshal.h: Add BSTR support on Win32
10057         * icall.c: Add BSTR icalls
10058         * metadata.h: Add BSTR enums
10059
10060 2006-04-28  Miguel de Icaza  <miguel@novell.com>
10061
10062         Work to catch the crash from #76795 and turn it into an
10063         exception.   As I stubbed out pieces of the VisualBasic support,
10064         I found a number of places where the code was failing and I added
10065         checks to those places. 
10066         
10067         * metadata.c (do_mono_metadata_parse_generic_class): Make this
10068         function return a status code.  If we fail to parse the signature
10069         from mono_metadata_parse_generic_inst, return FALSE.
10070
10071         * loader.c (mono_get_method_from_token): If we fail to load the
10072         method (mono_class_get) return NULL.   
10073
10074         * (method_from_memberref): Return NULL if we are unable to parse
10075         the method signature
10076
10077         (mono_loader_error_prepare_exception): Since we now use the
10078         loader_error flag internally to stop processing, and obtaining
10079         exceptions that might be thrown will walk this code path the
10080         proper way of going from a MonoLoaderError into a
10081         MonoException was convoluted.   This new routine encapsulates the
10082         process of turning the error into an exception and *clearing* the
10083         error afterwards.
10084         
10085 2006-04-27  Miguel de Icaza  <miguel@novell.com>
10086
10087         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
10088         with missing assemblies), and to cope with:
10089
10090                 * Missing fieldref from a non-existing assembly.
10091                 * Missing methodref from a non-existing assembly.
10092
10093         The first batch of work to address *some* of the issues from 76661.
10094         
10095         * object.c (mono_class_create_runtime_vtable): If we fail to
10096         initialize the class raise the exception here. 
10097
10098         * metadata.c (mono_class_get_overrides_full): If any methods fail
10099         to load return the failure to the caller.
10100
10101         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
10102         flagging assemblies that failed to load.   
10103
10104         Do not crash if we are unable to load the assembly.
10105
10106         (mono_assembly_close): Do nothing with REFERENCE_MISSING
10107         assemblies. 
10108
10109         * loader.c (mono_loader_set_error_type_load): Change the
10110         convention to always pass unallocated strings, so we make our own
10111         copies (I know our own code had duplicated strings before, but
10112         this keeps the normal conventions).
10113         (method_from_memberref): Call mono_loader_set_error_method_load
10114         for all possible failures of loading the class. 
10115         Remove assert, turn into a loader error.
10116
10117         (mono_loader_error_to_exception): Move this routine from mini
10118         (mini_loader_error_to_exception) there was no need to have that in
10119         mini. 
10120
10121         * class.c (mono_class_from_typeref): If we were not able to load
10122         the assembly with mono_assembly_load_reference, call the
10123         mono_loader_set_error_type_load to register the problem.
10124
10125         (mono_class_setup_fields): If we fail to load the type from
10126         mono_metadata_parse_type_full, call mono_class_set_failure and
10127         break from the loop.
10128
10129         If class->exception_type is set, we do not layout the fields as
10130         that might crash the runtime, and instead return (from breaking
10131         from the previous loop).
10132
10133         (mono_class_setup_vtable): This now returns a boolean indicating
10134         whether the table was properly setup.   The decision is driven by
10135         mono_class_get_overrides_full which might run into non-existing
10136         methods. 
10137         
10138         (mono_class_init): Returns TRUE on success or FALSE if there was a
10139         problem in loading the type (incorrect assemblies, missing
10140         assemblies, methods, etc).
10141
10142         When we call mono_class_setup_fields we also check for a potential
10143         error inside this call (either a class exception or a general
10144         loader exception).
10145
10146         (mono_class_create_from_typedef): If the parent fails to load
10147         (calling mono_class_get_full) return NULL.
10148         
10149         ** Important **
10150
10151         calls to mono_metadata_parse_type_full should be checked
10152         everywhere and set the mono_class_set_failure
10153         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
10154
10155         The current patch checks the places where my manually constructed
10156         tests show the errors are showing up, but we should do it
10157         everywhere. 
10158
10159         ** Important2 **
10160
10161         mono_class_init return values should be tested everywhere, like
10162         the previous case this is something that we should audit
10163         everywhere and not only on the cases exposed by the tests I
10164         created. 
10165
10166 2006-04-26  Miguel de Icaza  <miguel@novell.com>
10167
10168         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
10169         boolean parameter and instead pass the information on `options'
10170         parameter (FileOptions).
10171
10172         * icall.c: Register the new signature for MonoIO.Open.
10173
10174         * debug-helpers.c (dis_one): Trying to understand how coverity
10175         works.  Fix Run 5, item 78.
10176
10177 2006-04-26  Dick Porter  <dick@ximian.com>
10178
10179         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
10180         dereference.
10181
10182 2006-04-25  Martin Baulig  <martin@ximian.com>
10183
10184         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
10185
10186         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
10187         debugger_thread_created().
10188         (debugger_gc_push_all_stacks): Don't handle the main thread in any
10189         special way.
10190         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
10191         (mono_debugger_finalize_threads): New function; undo the effects
10192         of mono_debugger_init_threads().
10193         (mono_debugger_create_all_threads): Removed.
10194
10195 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
10196
10197         * image.c (mono_image_close): Tidy up trace messages.
10198
10199         * assembly.c (mono_assembly_close): Ditto.
10200
10201         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
10202         no longer references an already freed assembly. Fixes #78168.
10203
10204 2006-04-21  Dick Porter  <dick@ximian.com>
10205
10206         * threads.c (mono_thread_detach): Fix reference counting when
10207         detaching threads.
10208
10209 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
10210
10211         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
10212         #78155.
10213
10214 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
10215
10216         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
10217         (mono_type_to_stind): Ditto.
10218
10219         * marshal.c: Use the new helper functions to simplify code.
10220
10221         * image.c (mono_image_close): Add some code for help debug assembly unloading
10222         problems.
10223
10224         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
10225         image mempool.
10226
10227         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
10228         assembly was already loaded in another appdomain. Fixes #78083.
10229
10230 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
10231
10232         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
10233         referenced assemblies.
10234         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
10235
10236         * domain.c (mono_domain_free): Add a trace message.
10237
10238         * appdomain.c (add_assemblies_to_domain): Ditto.        
10239
10240         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
10241         field.  
10242
10243 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
10244
10245         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
10246
10247 2006-04-12  Martin Baulig  <martin@ximian.com>
10248
10249         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
10250         `USE_INCLUDED_LIBGC'.   
10251
10252 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
10253
10254         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
10255         the patch contains ../ and a small directory name later. Hopefully fixes
10256         #78035.
10257
10258 2006-04-10  Martin Baulig  <martin@ximian.com>
10259
10260         Clean up the debugger's thread-handling code.
10261
10262         The debugger's thread-handling code has been moved from
10263         ../mini/debug-debugger.c to threads.c.  We now iterate directly
10264         over the `threads' hash, keep track of exiting threads and also
10265         use proper locking.
10266
10267         We can now debug XSP and XSP based applications with the debugger.
10268
10269         * object-internals.h (MonoThread): Added `gpointer end_stack'.
10270
10271         * threads.h
10272         (MonoThreadCallbacks): Removed; this was only used by the debugger.
10273         (mono_install_thread_callbacks): Likewise.      
10274
10275         * threads.c (mono_thread_callbacks): Removed.
10276         (debugger_thread_created, debugger_thread_exited): New static functions.
10277         (start_wrapper): Call debugger_thread_created().
10278         (thread_cleanup): Call debugger_thread_exited().
10279         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
10280         (mono_debugger_init_threads): New public function.
10281         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
10282         iterate directly over the `threads' hash and also use proper locking.
10283
10284         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
10285
10286         * mono-debug-debugger.h
10287         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
10288
10289 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
10290
10291         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
10292         argument type=array. Fixes #78057.
10293
10294 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
10295
10296         * culture-info-table.h : regenerated. Fixed bug #69652.
10297
10298 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
10299
10300         * loader.c metadata.c: Reapply a variant r59116.
10301         
10302         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
10303
10304         * class.c (mono_class_setup_interface_offsets): New internal function.
10305
10306         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
10307         interfaces too. Fixes #77398.
10308
10309         * reflection.c (encode_cattr_value): Add support for 
10310         parameter type=object, argument type=array.
10311         (load_cattr_value): Ditto. Fixes #77916.
10312
10313         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
10314         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
10315
10316         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
10317         a byval char array and CharSet is Ansi.
10318
10319         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
10320
10321 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
10322
10323         * metadata.c: Add some locking comments.
10324         
10325         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
10326         mempool.
10327         (mono_metadata_free_method_signature): Don't free the signature itself.
10328
10329         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
10330
10331         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
10332         reference the same MonoImage.
10333         (mono_assembly_load_from_full): Add an assert.
10334
10335 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
10336
10337         * image.c (mono_image_close): Don't put the image we are about to free into the
10338         loaded_images_guid_hash.
10339
10340         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
10341         to reduce code duplication.
10342
10343         * marshal.c: Register the native functions called by this module as icalls, to
10344         somewhat centralize the creation of MonoMethodSignature's.
10345
10346         * loader.c (mono_method_signature): Add a cache for method signatures.
10347
10348         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
10349         the parameter attributes of a method.
10350         (mono_metadata_parse_method_signature_full): Refactored the computation of
10351         parameter attributes into a separate function. Also avoid one allocation in
10352         most cases.
10353
10354         * assembly.c (mono_assembly_close): Ditto.
10355
10356         * image.c (mono_image_close): Log trace messages with INFO level.
10357
10358         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
10359
10360         * image.c reflection.c: Correct reference counting of image modules.
10361         
10362         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
10363         of this function from the image mempool.
10364         
10365         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
10366         to allow more cached types to be used.
10367
10368         * mono-debug.c (mono_debug_add_method): Appled patch from
10369         David S. Miller  <davem@sunset.davemloft.net>: Access 
10370         minfo->lexical_blocks[] entry elements using read32().
10371
10372 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
10373
10374         * loader.c (mono_free_method): No longer free the method header for non-dynamic
10375         methods as it is allocated from the mempool.
10376
10377         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
10378         image mempool.
10379
10380         * metadata-internals.h: Add comments describing the reference counting scheme
10381         used for MonoImage and MonoAssembly.
10382
10383         * image.c assembly.c reflection.c: Rework reference counting of images and 
10384         assemblies so they are freed when the runtime is shut down. Free some 
10385         additional memory structures when an image is unloaded.
10386         
10387 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
10388
10389         * class.c loader.c reflection.c: Allocate more data structures in
10390         the image mempool.
10391
10392 2006-03-31  Miguel de Icaza  <miguel@novell.com>
10393
10394         * icall.c
10395         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
10396         build on pre glib 2.4 systems.
10397
10398 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
10399
10400         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
10401
10402         * icall.c: Fix some warnings.
10403
10404 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
10405
10406         * culture-info-table.h : regenerated.
10407
10408 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
10409
10410         * threads.c, object-internals.h, verify.c: changed the culture caching
10411         code to use a normal MonoArray for storage so the GC can keep track of
10412         them easily. Fixed bits of the cache logic, too and simplified the
10413         code.
10414
10415 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
10416
10417         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
10418         thread for non-Boehm GCs.
10419
10420 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
10421
10422         * domain.c, object.c, domain-internals.h: reduce the amount of memory
10423         needed to keep track of the data for static fields.
10424
10425 2006-03-29  Raja R Harinath  <rharinath@novell.com>
10426
10427         Fix #75172
10428         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
10429         for interface classes.  Use 'num_methods' instead.
10430         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
10431         before using '->vtable_size' field.
10432
10433 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
10434
10435         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
10436         doesn't contain managed pointers, so use a normal hashtable.
10437
10438 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
10439
10440         * reflection.c, class-internals.h, domain.c: fixed handling of types
10441         used as values for objects in custom attributes (bug #77915):
10442
10443 2006-03-24  Martin Baulig  <martin@ximian.com>
10444
10445         * class.c (mono_class_setup_fields): Added support for generic
10446         instances; fixes #77580.
10447
10448 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10449
10450         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
10451
10452 2006-03-24  Dick Porter  <dick@ximian.com>
10453
10454         * file-io.c (get_file_attributes): More stat macro breakage.
10455         Fixes bug 77759.
10456
10457 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
10458
10459         * profiler.c: added the file=filename option in the default profiler
10460         to output the profile data to filename.
10461
10462 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10463
10464         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
10465         bug #77877.
10466
10467 2006-03-22  Martin Baulig  <martin@ximian.com>
10468
10469         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
10470         allocated `MonoClassField *' in `fb->handle'.
10471
10472 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
10473
10474         * class.c, image.c, metadata-internals.h: implemented new mechanism to
10475         allocate interface ID to save memory and allow better ID reuse on
10476         appdomain unload. setup_generic_vtable () removal from Martin.
10477
10478 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
10479
10480         * object.h, appdomain.c, domain.c, exception.c, icall.c,
10481         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
10482         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
10483         write barriers for reference stores with managed objects accessed with
10484         C structures in the runtime and in embedding programs.
10485
10486 2006-03-20  Raja R Harinath  <rharinath@novell.com>
10487
10488         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
10489         'interface_id' and 'max_interface_id' fields of MonoClasses
10490         representing open generic types.
10491
10492 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
10493
10494         * object.h, object.c, icall.c: added functions to deal with
10495         storing valuetypes that contain references in managed objects.
10496         * reflection.c, string-icalls.c, threads.c, marshal.c: small
10497         fixes and comments around uses of mono_array_addr ().
10498
10499 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
10500
10501         * object.h, icall.c, monitor.c: object.GetHashCode ()
10502         implementation that supports the moving garbage collector.
10503
10504 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
10505
10506         * icall.c, threads-types.h, threads.c: implemented finalizer for
10507         LocalDataStoreSlot.
10508
10509 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
10510
10511         * metadata.c (mono_type_size): Add a fixme.
10512         (mono_type_stack_size): Ditto.
10513
10514         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
10515         'type_forwarders' field.
10516
10517         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
10518         attribute from net 2.0.
10519
10520         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
10521         from class.c.
10522
10523         * class.c (mono_class_setup_fields): Fix a warning.
10524         
10525         * class.c (mono_class_from_name): Add support for assemblyref entries
10526         in the EXPORTEDTYPE table.
10527
10528         * reflection.c: Add support for handling type forwarders under net 2.0.
10529
10530         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
10531         
10532 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
10533
10534         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
10535         overwriting entries in ModuleBuild->types, also clean up the code
10536         a little. Fixes #77774.
10537
10538 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
10539
10540         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
10541         load friend assembly info when present.
10542
10543 2006-03-14  Raja R Harinath  <rharinath@novell.com>
10544
10545         Fix crasher on gtest-158.cs.
10546         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
10547         the return value if the MonoClass we want is yet in an
10548         inconsistent state.
10549         * class.c (mono_class_create_from_typedef): Add an comment
10550         explaining an order dependency between mono_class_setup_parent and
10551         mono_class_setup_mono_type.
10552
10553 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
10554
10555         * class.c: documentation updates and events bug fix.
10556
10557 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
10558
10559         * class.c: some cleanup, locking fixes.
10560
10561 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
10562
10563         * class.c: fix the generics code to setup nested
10564         type info to the instantiated type (bug #77770).
10565
10566 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
10567
10568         * marshal.c: fixed a few type correctness issues.
10569
10570 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
10571
10572         * loader.c: the Set/Get/Addrtess array methods should be public.
10573
10574 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
10575
10576         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
10577         
10578         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
10579         info->wrapper.
10580
10581 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
10582
10583         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
10584
10585         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
10586
10587         * mempool.c (mono_mempool_alloc): Speed this up a bit.
10588         (mono_mempool_alloc0): Ditto.
10589
10590 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10591
10592         * socket-io.c:
10593         (create_object_from_sockaddr): it was allocating 4 extra bytes
10594         for the AF_UNIX data. Fixes bug #77747.
10595
10596 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
10597
10598         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
10599
10600 2006-03-09  Dick Porter  <dick@ximian.com>
10601
10602         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
10603         Fixes bug 76966 again.
10604
10605 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
10606
10607         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
10608         names from r57532
10609         * appdomain.c: Bumped corlib version to 48 (due to r57532)
10610
10611 2006-03-07  Martin Baulig  <martin@ximian.com>
10612
10613         * object.c
10614         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
10615
10616 2006-03-07  Martin Baulig  <martin@ximian.com>
10617
10618         * class.c
10619         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
10620         regression introduced in r56970; see gtest-252.cs.
10621
10622         * loader.c (mono_get_method_constrained): Correctly handle generic
10623         methods; see gtest-253.cs.
10624
10625 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
10626
10627         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
10628
10629 2006-03-04  Martin Baulig  <martin@ximian.com>
10630
10631         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
10632         compute the parent type at runtime, just like we're already doing
10633         it for interfaces.
10634
10635         * reflection.c
10636         (mono_reflection_bind_generic_parameters): Don't compute the
10637         parent type anymore.
10638
10639         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
10640
10641 2006-03-04  Martin Baulig  <martin@ximian.com>
10642
10643         * mono-debug-debugger.h
10644         (mono_debugger_create_notification_function): Allocate memory at
10645         runtime and return a pointer to it.
10646
10647 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
10648
10649         * assembly.c: Fix windows build.
10650         
10651         * assembly.c: Fix build.
10652
10653         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
10654
10655         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
10656         
10657 2006-03-03  Dick Porter  <dick@ximian.com>
10658
10659         * process.c
10660         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
10661         Check parameters before dereferencing them.  Fixes Aaron's part of
10662         bug 77393.
10663
10664 2006-03-03  Raja R Harinath  <rharinath@novell.com>
10665
10666         Fix performance regression.
10667         * loader.c (find_method_in_class): Add 'from_class' argument.
10668         Rename 'klass' argument to 'in_class'.  The signature is compared
10669         against the method in 'in_class', and the corresponding method is
10670         returned from 'from_class'.
10671         (find_method): Walk both 'in_class' and 'from_class' in parallel.
10672         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
10673         type definition and generic instantiation in parallel.
10674         (mono_get_method_constrained): Update to changes.
10675
10676 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
10677
10678         * threads.c: make sure the domain is correct, too when doing
10679         mono_thread_attach ().
10680
10681 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
10682
10683         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
10684         windows. Fixes #77683.
10685
10686 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
10687
10688         * object.h, *: introduced specific way to set elements of an array
10689         of references to be used as write barrier. Still need to audit the
10690         uses of mono_array_addr.
10691
10692 2006-03-01  Miguel de Icaza  <miguel@novell.com>
10693
10694         * object-internals.h: New field to cache the assmebly name, patch
10695         from Tambet Ingo (tambet@ximian.com)
10696
10697 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
10698
10699         * decimal.h, class-internals.h, metadata-internals.h,
10700         file-io.h: mark a few function declarations as internal, to
10701         reduce the number of PLT entries.
10702
10703 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10704
10705         * file-io.c: fix typo in warning message.
10706
10707 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
10708
10709         * loader.c: on unix, lookup the "*A" version of a function
10710         if charset is auto as a second option before failing.
10711
10712 2006-02-28  Raja R Harinath  <rharinath@novell.com>
10713
10714         * class.h (mono_class_inflate_generic_method): Revert to two
10715         argument version.
10716         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
10717         (mono_class_inflate_generic_method_full): Add.
10718         * class.c (mono_class_inflate_generic_method_full): Rename from
10719         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
10720         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
10721         * loader.c, reflection.c: Update to changes.
10722
10723 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
10724
10725         * icall.c: const fixes and small improvements.
10726
10727 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10728
10729         * threadpool.c: for asynchronous connect(), enable the same workaround
10730         for BSD 6 as for the Mac. Fixes bug #77637.
10731
10732 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
10733
10734         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
10735         formatted classes. Fixes #77524.
10736
10737 2006-02-24  Raja R Harinath  <rharinath@novell.com>
10738
10739         * class.c (inflate_generic_type): Add a couple more
10740         micro-optimizations.
10741         (inflate_generic_context): Don't use the 'gmethod' from
10742         'inflate_with'.
10743         (mono_class_inflate_generic_method): If the method has generic
10744         parameters, but the passed-in context doesn't have a 'gmethod',
10745         create one.  Use the possibly simplified generic instantiation
10746         from the declaring class instead of the one passed in.
10747
10748 2006-02-24  Raja R Harinath  <harinath@gmail.com>
10749
10750         Make generic method signature and method header handling lazy.
10751         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
10752         (inflate_generic_header): Likewise.
10753         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
10754         parameter to avoid inflating types.
10755         (mono_get_inflated_method): Empty out.
10756         * class.h (mono_class_inflate_generic_method): Update to changes.
10757         * loader.c (mono_get_method_from_token): Don't parse signature for
10758         generic methods, nor methods of generic classes.
10759         (mono_method_signature): Rename from 'mono_method_signature'.
10760         Inflate signature on demand.
10761         (mono_method_get_header): Inflate method header on demand.
10762         * reflection.c: Update to changes.
10763
10764 2006-02-23  Raja R Harinath  <rharinath@novell.com>
10765
10766         * metadata.c (mono_metadata_inflate_generic_inst): If the
10767         instantiation is closed, don't bother expanding it in the new
10768         context.
10769         * class.c (inflate_generic_class): If the generic instantiation
10770         doesn't change after inflation, return the argument itself.
10771         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
10772         Add bounds checks.
10773         (inflate_generic_context): If neither the generic class nor the
10774         generic method instantiations change, return the original context.
10775         * reflection.c (mono_method_get_object): Do
10776         'mono_get_inflated_method' before accessing the ->klass field.
10777         (inflate_mono_method): Don't create a MonoGenericMethod unless
10778         necessary.
10779         (inflate_method): Don't pass a constructed type as the declaring
10780         type of a methodbuilder.
10781
10782 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
10783
10784         * object.c: fix memory overwrite.
10785
10786 2006-02-22  Dick Porter  <dick@ximian.com>
10787
10788         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
10789         it doesn't work any more.
10790         (mono_threads_request_thread_dump): Fix unused variable warnings.
10791
10792 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
10793
10794         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
10795         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
10796         the public header file.
10797
10798 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
10799
10800         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
10801
10802 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
10803
10804         * class-internals.h, object.c: reduce the size of MonoVTable
10805         and store the interface_offsets array at negative offsets.
10806
10807 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
10808
10809         * metadata.c: tweak table descriptors data structures to reduce
10810         size and runtime relocations.
10811
10812 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
10813
10814         * marshal.c: fix some types and opcodes to be type-safe
10815         in marshaling wrappers.
10816
10817 2006-02-21  Ankit Jain  <jankit@novell.com>
10818
10819         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
10820
10821 2006-02-21  Raja R Harinath  <rharinath@novell.com>
10822
10823         * metadata.c (get_constraints): Relax debugging checks for monodis.
10824
10825 2006-02-21  Ankit Jain  <jankit@novell.com>
10826
10827         * metadata.c (mono_metadata_load_generic_params): Move the code
10828         checking for ambiguous generic params from here to mono/dis/get.c
10829         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
10830
10831 2006-02-21  Raja R Harinath  <harinath@gmail.com>
10832
10833         Fix assertion triggered when compiling nemerle.
10834         * class.c (mono_get_shared_generic_inst): Rename from
10835         get_shared_inst and make non-static.
10836         * loader.c (mono_get_shared_generic_method): New.  Used to create
10837         the MonoGenericContext-equivalent of a MonoGenericContainer.
10838         (mono_get_method_from_token): Initialize the 'context' field of
10839         the created MonoGenericContainer.
10840         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
10841         * metadata.c (get_constraints): Add sanity check.
10842         * class-internals.h: Add new internal methods.
10843
10844         * reflection.c (verify_safe_for_managed_space): New sanity check.
10845         Currently checks that owner-less generic parameters aren't allowed
10846         in managed space.
10847         (mono_type_get_object): Use it.
10848         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
10849         that are now in mono_type_get_object.
10850         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
10851
10852 2006-02-19  Raja R Harinath  <harinath@gmail.com>
10853
10854         * metadata.c (mono_type_create_from_typespec): Rename from
10855         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
10856         argument and caching of types in the generic container.
10857         (unwrap_arrays, find_generic_param): Remove.
10858         * metadata-internals.h: Update.
10859         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
10860
10861 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
10862
10863         * class.c (mono_class_get_exception_for_failure): Fix a warning.
10864
10865         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
10866         return values. Fixes #77581.
10867
10868         * class.c (mono_fnptr_class_get): Switch name and name_space.
10869
10870         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
10871         classes and add support for [In, Out] attributes.
10872         (mono_marshal_free_asany): Ditto. Fixes #77524.
10873
10874 2006-02-18  Raja R Harinath  <harinath@gmail.com>
10875
10876         * class.c (mono_class_from_generic_parameter): Make more robust to
10877         incomplete MonoGenericContainers from monodis.
10878
10879 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
10880
10881         * class-internals.h: added some more exception types.
10882         * class.c, metadata.c: added a few checks to handle missing
10883         types.
10884
10885 2006-02-17  Raja R Harinath  <rharinath@novell.com>
10886
10887         Use owner-less generic-params some more.
10888         * class.c (my_mono_class_from_generic_parameter): Remove.
10889         (mono_class_from_generic_parameter): Handle null image,
10890         param->name and param->owner.
10891         (mono_class_from_mono_type): Update.
10892         (mono_class_create_from_typespec): Remove 'container' parameter.
10893         If that parameter is non-null, the result is always inflated by
10894         'mono_class_get_full' anyway.
10895         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
10896         parameter.
10897         (mono_class_get_full): Update.
10898
10899         * class.c (inflate_generic_type) [GENERICINST]: If the generic
10900         instance is not open, don't bother inflating.
10901         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
10902         parse metadata for inflated classes.
10903         (_mono_class_get): Change GenericContext* parameter to
10904         GenericContainer*.
10905         (mono_class_create_from_typespec): Likewise.  Simplify, and
10906         implement trivially.  All the cases are handled in
10907         mono_class_from_mono_type.  Don't inflate returned class.
10908         (mono_class_get_full): Delegate GENERICINST optimization to
10909         inflate_generic_type.
10910         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
10911
10912 2006-02-16  Dick Porter  <dick@ximian.com>
10913
10914         * socket-io.c (create_object_from_sockaddr): Fix typo.
10915         (create_sockaddr_from_object): Check array lengths before
10916         potentially accessing items off the end.
10917         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
10918         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
10919         (ves_icall_System_Net_Sockets_Socket_Send_internal)
10920         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
10921         length checks to avoid wraparound overflows.
10922         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
10923         contents of the array of sockets
10924         (hostent_to_IPHostEntry2)
10925         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
10926         Check return value of inet_ntop ().
10927         (addrinfo_to_IPHostEntry): Fix typo
10928
10929 2006-02-16  Raja R Harinath  <rharinath@novell.com>
10930
10931         Type metadata parsing doesn't use generic-instantiation information.
10932         * metadata.c (mono_metadata_parse_array_full): Change
10933         MonoGenericContext* parameter to MonoGenericContainer*.
10934         (mono_metadata_parse_type_full): Likewise.
10935         (mono_type_create_from_typespec_full): Likewise.
10936         (mono_metadata_parse_mh_full): Likewise.
10937         (mono_metadata_parse_generic_inst): Likewise.
10938         (do_mono_metadata_parse_generic_class): Likewise.
10939         (do_mono_metadata_parse_type): Likewise.
10940         * metadata-internals.h: Update to changes.
10941         * class.c (mono_class_find_enum_basetype): Likewise.
10942         (mono_class_setup_fields): Likewise.
10943         (mono_class_create_from_typespec): Likewise.
10944         * loader.c (method_from_methodspec): Likewise.
10945         (mono_get_method_from_token): Likewise.
10946         (mono_method_get_header): Likewise.
10947
10948 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
10949
10950         * marshal.c: handle additional GENERICINST case (patch from
10951         Thong Nguyen <tum@veridicus.com>).
10952         Fix a few cases where LDIND_I/STIND_I was used for references.
10953
10954 2006-02-16  Raja R Harinath  <rharinath@novell.com>
10955
10956         * reflection.c (mono_reflection_get_token): Remove unused variable.
10957
10958 2006-02-16  Martin Baulig  <martin@ximian.com>
10959
10960         * reflection.c (mono_reflection_get_token): Add support for fields
10961         in instantiated generic types.
10962
10963         * icall.c
10964         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
10965
10966 2006-02-15  Martin Baulig  <martin@ximian.com>
10967
10968         * icall.c
10969         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
10970         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
10971         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
10972         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
10973
10974 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
10975
10976         * class.c, metadata.c, metadata.h, object.c, icall.c,
10977         marshal.c: changed mono_type_get_underlying_type () to do
10978         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
10979         Fixed handling of instantiated generic valuetypes (bug #75479).
10980
10981 2006-02-15  Raja R Harinath  <rharinath@novell.com>
10982
10983         * metadata.c (mono_metadata_decode_signed_value): Simplify.
10984         Delegate to mono_metadata_decode_value, and work on the returned value.
10985
10986         * icall.c (ves_icall_MonoType_GetGenericArguments):
10987         Add consistency check here too.
10988         
10989 2006-02-15  Ankit Jain  <jankit@novell.com>
10990
10991         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
10992         char/short etc.
10993
10994 2006-02-15  Ankit Jain  <jankit@novell.com>
10995
10996         * metadata.c (mono_metadata_decode_signed_value): New function to decode
10997         signed values, used only for representing lower bounds of arrays.
10998         (mono_metadata_parse_array_full): Use new
10999         mono_metadata_decode_signed_value to decode lower bounds.
11000
11001 2006-02-14  Martin Baulig  <martin@ximian.com>
11002
11003         * reflection.c
11004         (mono_reflection_get_token): Support "MonoGenericMethod" and
11005         "MonoGenericCMethod" and allow generic instances / methods.
11006
11007 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
11008
11009         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
11010         to obtain the terminal size using an ioctl.
11011
11012         * object.c (mono_nullable_init): Revert this as nullable reference
11013         types are not valid.
11014         (mono_nullable_box): Ditto.
11015
11016 2006-02-09  Dick Porter  <dick@ximian.com>
11017
11018         * threads.c (mono_thread_detach): Drop a reference to the thread
11019         we're detaching.
11020
11021 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
11022
11023         * object.c (mono_nullable_init): Handle nullable reference types.
11024         (mono_nullable_box): Ditto. Fixes #77446.
11025
11026 2006-02-07  Martin Baulig  <martin@ximian.com>
11027
11028         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
11029
11030 2006-02-07  Ankit Jain  <jankit@novell.com>
11031
11032         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
11033         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
11034         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
11035         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
11036         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
11037         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
11038
11039 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
11040
11041         * class.c (mono_class_create_generic): Set type_token as well.
11042
11043         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
11044         compatible with MS.
11045
11046 2006-02-02  Martin Baulig  <martin@ximian.com>
11047
11048         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
11049         has never been used so far.
11050
11051 2006-02-02  Martin Baulig  <martin@ximian.com>
11052
11053         * mono-debug-debugger.h: Changed comment at the top of this file;
11054         the header is not installed, but it's safe to #include it from
11055         within the JIT.
11056
11057         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
11058         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
11059
11060 2006-02-02  Martin Baulig  <martin@ximian.com>
11061
11062         * mono-debug.h
11063         (MonoSymbolTable): Removed the `metadata_info' field.
11064
11065         * mono-debug.c
11066         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
11067
11068         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
11069         (mono_debugger_add_builtin_types): Removed.
11070         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
11071         (mono_debugger_create_notification_function): We now operate on a
11072         pre-allocated area; take a `gpointer' and return `void'.
11073
11074         * mono-debug-debugger.c
11075         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
11076         (mono_debugger_add_builtin_types): Removed.
11077
11078 2006-02-02  Martin Baulig  <martin@ximian.com>
11079
11080         * threads.c (mono_debugger_create_all_threads): New public method.
11081
11082 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
11083
11084         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
11085         breaks on several platforms.
11086
11087 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
11088
11089         * assembly.c: the VS.NET build doesn't supply default values for
11090         MONO_ASSEMBLIES and MONO_CFG_DIR.
11091
11092 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
11093
11094         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
11095         helper function.
11096
11097         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
11098
11099         * loader.c (method_from_memberref): Fix a warning.
11100
11101         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
11102
11103         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
11104         with explicit layout. Fixes #77433.
11105
11106 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
11107
11108         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
11109         max_interface_id is initialized before using it. Fixes #77398.
11110         (ves_icall_Type_GetInterfaces): Ditto.
11111
11112 2006-01-30  Raja R Harinath  <rharinath@novell.com>
11113
11114         * metadata.c (mono_metadata_parse_method_signature_full): Don't
11115         allocate memory for parameter attributes when parsing memberref
11116         signatures.
11117         * loader.c (mono_loader_set_error_method_load): Don't warn.
11118         (method_from_memberref): Ensure MissingMethodException gets thrown
11119         if method is not found.  Make warning more informative.
11120
11121 2006-01-29  Raja R Harinath  <harinath@gmail.com>
11122
11123         Fix #77397
11124         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
11125         return true if is byref.
11126         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
11127         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
11128         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
11129
11130 2006-01-27  Raja R Harinath  <rharinath@novell.com>
11131
11132         Fix tests/find-method.2.il
11133         * loader.c (find_method, find_method_in_class): Remove is_inflated
11134         argument.  Revert 2006-01-18 change.
11135         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
11136         is generic, search for method in its generic definition.
11137         * class.c (mono_class_setup_vtable_general): Print generic
11138         arguments of generic types in debugging printf.
11139
11140 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
11141
11142         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
11143
11144         * threads.c (mono_threads_request_thread_dump): New helper function.
11145
11146 2006-01-25  Raja R Harinath  <rharinath@novell.com>
11147
11148         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
11149
11150 2006-01-25  Ankit Jain  <jankit@novell.com>
11151
11152         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
11153         move definition to ..
11154         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
11155         
11156 2006-01-25  Ankit Jain  <jankit@novell.com>
11157             Raja R Harinath  <rharinath@novell.com>
11158
11159         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
11160         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
11161         as necessary.
11162
11163 2006-01-25  Martin Baulig  <martin@ximian.com>
11164
11165         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
11166         `MonoDebuggerThread' into debug-debugger.c.
11167
11168 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
11169
11170         * profiler.c: fix printing of data.
11171
11172 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
11173
11174         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
11175           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
11176
11177 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
11178
11179         * object.c: fix deadlock related to string interning.
11180
11181 2006-01-23  Martin Baulig  <martin@ximian.com>
11182
11183         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
11184
11185         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
11186
11187 2006-01-23  Martin Baulig  <martin@ximian.com>
11188
11189         * mono-debug.h: Moved the prototypes of some functions which are
11190         used by the JIT here from mono-debug-debugger.h.
11191
11192 2006-01-21  Martin Baulig  <martin@ximian.com>
11193
11194         * Makefile.am: Don't install mono-debug-debugger.h.
11195
11196 2006-01-21  Martin Baulig  <martin@ximian.com>
11197
11198         * mono-debug-debugger.h: Enforce the private status of this header
11199         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
11200         Moved some stuff from mono-debugger-jit-wrapper.h here.
11201
11202 2006-01-20  Raja R Harinath  <rharinath@novell.com>
11203
11204         * class.c (mono_class_from_typeref): Add a sanity test to help
11205         catch lack of assembly load/search hooks.
11206
11207 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
11208
11209         * marshal.c (emit_struct_conv): Relax the fields with same offset
11210         check even more. Fixes #77230.
11211
11212 2006-01-18  Martin Baulig  <martin@ximian.com>
11213
11214         * loader.c (find_method_in_class): Added `gboolean is_inflated'
11215         argument; if false, we compare the uninstantiated signatures.
11216         (method_from_memberref): Compare the uninstantiated signatures;
11217         fixes #76417.
11218
11219 2006-01-18  Robert Jordan  <robertj@gmx.net>
11220
11221         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
11222         Clear the weak link. Fixes bug #77170.
11223
11224         * gc.c (mono_gchandle_free):
11225         Reflect *-gc.c changes (tiny optimization).
11226
11227 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
11228
11229         * metadata.c (mono_metadata_signature_dup): Applied patch from
11230         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
11231         Fixes #77288.
11232
11233 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
11234
11235         * marshal.c (emit_struct_conv): Allow fields with the same offset when
11236         marshalling from native to managed code. Fixes #77230.
11237
11238 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11239
11240         * threadpool.c: fix problem (Mac only) when more than one asynchronous
11241         connect. Fixes bug #77020.
11242
11243 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
11244
11245         * class.c: fixed id assignement for nested interfaces (bug #77275).
11246         Added also better info for --print-vtable debugging.
11247
11248 2006-01-12  Martin Baulig  <martin@ximian.com>
11249
11250         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
11251         interfaces on-the-fly; fixes #76625.
11252
11253         * class-internals.h
11254         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
11255         don't need that anymore.
11256
11257 2006-01-12  Miguel de Icaza  <miguel@novell.com>
11258
11259         * socket-io.c
11260         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
11261         To avoid initing the nested_classes when not needed I turned the
11262         PeerCredData as a toplevel internal class, as it has to be shared
11263         anyways. 
11264
11265         Fixes the CASA issue.
11266
11267 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
11268
11269         * domain.c: Accessors for MonoJitInfo
11270
11271         * profiler-private.h: Add jitinfo to the end jit hook
11272
11273         * profiler.[ch]: Define new hooks, called after jitting which give
11274         the MonoJitInfo that was compiled
11275
11276 2006-01-10  Martin Baulig  <martin@ximian.com>
11277
11278         * class.c (mono_class_setup_events): Add support for generic
11279         classes; fixes #76440.
11280
11281 2006-01-06  Raja R Harinath  <rharinath@novell.com>
11282
11283         Fix #77160.
11284         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
11285         on passed-in method.
11286
11287 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
11288
11289         * object.c (mono_runtime_invoke_array): Add Nullable support.
11290
11291         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
11292
11293 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
11294
11295         * file-io.c: Don't consider sockets as directory and avoid an endless
11296         loop. Fix bug #76966.
11297
11298 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
11299
11300         * object.c (mono_nullable_init): New helper function.
11301         (mono_nullable_box): Ditto.
11302
11303         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
11304
11305         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
11306
11307         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
11308         
11309 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
11310
11311         * class.c (mono_class_is_assignable_from): Make T assignable to 
11312         Nullable<T>.
11313
11314 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
11315
11316         * appdomain.c: Bump corlib version to 46.
11317         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
11318         serialization purpose) and changed ves_icall_System_Reflection_
11319         Assembly_get_code_base signature to accept a boolean (to escape, or 
11320         not, the assembly code base).
11321
11322 2005-12-23  Dick Porter  <dick@ximian.com>
11323
11324         * icall.c: 
11325         * threads-types.h: 
11326         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
11327         CreateEvent icall now returns "created" boolean parameter.
11328
11329 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
11330
11331         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
11332         #76967.
11333
11334         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
11335         when attr_klass is an interface. Fixes #77045.
11336
11337 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
11338
11339         * marshal.c (emit_struct_conv): Fix previous patch.
11340         
11341         * marshal.c (emit_struct_conv): Add a check for fields with the same
11342         offset.
11343
11344 2005-12-20  Raja R Harinath  <rharinath@novell.com>
11345
11346         Fix regression in Mono.C5.
11347         * class.c (mono_class_create_generic): If 'klass' is an interface
11348         set up the interface offsets.
11349         (mono_class_is_assignable_from): Don't throw away generic arguments.
11350
11351 2005-12-19  Raja R Harinath  <rharinath@novell.com>
11352
11353         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
11354         type parameters.
11355
11356 2005-12-15  Raja R Harinath  <rharinath@novell.com>
11357
11358         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
11359         dead store.
11360         (do_mono_metadata_parse_generic_class): Don't pass the current
11361         generic context when parsing the type being instantiated: it
11362         cannot use it, anyway.
11363
11364         * loader.c (method_from_memberref): Don't inflate a signature if
11365         it doesn't contain any type parameters.
11366
11367 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
11368
11369         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
11370
11371 2005-12-14  Martin Baulig  <martin@ximian.com>
11372
11373         * class.c
11374         (mono_type_get_name_recurse): Don't return null for type
11375         parameters and open generic classes.
11376         (mono_class_setup_methods): Don't exclude generic instances.
11377         (mono_get_unique_iid): Use different IDs for different
11378         instantiations of the same generic type.
11379         (mono_class_setup_vtable): Only use setup_generic_vtable() for
11380         open generic instances; create a normal vtable for closed generic
11381         instances.
11382         (mono_class_setup_vtable_general): We're now also called for
11383         closed generic instances.
11384
11385         * reflection.c
11386         (mono_reflection_bind_generic_parameters): Correctly use
11387         mono_metadata_lookup_generic_inst() everywhere.
11388
11389 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
11390
11391         * object.c (mono_class_create_runtime_vtable): Call 
11392         mono_class_setup_vtable ().
11393
11394         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
11395         function.
11396         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
11397         #76959.
11398
11399         * loader.c (mono_loader_set_error_type_load): Print the type load
11400         warnings to the console so they are more visible to the user.
11401         (mono_loader_set_error_method_load): Ditto.
11402
11403         * reflection.c (ensure_runtime_vtable): Revert the last change as it
11404         is still broken.
11405         
11406         * reflection.c (ensure_runtime_vtable): Fix build.
11407
11408         * reflection.c (ensure_runtime_vtable): Disable an optimization which
11409         doesn't work in all cases.
11410
11411 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
11412
11413         * object.c (mono_array_new_full): Treat a single dimensional array
11414         with 0 lower bounds as an szarray. Fixes #76973.
11415
11416         * reflection.c (custom_attr_visible): Really fix this.
11417
11418 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
11419
11420         * reflection.c (custom_attr_visible): Allow nested public attributes
11421         as well.
11422
11423         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
11424         interface check.
11425
11426 2005-12-12  Raja R Harinath  <harinath@gmail.com>
11427
11428         * class.c (set_generic_param_owner): Delete.
11429         (mono_class_create_from_typedef): Don't set ->owner field of
11430         generic parameters to "param containers" of enclosing classes.
11431         * reflection.c (mono_reflection_initialize_generic_parameter):
11432         Likewise.
11433
11434 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
11435
11436         * reflection.c (custom_attr_visible): Fix build.
11437
11438 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
11439
11440         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
11441         private attributes.
11442         
11443         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
11444         handling of null parameter defaults.
11445
11446 2005-12-09  Raja R Harinath  <rharinath@novell.com>
11447
11448         * class.c (mono_class_from_generic_parameter): Don't set
11449         klass->generic_container.
11450         (my_mono_class_from_generic_parameter): Likewise.
11451
11452 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
11453
11454         * reflection.c (load_public_key): Fix a warning.
11455         (method_encode_code): Fix unaligned accesses.
11456
11457 2005-12-07  Martin Baulig  <martin@ximian.com>
11458
11459         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
11460
11461         * reflection.c
11462         (write_generic_param_entry): Encode our custom attrs.
11463
11464         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
11465
11466 2005-12-07  Martin Baulig  <martin@ximian.com>
11467
11468         * reflection.c (encode_new_constraint): Removed; we don't use the
11469         `NewConstraintAttribute' anymore.
11470
11471 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
11472
11473         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
11474         not fire a TypeResolve event when Assembly.GetType () is called.
11475
11476 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
11477
11478         Beginning of support for nullable types in the runtime. Parts of
11479         this patch are from Martin.
11480
11481         * appdomain.c (MONO_CORLIB_VERSION): Bump
11482
11483         * domain.c (mono_init_internal): get the nullable type
11484
11485         * class.c (mono_class_is_nullable): New method
11486         (mono_class_get_nullable_param): New mehod
11487         (mono_class_create_generic): In types T? set cast_class to T
11488
11489         * class-internals.h (MonoDefaults): new nullable default class
11490         (mono_class_get_nullable_param, mono_class_get_nullable_param):
11491         new methods.
11492
11493 2005-12-05  Raja R Harinath  <rharinath@novell.com>
11494
11495         * metadata.c (select_container): New.  Refactor code to select the
11496         appropriate GenericContainer given the type of generic parameter
11497         we are looking for.
11498         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
11499         not a MonoGenericContext.  Use select_container.  Update parameters.
11500         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
11501         and MONO_TYPE_MVAR.
11502         (unwrap_arrays): Remove duplicate tests.
11503         (find_generic_param): Rename from 'has_same_context'.  Now walks a
11504         generic instantiated class to find any arguments that are generic
11505         parameters.
11506         (mono_type_create_from_typespec_full): Use find_generic_param to
11507         avoid evicting some generic instantiations from the typespec
11508         cache.
11509
11510 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
11511
11512         * reflection.c: fixed writing of doubles on ARM FPA.
11513
11514 2005-12-02  Robert Jordan  <robertj@gmx.net>
11515
11516         * icall.c: Fixed EventInfo.ReflectedType (#76829).
11517
11518 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11519
11520         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
11521         least on SUSE 10 they are not the same (on debian, they are just the
11522         same thing).
11523
11524 2005-12-01  Raja R Harinath  <rharinath@novell.com>
11525
11526         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
11527         DeclaringType for VARs and MVARs.
11528         * class.c (set_generic_param_owner): Fix initialization of owner
11529         fields.
11530
11531 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
11532
11533         * icall.c: fixed Enum.ToObject() to correctly convert the values.
11534
11535 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11536
11537         * threadpool.c: workaround for a bug that shows up on the Mac:
11538         select()+connect() on a blocking socket is not like it should
11539         be, so we proceed to connect() in that case, wasting the I/O
11540         threadpool thread until connect succeedes. Fixes bug #75436.
11541
11542 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11543
11544         * threadpool.c: fix typo when setting file descriptor states.
11545
11546 2005-11-28  Raja R Harinath  <rharinath@novell.com>
11547
11548         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
11549         * metadata.c (mono_metadata_parse_method_signature_full): Don't
11550         create a temporary signature container.
11551         (mono_metadata_parse_generic_param): Update to changes.
11552         (mono_type_create_from_typespec_full): Update to changes.
11553         * loader.c (method_from_memberref): Don't use a
11554         MonoGenericContainer while parsing a memberref signature.
11555         (method_from_methodspec): Remove dead-store of the 'container'
11556         variable.  It's overwritten before use.
11557
11558         * metadata.c (mono_type_create_from_typespec_full): Make debugging
11559         checks tighter.
11560         (mono_metadata_parse_generic_param): Likewise.
11561         * loader.c (find_method_in_class): Does not need a
11562         MonoGenericContainer.  Use 'mono_method_signature' rather than
11563         'mono_method_signature_full'.
11564         (find_method, mono_get_method_constrained, method_from_memberref):
11565         Update to changes.
11566
11567         * metadata.c (mono_type_create_from_typespec_full): Ensure that
11568         owner-less generic-parameters are never evicted from the typespec
11569         cache.
11570
11571         * loader.c (method_from_memberref): Don't use the current context
11572         when parsing signatures.
11573         (method_from_methodspec, mono_get_method_from_token): Update to changes.
11574
11575         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
11576         side-effects in g_assert.
11577         * loader.c (mono_get_method_from_token): Resolve klass earlier so
11578         that we don't potentially lose information.
11579
11580 2005-11-26  Dick Porter  <dick@ximian.com>
11581
11582         * icall.c:
11583         * threads.c: icalls to implement basic (ie, not named)
11584         System.Threading.Semaphore.
11585
11586 2005-11-24  Dick Porter  <dick@ximian.com>
11587
11588         * process.c
11589         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
11590         Use GetProcessId() if it's available.
11591
11592 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
11593
11594         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
11595
11596 2005-11-23  Raja R Harinath  <rharinath@novell.com>
11597             Ankit Jain  <jankit@novell.com>
11598
11599         * loader.c (mono_get_method_from_token): Initialize 'method' field
11600         of all generic parameters before parsing the signature.  Remove
11601         code that "fixed"-up MVAR references.
11602
11603 2005-11-23  Ankit Jain  <jankit@novell.com>
11604
11605         * metadata.c (mono_metadata_has_generic_params):
11606         (mono_metadata_load_generic_param_constraints):
11607         (mono_metadata_load_generic_params): Move duplicate code ...
11608         (mono_metadata_get_generic_param_row): ... here. Returns the
11609         first row-id in GenericParam table for a given owner (token).
11610         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
11611         prototype.
11612
11613 2005-11-23  Raja R Harinath  <rharinath@novell.com>
11614             Ankit Jain  <jankit@novell.com>
11615
11616         * metadata.c (mono_metadata_class_equal): Pass signature_only when
11617         comparing VARs too.
11618         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
11619         type->data.generic_param only if the type is an MVAR.
11620         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
11621         leak owner-less VARs and MVARs into managed space.
11622
11623 2005-11-21  Martin Baulig  <martin@ximian.com>
11624
11625         * class-internals.h
11626         (MonoMethod): Moved the `generic_container' here from
11627         `MonoMethodNormal' since we now also need it for
11628         `MonoMethodPInvoke';
11629         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
11630         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
11631         an union containing both `MonoMethodNormal' and
11632         `MonoMethodPInvoke'.
11633
11634         * loader.c
11635         (mono_get_method_from_token): Allow implementing generic methods
11636         as interncalls.
11637
11638         * threads.c
11639         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
11640         icall.
11641
11642 2005-11-17  Dick Porter  <dick@ximian.com>
11643
11644         * icall.c: 
11645         * process.h: 
11646         * process.c: Split the Process Start_internal icall into
11647         ShellExecuteEx_internal and CreateProcess_internal, which are
11648         called depending on whether UseShellExecute is true.  Fixes bug
11649         76670.
11650
11651         * appdomain.c (MONO_CORLIB_VERSION): Incremented
11652
11653 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
11654
11655         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
11656         'msize' parameters, use the information in 'mspec' instead.
11657         (emit_object_to_ptr_conv): Ditto.
11658
11659         * marshal.c (emit_struct_conv): Handle explicit layout structs with
11660         fields out of order. Fixes #76733.
11661
11662 2005-11-17  Ankit Jain  <jankit@novell.com>
11663
11664         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
11665
11666 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
11667
11668         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
11669           bug #76575.
11670
11671 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
11672
11673         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
11674         for types with non-auto layout. Fixes #76717.
11675
11676 2005-11-16  Ankit Jain  <jankit@novell.com>
11677
11678         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
11679         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
11680         if generic_context is null.
11681           (mono_metadata_generic_param_equal): param->owner can be null.
11682           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
11683         null.
11684
11685 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
11686
11687         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
11688         the correct value.
11689
11690 2005-11-15  Martin Baulig  <martin@ximian.com>
11691
11692         * object.c (set_value): Use mono_class_from_mono_type() instead of
11693         the hack for generic instances; fixes #76136.
11694
11695 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
11696
11697         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
11698         fields.
11699
11700         * image.c (load_metadata_ptrs): Initialize the new fields.
11701
11702         * reflection.c (create_dynamic_mono_image): Ditto.
11703
11704         * reflection.c (build_compressed_metadata): Use the new fields.
11705
11706         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
11707         icall.
11708
11709         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
11710         icall.
11711         
11712 2005-11-15  Ankit Jain  <jankit@novell.com>
11713             Raja R Harinath  <harinath@gmail.com>
11714
11715         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
11716         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
11717         new per-generic_container cache if the cached MonoType's context matches
11718         the current context.
11719           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
11720         to the expected context.
11721           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
11722
11723 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11724
11725         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
11726         we changed the signature of an icall.
11727         * icall.c: Modify to mono_double_ParseImpl return true/false 
11728         depending on the success, instead of throwing the exception. This will
11729         help us in Double.TryParse methods.
11730         
11731 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
11732
11733         * marshal.c (emit_marshal_object): Throw an exception when
11734         marshalling 'object' instead of crashing. Fixes #76696.
11735
11736 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
11737
11738         * class-internals.h: Add prototype for mono_type_get_full_name ().
11739
11740 2005-11-11  Dick Porter  <dick@ximian.com>
11741
11742         * threads.c (mono_thread_manage): Make sure the main thread has
11743         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
11744
11745 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
11746
11747         * loader.c (mono_loader_set_error_type_load): Log a warning to the
11748         console about the missing type.
11749         (mono_loader_set_error_method_load): Ditto.
11750
11751 2005-11-09  Miguel de Icaza  <miguel@novell.com>
11752
11753         * mono-config.c (mono_get_config_dir): Set the system defaults if
11754         none is specified.
11755
11756         * assembly.c (mono_set_dirs): New API entry point to set the
11757         assembly and the config directory in one call
11758
11759 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
11760
11761         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
11762         the ftnptr was created from a delegate in a domain other than the
11763         current domain. Fixes #75377.
11764
11765         * exception.h exception.c: Add mono_get_exception_not_supported ().
11766
11767 2005-11-08  Martin Baulig  <martin@ximian.com>
11768
11769         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
11770
11771 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
11772
11773         * security-manager.h: Added definitions to deal with strongname key 
11774         pairs bigger (and smaller) than 1024 bits.
11775         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
11776         adjust wrt the public key length being used.
11777
11778 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
11779
11780         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
11781           Windows build (r51396-51397).
11782
11783 2005-11-03  Martin Baulig  <martin@ximian.com>
11784
11785         * class.c (mono_class_setup_vtable_general): Also add generic
11786         methods to the vtable; fixes #76581.
11787
11788 2005-11-01  Miguel de Icaza  <miguel@novell.com>
11789
11790         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
11791         sure that we lookup GetString method from the System.Text.Encoding
11792         class, not the derived class or we get an empty method.
11793
11794         Fixed class #76612.
11795
11796 2005-10-25  Miguel de Icaza  <miguel@novell.com>
11797
11798         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
11799         if it has been previously set (embedders). 
11800
11801         Make mono_set_rootdir available also on Unix.
11802
11803 005-10-24  Robert Jordan  <robertj@gmx.net>
11804
11805         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
11806
11807 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
11808
11809         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
11810         only calls which are made to native code use this flag.
11811
11812         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
11813
11814 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
11815
11816         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
11817         Add support for FieldBuilders.
11818
11819 2005-10-29  Martin Baulig  <martin@ximian.com>
11820
11821         * mono-debug.c
11822         (mono_debug_using_mono_debugger): New public method; returns
11823         whether we're running inside the debugger.
11824
11825 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
11826
11827         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
11828         for Method/Constructor/FieldBuilders.
11829
11830 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
11831
11832         * reflection.c (module_add_cattrs): Save custom attributes for global methods
11833         and fields as well.
11834
11835 2005-10-26  Martin Baulig  <martin@ximian.com>
11836
11837         * mono-debug-debugger.c
11838         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
11839
11840 2005-10-24  Raja R Harinath  <harinath@gmail.com>
11841
11842         * icall.c (base64_to_byte_array): Don't pass an out-of-range
11843         integer to isspace.
11844
11845 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
11846
11847         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
11848         when passing valuetypes byref. Fixes #76502.
11849
11850 2005-10-19  Jackson Harper  <jackson@ximian.com>
11851
11852         * profiler.c: Don't put a . in front of types that are not in a
11853         namespace.
11854
11855 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
11856
11857         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
11858
11859 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
11860
11861         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
11862         #76436.
11863         (mono_marshal_get_ldflda_wrapper): Fix a warning.
11864
11865 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11866
11867         * assembly.c metadata-internals.h icall.c: Define an additional
11868         parameter for mono_assembly_name_parse_full, so we can avoid creating
11869         S.R.AssemblyName.Version when no version info wasn't passed.
11870         
11871 2005-10-09  Miguel de Icaza  <miguel@novell.com>
11872
11873         * class.c (mono_type_get_full_name): Reimplement method that was
11874         removed. 
11875
11876         * image.c: Some docs
11877
11878 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
11879
11880         * profiler.c (output_newobj_profile): Fix printing of Total memory
11881         on x86.
11882
11883 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
11884
11885         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
11886
11887 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
11888
11889         * threads.c: remove debug output.
11890
11891 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
11892
11893         * threads.c (mono_thread_manage): Fix crashes if more than 64
11894         threads need to be aborted. Hopefully fixes #75899.
11895
11896         * assembly.c (mono_stringify_assembly_name): New helper function.
11897
11898         * class.c: Use mono_stringify_assembly_name instead of the similar
11899         static function.
11900
11901         * assembly.h assembly.c: Add support for calling a postload search 
11902         hook if an assembly cannot be loaded.
11903
11904         * appdomain.c: Register new search hooks which call the AssemblyResolve
11905         events in AppDomain. Fixes #75231
11906
11907 2005-10-07  Martin Baulig  <martin@ximian.com>
11908
11909         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
11910         methods without debug info.
11911
11912 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
11913
11914         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
11915         wrappers.
11916
11917 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11918
11919         * file-io.c: now that we return symlinks, use lstat and, when the file
11920         is a symbolic link, stat, to get the file attributes. Also avoid the
11921         conversion to/from utf16/external.
11922
11923 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
11924
11925         * class.c (mono_class_layout_fields): Compute klass->has_references
11926         correctly if an embedded valuetype is not yet initialized. Fixes
11927         #76331.
11928
11929 2005-10-04  Martin Baulig  <martin@ximian.com>
11930
11931         * metadata.c
11932         (mono_metadata_load_generic_param_constraints): New public
11933         function; splitted the constraints loading out from
11934         mono_metadata_load_generic_params().
11935
11936         * class.c (mono_class_create_from_typedef): Call
11937         mono_metadata_load_generic_param_constraints() after setting up
11938         the type and creating our parent; fixes #75329.
11939
11940 2005-10-04  Martin Baulig  <martin@ximian.com>
11941
11942         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
11943         non-dynamic parent classes.
11944
11945 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
11946
11947         * file-io.c : win32 build fix (ETXTBSY seems not found).
11948
11949 2005-10-04  Martin Baulig  <martin@ximian.com>
11950
11951         * reflection.c
11952         (mono_image_get_methodspec_token): Make the cache actually work;
11953         fixes #75974.
11954
11955 2005-10-04  Martin Baulig  <martin@ximian.com>
11956
11957         * class.c (mono_class_name_from_token): Removed the unneccessary
11958         `MonoGenericContext *' argument.
11959
11960 2005-10-04  Martin Baulig  <martin@ximian.com>
11961
11962         * loader.c
11963         (method_from_methodspec): Make the caching work again; fixes the
11964         performance regression from #76262.
11965
11966 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11967
11968         * file-io.c:
11969         * file-io.h:
11970         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
11971         GetFileSystemEntries that performs the same work but without going
11972         into io-layer, locking, etc.
11973
11974 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
11975
11976         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
11977         ThreadState_Stopped as well. Fixes #76047.
11978
11979 2005-09-29  Martin Baulig  <martin@ximian.com>
11980
11981         * class.c
11982         (inflate_generic_context): If the new context has a `gmethod', set
11983         its `container' that that gmethod's `container'.
11984
11985         * metadata.c
11986         (mono_metadata_parse_generic_param): Simplify things;
11987         `generic_container = generic_context->container;' is just fine.
11988
11989         * loader.c (method_from_methodspec): Code cleanups.
11990
11991 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
11992
11993         * decimal.c: fix warning (and let gcc generate correct
11994         code on ARM with optimizations).
11995
11996 2005-09-28  Martin Baulig  <martin@ximian.com>
11997
11998         * loader.c
11999         (method_from_memberref): Added `MonoGenericContext *class_context'
12000         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
12001         (method_from_methodspec): If we're a memberref, use the enclosing
12002         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
12003
12004 2005-09-28  Martin Baulig  <martin@ximian.com>
12005
12006         * object.c (mono_runtime_invoke_array): Added support for
12007         MONO_TYPE_GENERICINST; fixes #75917.
12008
12009 2005-09-27  Martin Baulig  <martin@ximian.com>
12010
12011         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
12012         `k->byval_arg.type' to determine the actual type.
12013
12014         * loader.c (method_from_methodspec): Removed some hacks.
12015
12016 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
12017
12018         * class-internals.h (mono_field_is_deleted): Do the test for
12019         rtspecialname before we check the actual name of the field. This
12020         prevents us from dereferencing a pointer into the string table,
12021         saving us from accessing a few pages
12022
12023         * *.c: Replace the use of {Enter,Leave}CriticalSection with
12024         macros. This will allow a deadlock debugger to easily be plugged
12025         in.
12026
12027 2005-09-27  Martin Baulig  <martin@ximian.com>
12028
12029         * loader.c (method_from_methodspec): Create a "signature"
12030         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
12031
12032 2005-09-27  Martin Baulig  <martin@ximian.com>
12033
12034         * class.c
12035         (inflate_generic_class): Correctly set the new context's
12036         container.
12037
12038         * loader.c
12039         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
12040         instead of a `MonoGenericContext *'.
12041         (mono_method_signature_full): Take a `MonoGenericContainer *'
12042         instead of a `MonoGenericContext *'.
12043
12044         * metadata.c
12045         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
12046         instead of a `MonoGenericContext *'.
12047         (mono_metadata_parse_method_signature_full): Likewise.
12048
12049 2005-09-26  Martin Baulig  <martin@ximian.com>
12050
12051         * class.c
12052         (mono_class_from_generic_parameter): Set `klass->generic_container'
12053         (mono_class_from_generic_parameter): Likewise.
12054         (mono_bounded_array_class_get): We inherit the generic container
12055         from the element class.
12056
12057         * loader.c
12058         (find_method, find_method_in_class): Take a `MonoGenericContext *'
12059         argument rather than computing it here.
12060         (method_from_memberref): Correctly set the generic context before
12061         parsing the signature.  Fixes #75681.
12062
12063 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
12064
12065         * object.c (mono_class_has_special_static_fields): Fix warnings.
12066
12067 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12068
12069         * assembly.c: Add parse_public_key function, to
12070         par the public keys. Also added mono_assembly_name_parse_full,
12071         to define it the parsed key should be freed or not.
12072         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
12073         to parse a long format assembly name.
12074         * metadata-internals.h: Keep mono_assembly_name_parse_full as
12075         private, since calling it to preserve the key requires
12076         freeing it manually.
12077         
12078 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
12079
12080         * locales.c : removed HAVE_ICU part.
12081
12082 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
12083
12084         * object.c (mono_class_create_runtime_vtable): Avoid calling 
12085         field_is_special_static if the klass has no special static fields.
12086
12087         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
12088         (MonoCachedClassInfo): Likewise.
12089
12090         * object.c (mono_class_has_special_static_fields): New helper function.
12091
12092 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
12093
12094         * class.c (mono_class_create_from_typedef): Don't call 
12095         interfaces_from_typedef_full for enums.
12096         (mono_class_create_from_typedef): Compute the base types of enums directly
12097         without calling mono_class_setup_fields ().
12098         (mono_class_find_enum_basetype): New helper function.
12099
12100         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
12101         one place inside the string heap.
12102         
12103 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
12104
12105         * class.c: locking fixes, code cleanups, some docs added.
12106         Allocate some data structures in the image mempool.
12107
12108 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
12109
12110         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
12111         the example code.
12112         
12113 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
12114
12115         * class-internals.h, class.c, reflection.c: reduce memory taken by
12116         MonoClass.
12117
12118 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
12119
12120         * metadata.c, metadata.h, loader.h: documentation updates, code and
12121         API cleanups.
12122
12123 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
12124
12125         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
12126         the example code.
12127
12128         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
12129         page faults caused by the runtime while reading metadata.
12130
12131 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12132
12133         * socket-io.c: the field names were changed 3 months ago and no one
12134         realized until bug #76077 got filed!
12135
12136 2005-09-20  Martin Baulig  <martin@ximian.com>
12137
12138         * icall.c (assembly_icalls): Removed some unused debugger icalls.
12139
12140 2005-09-20  Martin Baulig  <martin@ximian.com>
12141
12142         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
12143         write the rank into the class entry.
12144
12145 2005-09-20  Martin Baulig  <martin@ximian.com>
12146
12147         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
12148
12149 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
12150
12151         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12152
12153         * icall.c (custom_attrs_defined_internal): New icall.
12154
12155         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
12156         function.
12157         (mono_custom_attrs_construct_by_type): New helper function.
12158
12159 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
12160
12161         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
12162         terminate the resulting string. Fixes #76123.
12163
12164 2005-09-16  Martin Baulig  <martin@ximian.com>
12165
12166         * mono-debug.c
12167         (mono_debug_add_method): Ignore inflated methods for the moment.
12168
12169 2005-09-14  Martin Baulig  <martin@ximian.com>
12170
12171         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
12172
12173 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
12174
12175         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
12176         return a success/failure indication.
12177         (mono_metadata_interfaces_from_typedef_full): Ditto.
12178         (get_constraints): Ditto.
12179
12180 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
12181
12182         * marshal.c (emit_marshal_array): Fix handling of null arrays.
12183         
12184         * marshal.c (emit_marshal_array): Add support for returning string
12185         arrays from delegates. Fixes #76063.
12186
12187         * marshal.c: Use the emit_ldloc/stloc macros where possible.
12188
12189 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
12190
12191         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
12192         icall.
12193
12194 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
12195
12196         * reflection.c icall.c: Fix after mono_get_exception_type_load
12197         signature change.
12198
12199         * assembly.c (mono_assembly_get_assemblyref): New helper function.
12200         (mono_assembly_load_reference): Use the new helper.
12201
12202         * class-internals.h (MonoLoaderError): New structure containing 
12203         information about type loading errors.
12204
12205         * class-internals.h loader.c: Add APIs to store per-thread loader
12206         error information.
12207
12208         * loader.c class.c: Set the loader error if needed.
12209
12210         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
12211
12212 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
12213
12214         * decimal.c: fixed to handle the broken ARM fp format.
12215
12216 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
12217
12218         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
12219         broken.
12220
12221 2005-09-06  Martin Baulig  <martin@ximian.com>
12222
12223         * domain.c (supported_runtimes): Added v2.0.50727.
12224
12225 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
12226
12227         * culture-info.h: reduce the size of some structures.
12228
12229 2005-09-05  Martin Baulig  <martin@ximian.com>
12230
12231         Reflect latest API changes in the August CTP.
12232
12233         * icall.c
12234         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
12235         ("MonoType.HasGenericArguments"): Removed.
12236         ("MonoMethod.BindGenericParameters"): Renamed to
12237         "MakeGenericMethod".
12238         ("MethodBuilder.BindGenericParameters"): Renamed to
12239         "MakeGenericMethod".    
12240
12241 2005-09-05  Martin Baulig  <martin@ximian.com>
12242
12243         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
12244
12245 2005-09-05  Martin Baulig  <martin@ximian.com>
12246
12247         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12248
12249         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
12250         generic_container is non-NULL.
12251
12252 2005-09-05  Martin Baulig  <martin@ximian.com>
12253
12254         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12255
12256         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
12257
12258 2005-08-29  Michal Moskal  <malekith@nemerle.org>
12259
12260         * reflection.c (encode_locals,
12261         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
12262         for large generic types.
12263
12264 2005-09-05  Martin Baulig  <martin@ximian.com>
12265
12266         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12267
12268         * class.c (mono_dup_array_type): New public method.
12269         (mono_metadata_signature_deep_dup): New public method.
12270         (dup_type): Correctly duplicate array and function types.
12271
12272 2005-09-05  Martin Baulig  <martin@ximian.com>
12273
12274         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12275
12276         * reflection.c (get_default_param_value_blobs): Handle generic types
12277         and generic methods.
12278
12279 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
12280
12281         * class.c: Fixed error reporting (method/class were inversed) for 
12282         inheritance demands.
12283         * security-manager.c|h: Added the AppDomain when calling the managed
12284         System.Security.SecurityManager.InheritanceDemand method.
12285
12286 2005-09-01  Raja R Harinath  <rharinath@novell.com>
12287
12288         * reflection.c (encode_marshal_blob): 'marshaltype' and
12289         'marshaltyperef' are alternate sources for the custom marshaler
12290         name.
12291
12292 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
12293
12294         * class.c: fix creation of array classes with rank == 1
12295         (patch by Ankit Jain <jankit@novell.com>).
12296
12297 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
12298
12299         * object.c: fix check for creating the bound data for arrays vs
12300         szarrays.
12301
12302 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12303
12304         * object.c: configuration file name is now based on the executable name,
12305         not the image name. Fixes bug #75931.
12306
12307 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
12308
12309         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
12310         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
12311
12312 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
12313
12314         * rand.c: Use wincrypt.h instead of WinCrypt.h.
12315
12316 2005-08-24  Ankit Jain  <jankit@novell.com>
12317             Raja R Harinath  <rharinath@novell.com>
12318
12319         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
12320           called by it recursively.
12321           (mono_class_init): Remove special case in pending_init handling, since it's
12322           superseded by the fix to mono_class_from_typeref.
12323
12324 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
12325
12326         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
12327         BROKEN_THREAD_START stuff.
12328
12329 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
12330
12331         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
12332         trampoline.
12333
12334         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
12335         
12336         * object.c (mono_delegate_ctor): Replace the original function address with
12337         a delegate trampoline.
12338
12339 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
12340
12341         * icall.c: add boolean argument to base64_to_byte_array and 
12342         InternalFromBase64String to control whether a whitespace-only string
12343         is allowed (or should casue a FormatException to be thrown). We need
12344         this as the behavior has changed between MS.NET 1.x and 2.0, and we
12345         to match the MS behaviour in both profiles.
12346         * appdomain.c: Bump corlib version.
12347
12348 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12349
12350         This patch implements a big portion of publisher policy
12351         support, used to bind assembly versions and redirect
12352         one assembly from version A to version B.
12353
12354         * assembly.c:
12355         New GSList loaded_assembly_bindings, for storing the cached
12356         assembly bindings.
12357         (assembly_binding_maps_name): New static function for checking if a 
12358         assembly binding information maps an assembly name.
12359         (mono_assembly_binding_info_free): New function for freeing
12360         assembly binding information resources.
12361         (get_publisher_policy_info): New static function for retrieving 
12362         assembly binding information from a MonoImage.
12363         (compare_versions): New static function for comparing an assembly
12364         binding information data and the version of an assembly name.
12365         (check_policy_versions): New static function for checking if an
12366         assembly binding info mapping an assembly name is valid for it.
12367         (mono_assembly_load_publisher_policy): New static function for
12368         loading the 'policy.major.minor.MyAssembly' image for an assembly
12369         with an assembly name 'aname'.
12370         (mono_assembly_bind_version): New static function for updating
12371         assembly redirection.
12372         (mono_assembly_apply_binding): New static function for applying
12373         assembly binding.
12374         (search_binding_loaded): New static function for searching 
12375         loaded assembly binding infos in the cache domain.
12376         (mono_assembly_load_full): Don't apply assembly binding for
12377         reflection only assemblies.
12378
12379         * metadata-internals.h: Add MonoAssemblyBindingInfo,
12380         which contains information about assembly binding. Also
12381         declare signature for mono_config_parse_publisher_policy ()
12382         function, used to retrieve pub policy info.
12383         
12384         * mono-config.c:
12385         (publisher_policy_start): New static function used to parse publisher 
12386         policy config files.
12387         (publisher_policy_parser): New static MonoParseHandler containing 
12388         the functions used when parsing config files.
12389         (mono_config_parse_publisher_policy): New function for parsing
12390         publisher policy files.
12391         
12392 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
12393
12394         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
12395
12396         * marshal.c (mono_delegate_free_ftnptr): Ditto.
12397
12398         * object.c (mono_get_addr_from_ftnptr): New helper function.
12399
12400         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
12401
12402         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12403
12404 2005-08-19  Dick Porter  <dick@ximian.com>
12405
12406         * threads.c, threads.h, appdomain.c, appdomain.h,
12407         profiler-private.h, monitor.c, object.c, object-internals.h,
12408         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
12409         store the thread ID, so it can hold a 64 bit value if needed.
12410
12411 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
12412
12413         * reflection.c (mono_reflection_create_dynamic_method): Store the
12414         handle class into the method references as well so ldtoken works in
12415         dynamic methods.
12416
12417         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
12418         types.
12419
12420 2005-08-19  Ankit Jain <jankit@novell.com>
12421
12422         Fix #75847.
12423         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
12424           here rather than using the method signature of a arbitrary function
12425           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
12426           two arguments.
12427           Hack done with Harinath.
12428
12429 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12430
12431         * threadpool.c: disable printing stack traces when we get a exception
12432         in a threadpool thread. I need to do more testing to figure out which
12433         cases actually print this. Fixes bug #75828.
12434
12435 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12436
12437         * icall.c: there might be ignored whitespace after the last '='. This
12438         fixes length computation and bug #75840.
12439
12440 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
12441
12442         * assembly.c (mono_assembly_load_full): Consider .exe extension as
12443         well. Fixes #75809.
12444
12445         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
12446         #75784.
12447         
12448         * reflection.c (create_custom_attr_data): Ditto.
12449
12450 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
12451
12452         * locales.c, culture-info.h : removed RegionLCIDMap.
12453         * culture-info-tables.h : regenerated.
12454
12455 2005-08-16  Martin Baulig  <martin@ximian.com>
12456
12457         * class.c (mono_type_get_name_recurse): Small fix.
12458
12459 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
12460
12461         * locales.c : indentation fixie.
12462
12463 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
12464
12465         * object-internals.h,
12466           locales.h,
12467           locales.c,
12468           culture-info.h,
12469           icall.c : added RegionInfo table support.
12470         * culture-info-table.h : regenerated for region support.
12471
12472 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
12473
12474         * reflection.c (resolve_object): handle all kinds of MonoMethod
12475         including generic ones
12476
12477 2005-08-12  Ankit Jain <jankit@novell.com>
12478
12479         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
12480           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
12481
12482 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
12483
12484         * process.c: Don't close a thread handle when it's NULL. This is a
12485         workaround for bug #75733.
12486
12487 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
12488
12489         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
12490
12491 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
12492
12493         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
12494
12495 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12496
12497         * threadpool.c: if a work item in the thread pool has a callback that
12498         catches a exception, don't propagate it after invoking the callback.
12499         Fixes bug #75336.
12500
12501 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
12502
12503         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
12504
12505         * class-internals.h (MonoCachedClassInfo): Add some new fields.
12506
12507         * class.c (mono_class_init): Load field info lazily in the AOT case.    
12508
12509         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
12510
12511 2005-08-03  Ankit Jain  <jankit@novell.com>
12512
12513         Fix #75683.
12514         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
12515           PInvoke calling convention is 0.
12516
12517 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
12518
12519         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
12520         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
12521
12522 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
12523
12524         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
12525         to handle threads not started by the GC (patch by Michael Meeks
12526         <michael.meeks@novell.com>).
12527
12528 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
12529
12530         * reflection.c: Make buffer used in emitting types larger for some
12531         big generic types (patch by Michal Moskal).
12532
12533 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
12534
12535         * mono-debug.c: Fix some (not all) alignment problems.
12536
12537 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12538
12539         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
12540         Invoke mono_image_load_from_data_full passing the refonly
12541         parameter.
12542
12543         * assembly.c
12544         (mono_assembly_open_from_bundle): Add the refonly argument, 
12545         in order to pass it to other methods it calls to.
12546         (do_mono_assembly_open): Add the refonly argument, in order 
12547         to pass it to other methods it calls to.
12548         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
12549         the refonly parameter to it.
12550
12551         * image.c: Add loaded_images_refonly_hash and
12552         loaded_images_refonly_guid_hash to cache the reflection
12553         only loaded images.
12554         (mono_images_init): Initialize the hash tables used for
12555         caching the reflection only images.
12556         (load_modules): Invoke mono_image_open_full passing the refonly
12557         parameter to load the modules the correct way.
12558         (build_guid_table): Add the refonly argument, to re-build the 
12559         correct hash table.
12560         (do_mono_image_open): Added the refonly argument, in order to
12561         define it for the loaded image.
12562         (mono_image_loaded_full): New function, which receives an
12563         additional parameter to look for the image in the refonly or
12564         non-refonly section.
12565         (mono_image_loaded): Updated, using mono_image_loaded_full.
12566         (mono_image_loaded_by_guid_full): The same case that happens
12567         with mono_image_loaded_full.
12568         (mono_image_loaded_by_guid): Likewise.
12569         (register_image): Use the ref_only variable inside MonoImage
12570         to decide in which hash table store the current image.
12571         (mono_image_open_from_data_full): Rename
12572         mono_image_open_from_data to mono_image_open_from_data_full,
12573         adding the refonly argument, to define the ref_only variable 
12574         inside MonoImage.
12575         (mono_image_open_from_data): Return 
12576         mono_image_open_from_data_full.
12577         (mono_image_open_full): Rename mono_image_open to
12578         mono_image_open_full, receiving the new refonly argument,
12579         to pass it to inner methods.
12580         (mono_pe_file_open): Update this function, to open
12581         a MonoImage as a non-refonly image.
12582         (mono_image_close): Use the refonly variable inside
12583         MonoImage to remove the image from the correct caches.
12584
12585         * image.h: Add the signatures of mono_image_open_full,
12586         mono_image_open_from_data_full, mono_image_loaded_full,
12587         mono_image_loaded_by_guid_full.
12588
12589         * metadata-internals.h: Add the ref_only field to 
12590         MonoImage.
12591         
12592 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12593
12594         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
12595         Fix the last behavior, which used to load the assemblies and
12596         extract MonoReflectionAssemblyName information, instead of
12597         extract it from the metadata tables. Needed for Reflection
12598         Only assemblies.
12599         
12600 2005-07-29  Martin Baulig  <martin@ximian.com>
12601
12602         * mono-debug-debugger.c
12603         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
12604         not initialized.
12605
12606         * mono-debug.c
12607         (mono_debug_address_from_il_offset): Check whether we have
12608         debugging support before attempting to take the lock.
12609         (mono_debug_source_location_from_address): Likewise.
12610         (mono_debug_source_location_from_il_offset): Likewise.
12611         (mono_debug_il_offset_from_address): Likewise.
12612         (mono_debug_address_from_il_offset): Likewise.
12613
12614 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
12615
12616         * class.c (mono_class_from_name_case): Add support for dynamic images.
12617         Fixes #75650.
12618
12619         * object.c (mono_class_compute_gc_descriptor): Add a workaround
12620         for #75479.
12621
12622 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
12623         
12624         * reflection.c (mono_method_get_object): Fix warning.
12625
12626 2005-07-28  Martin Baulig  <martin@ximian.com>
12627
12628         * mono-debug.c
12629         (mono_debug_add_wrapper): Also write the wrapper type.
12630
12631 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
12632
12633         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
12634         
12635         * class.c (mono_class_init): Avoid reading nested classes if the AOT
12636         data indicates the class has none.
12637
12638 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
12639
12640         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
12641         loader lock with the debugger lock. Prevents deadlocks for beagle.
12642
12643         Beagle can now run on an smp box for a weekend without any
12644         issues. Woohoo!
12645
12646 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
12647
12648         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
12649         in a module. Fixes #75629.
12650
12651 2005-07-26  Martin Baulig  <martin@ximian.com>
12652
12653         * mono-debug.c (mono_debug_add_wrapper): New static method.
12654         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
12655         interncall or a wrapper.
12656
12657         * mono-debug.h (MonoDebugWrapperData): New public typedef.
12658         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
12659         (MONO_DEBUGGER_VERSION): Bump to 51.
12660
12661         * mono-debug-debugger.c
12662         (mono_debugger_add_type): Removed this empty function.
12663         (mono_debugger_add_method): Likewise.
12664
12665 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
12666
12667         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
12668         before accessing method->slot.
12669
12670 2005-07-21  Jb Evain  <jbevain@gmail.com>
12671
12672         * reflection.c (method_encode_clauses/class): Handle filters clauses.
12673         Fixes #75010.
12674
12675 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
12676
12677         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
12678         #75587.
12679
12680 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
12681
12682         * image.h image.c: Add mono_image_get_guid () API function.
12683
12684 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
12685
12686         There were issues when multiple threads tried to load
12687         assemblies. A deadlock was created between assemblies_mutex and
12688         mono_domain_assemblies_lock. This fixes the issue by making the
12689         assembly ref counting be lock free. See bug 75586.
12690         
12691         * image.c (mono_image_close): The add ref function here was using
12692         Interlocked operations while the unref was using a mutex and a
12693         --. I don't think this was ever a bug that would be exposed in a
12694         non-pendantic way (ie, by an embedder doing a ref on one thread
12695         and an unref on another), but for the sake of correctness, this is
12696         now Interlocked.
12697
12698         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
12699         (mono_assembly_load_reference): Call mono_assembly_addref rather
12700         than touching the refcount ourselves.
12701         (mono_assembly_close): Use InterlockedDecrement to unref the
12702         assembly. Don't acquire the lock unless it is actually needed.
12703
12704 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
12705
12706         * class.c (mono_class_layout_fields): Fix calculation of has_references
12707         for generic types.
12708
12709 2005-07-12  Martin Baulig  <martin@ximian.com>
12710
12711         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12712
12713         * metadata.c
12714         (mono_type_hash): Provide better hashing for generic instances.
12715         (mono_generic_inst_hash): Improve hashing.
12716         (mono_generic_class_hash): Likewise.
12717
12718         * reflection.c (mymono_metadata_type_hash): Improve hashing for
12719         generic instances.
12720
12721 2005-07-12  Martin Baulig  <martin@ximian.com>
12722
12723         * reflection.c (mono_reflection_create_runtime_class): Remove the
12724         hack for generic type definitions and non-`Run' assemblies.
12725         (mono_reflection_bind_generic_parameters): Also use
12726         `klass->wastypebuilder' to check for TypeBuilders.
12727
12728 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
12729
12730         * class.c (mono_class_layout_fields): Fix calculation of has_references
12731         for generic types.
12732
12733         * class.c (inflate_generic_class): Fix a leak.
12734         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
12735         for generic types.
12736
12737 2005-07-11  Martin Baulig  <martin@ximian.com>
12738
12739         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
12740         on error.
12741
12742 2005-07-11  Martin Baulig  <martin@ximian.com>
12743
12744         * loader.c (find_method): Also lookup in
12745         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
12746
12747 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
12748
12749         * appdomain.c (mono_domain_unload): Don't free the error message
12750         before passing it to mono_get_exception_...
12751
12752         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
12753         
12754 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
12755
12756         * threads.c: try to better guess an available RT signal (bug #75387).
12757
12758 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
12759
12760         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
12761         and CACHE_OBJECT.
12762
12763 2005-07-07  Martin Baulig  <martin@ximian.com>
12764
12765         * class.c (mono_type_get_name_full): Return NULL for
12766         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
12767         fixes #75408.
12768
12769 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
12770
12771         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
12772         exit the appdomain as well being aborted.
12773
12774         * threadpool.c: Create all threadpool threads inside the root appdomain, and
12775         change back to the root domain after calling managed code. This enables
12776         appdomains using threadpools to be unloaded.
12777
12778 2005-07-07  Martin Baulig  <martin@ximian.com>
12779
12780         * class-internals.h
12781         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
12782         into `MonoDynamicGenericClass' since we only need it for dynamic
12783         types.
12784
12785         * reflection.c (mono_class_bind_generic_parameters): We don't need
12786         to compute the `parent' here.
12787
12788 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
12789
12790         * culture-info-table.h : regenerated.
12791
12792 2005-07-06  Martin Baulig  <martin@ximian.com>
12793
12794         * icall.c
12795         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
12796
12797         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
12798
12799 2005-07-06  Martin Baulig  <martin@ximian.com>
12800
12801         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
12802         we're doing a signature-only comparision; fixes #74945.
12803
12804 2005-07-06  Martin Baulig  <martin@ximian.com>
12805
12806         * class-internals.h (MonoGenericClass): Moved some things out into
12807         a new `MonoInflatedGenericClass' type.  
12808         (MonoInflatedGenericClass): New type; the `klass' of a
12809         `MonoGenericClass' is now computed lazyly in
12810         mono_get_inflated_generic_class().      
12811
12812         * class.c (mono_get_inflated_generic_class): New public function.
12813         (mono_class_inflate_generic_method): Removed the unused
12814         `MonoClass *' argument.
12815         (setup_generic_vtable): Don't call mono_get_inflated_method() on
12816         all the methods.
12817         (mono_class_create_generic): Make this static and merge it with
12818         mono_class_create_generic_2(); we're now called automatically from
12819         mono_get_inflated_generic_class().
12820
12821         * loader.c (mono_method_signature): Call
12822         mono_get_inflated_method() here.
12823
12824 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
12825
12826         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
12827         type of fields with RVA.
12828
12829         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
12830         for this pseudo class.
12831         (my_mono_class_from_generic_parameter): Likewise.
12832         (mono_class_init): Allow interfaces to have cctors.
12833
12834 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
12835
12836         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
12837         lazily for AOT methods.
12838
12839 2005-07-05  Martin Baulig  <martin@ximian.com>
12840
12841         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
12842         returns FALSE for a successful match, not TRUE.
12843
12844 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
12845
12846         * loader.c (mono_method_get_index): Optimize this a bit.
12847
12848 2005-07-04  Martin Baulig  <martin@ximian.com>
12849
12850         * class.c
12851         (class_compute_field_layout): Move the check for generic type
12852         definitions into mono_class_layout_fields().  Fixes #74684.
12853         (mono_class_from_generic_parameter): Correctly compute
12854         `klass->parent'; fixes #75457.
12855
12856         * reflection.c (register_assembly, register_module): Make sure
12857         `domain->rejobject_hash' is already created.
12858
12859 2005-07-02  Martin Baulig  <martin@ximian.com>
12860
12861         * class-internals.h
12862         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
12863         `MonoDynamicGenericClass'.      
12864
12865 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
12866
12867         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
12868         returned by a field getter is null, since null is a valid value.
12869
12870 2005-07-01  Martin Baulig  <martin@ximian.com>
12871
12872         * reflection.c (mono_reflection_generic_class_initialize): Update
12873         the `dgclass->fields [i].parent' to the correct class.
12874         (mono_image_get_fieldref_token): Use the declaring type, not the
12875         reflected type.
12876
12877 2005-07-01  Martin Baulig  <martin@ximian.com>
12878
12879         * loader.c (find_method): Also look in the interfaces; fixes #75429.
12880
12881 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
12882
12883         * threads.c (thread_cleanup): assert that thread != NULL
12884         (wait_for_tids_or_state_change): We were using the wrong variable
12885         when accessing wait->threads. `i' was always out of the bounds of
12886         the array.
12887
12888 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12889
12890         * loader.c: map user32 and kernel32 to libMonoSupportW
12891
12892 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
12893
12894         * appdomain.c (unload_thread_main): Mark this as WINAPI.
12895
12896 2005-06-28  Martin Baulig  <martin@ximian.com>
12897
12898         * loader.c (method_from_methodspec): Fix #75334.
12899
12900 2005-06-28  Martin Baulig  <martin@ximian.com>
12901
12902         Fix #74953 - Arrays now implement the generic IList<T> interface
12903         on the 2.0 platform.
12904
12905         * class-internals.h (MonoDefaults): Added `generic_array_class'.
12906
12907         * reflection.c (mono_class_bind_generic_parameters): New public
12908         function; similar to mono_reflection_bind_generic_parameters(),
12909         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
12910
12911         * domain.c (mono_init_internal): Try to initialize.
12912         `mono_defaults.generic_array_class' here; this'll only succeed if
12913         we're using the 2.0 corlib.
12914
12915         * icall.c
12916         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
12917         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
12918         (mono_lookup_internal_call): Added support for nested classes.
12919
12920         * loader.c
12921         (mono_get_method_from_token): Set `result->signature->pinvoke' if
12922         we're an interncall and have generic arguments.
12923
12924         * class.c
12925         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
12926         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
12927         instance of System.Array.InternalArray<T> for arrays, so they
12928         implement the generic IList<T> interface.
12929
12930 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
12931
12932         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
12933         (chastamar@yahoo.com). Fixes #75374.    
12934
12935 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
12936
12937         * culture-info-table.h: regenerated.
12938
12939 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12940
12941         * icall.c: handle spaces correctly for base64 strings.
12942
12943 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
12944
12945         * *.c: Kill some warnings.
12946
12947 2005-06-23  Duncan Mak  <duncan@novell.com>
12948
12949         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
12950         that this builds on Solaris 10 (x86).
12951
12952 2005-06-23  Martin Baulig  <martin@ximian.com>
12953
12954         * class.c
12955         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
12956         generic type definitions.
12957
12958 2005-06-23  Martin Baulig  <martin@ximian.com>
12959
12960         Fix #75331.
12961
12962         * metadata.c (mono_class_get_overrides): Renamed to
12963         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
12964         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
12965         pass it to mono_get_method_full().
12966
12967 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
12968
12969         * reflection.c (mono_reflection_create_runtime_class): take the
12970         mono_domain_lock in this method. Prevents deadlocks
12971
12972 2005-06-22  Martin Baulig  <martin@ximian.com>
12973
12974         * loader.c (method_from_methodspec): Fix #75330.
12975
12976 2005-06-22  Martin Baulig  <martin@ximian.com>
12977
12978         * reflection.c (type_get_qualified_name): Use
12979         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
12980         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
12981         argument; use it if we don't have an assembly name.
12982
12983 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
12984
12985         * object.c: In mono_message_init, set "copy out" flag for in
12986         parameters with the [Out] flag.
12987
12988 2005-06-21  Martin Baulig  <martin@ximian.com>
12989
12990         * class.c
12991         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
12992         and MONO_TYPE_PTR.
12993
12994 2005-06-21  Martin Baulig  <martin@ximian.com>
12995
12996         * class.c (mono_class_init): Don't initialize `class->fields' for
12997         generic instances since they're initialized again in
12998         compute_field_layout(). 
12999         (compute_field_layout): Set the field's `generic_info' here; fix
13000         #75320. 
13001
13002 2005-06-21  Martin Baulig  <martin@ximian.com>
13003
13004         * class-internals.h
13005         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
13006
13007         * metadata.c (mono_metadata_generic_method_equal): Also
13008         distinguish the `generic_class'; fixes #75334.
13009
13010 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13011
13012         * domain.c:
13013         * appdomain.c:
13014         * domain-internals.h:
13015         * reflection.c: 'domain_assemblies' field is now protected by its own
13016         lock. Don't call into managed code to run the AssemblyLoad event if we
13017         now there are no registered delegates for it.
13018
13019 2005-06-20  Martin Baulig  <martin@ximian.com>
13020
13021         * class.c (mono_class_is_assignable_from): Use a custom version of
13022         mono_class_has_parent() to make things work for generic instances;
13023         fix #75300.
13024
13025 2005-06-20  Martin Baulig  <martin@ximian.com>
13026
13027         * loader.c (method_from_methodspec): Apply a patch from
13028         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
13029
13030 2005-06-20  Martin Baulig  <martin@ximian.com>
13031
13032         * class.c (mono_class_init): Reverted Zoltan's last change; it
13033         breaks generics.
13034
13035 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
13036
13037         * threads.c (wait_for_tids_or_state_change): Add missing locking.
13038
13039 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13040
13041         * socket-io.c: fix the index in the socket array for writable/error
13042         sockets. Fixes bug #75306.
13043
13044 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
13045
13046         * class.c (mono_class_init): Allow interfaces to have static ctors.
13047
13048 2005-06-17  Martin Baulig  <martin@ximian.com>
13049
13050         * loader.c (method_from_methodspec): Use `context->container' when
13051         parsing the `gmethod->inst'.
13052
13053 2005-06-17  Martin Baulig  <martin@ximian.com>
13054
13055         * class.c (mono_type_get_name_recurse): Don't add the assembly
13056         name for type arguments.
13057
13058 2005-06-15  Martin Baulig  <martin@ximian.com>
13059
13060         * reflection.c (mono_image_get_inflated_method_token): Encode
13061         correct klass; fixes #75260.
13062
13063 2005-06-13 Michal Moskal <malekith@nemerle.org>
13064
13065         * icall.c: Make GetCorrespondingMethod/Constructor take
13066         MonoReflectionMethod method not MonoMethod. Removed
13067         MonoType.GetCorrespondingField, and make
13068         MonoGenericType.GetCorrespondingField take name not
13069         MonoClassField.
13070
13071 2005-06-13  Michal Moskal <malekith@nemerle.org>
13072
13073         * reflection.c (field_encode_signature, encode_locals):
13074          Make sizes of buffers for types larger (for big generic types).
13075          (create_generic_typespec,
13076          mono_reflection_sighelper_get_signature_local,
13077          mono_reflection_sighelper_get_signature_field):
13078          Add asserts for too small buffers.
13079
13080 2005-06-15  Martin Baulig  <martin@ximian.com>
13081
13082         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
13083         if our parent is not a dynamic type.
13084
13085 2005-06-15  Martin Baulig  <martin@ximian.com>
13086
13087         * class-internals.h (MonoTypeNameFormat): New enum.
13088
13089         * class.c
13090         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
13091         (mono_type_get_full_name): Removed.
13092         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
13093         argument instead of the boolean's.
13094
13095         * icall.c (ves_icall_System_MonoType_getFullName):
13096         Added `gboolean assembly_qualified'.    
13097
13098         * reflection.h
13099         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
13100
13101         * reflection.c (mono_reflection_parse_type): Parse the new type
13102         name format.
13103
13104 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13105
13106         * icall.c: no need to convert from utf16 to utf8 and then back again
13107         after the call to GetLogicalDrives.
13108
13109 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13110
13111         * icall.c: frombase64. Fix problems exposed by new tests.
13112
13113 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13114
13115         * icall.c: added internal calls for converting char [] and strings in
13116         base64 into byte [].
13117
13118 2005-06-10  Martin Baulig  <martin@ximian.com>
13119
13120         * class.c (mono_class_create_generic_2): Read the nested classes
13121         from the metadata rather than from `gklass->nested_classes' since
13122         `gklass' might not be initialized yet.
13123
13124 2005-06-09  Duncan Mak  <duncan@novell.com>
13125
13126         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
13127         all public headers. Fixes #74919.
13128
13129 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
13130
13131         * domain.c: The key for proxy_vtable_hash is now a pointer
13132         array. Added new GHashFunc and GCompareFunc functions for this.
13133
13134         * class.h: The list of interfaces in MonoRemoteClass is known in
13135         advance and can't grow (we create a new MonoRemoteClass if needed),
13136         so now the interface array can be allocated together with
13137         MonoRemoteClass.
13138         
13139         * object.c: Added a new method create_remote_class_key.
13140         Fixed mono_remote_class so it does not depend on
13141         mono_upgrade_remote_class.
13142         Removed extend_interface_array.
13143         Added new method clone_remote_class(), which makes a copy of a remote
13144         class and adds a new interface or class to it.
13145         mono_upgrade_remote_class() now creates a new remote class (or gets
13146         it from the cache) if an vtable upgrade is needed. In this way
13147         we make sure that other objects sharing the same remote class
13148         don't get the new vtable with unwanted interfaces.
13149         
13150         * object-internals.h:
13151         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
13152         
13153         * marshal.c: Track changes in mono_upgrade_remote_class().
13154
13155 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
13156         * icall.c: Add runtime methods for obtaining members of inflated
13157         class, which were created from supplied non-inflated members. It
13158         is used in internal Get{Method,Constructor,Field} methods in
13159         System.Type
13160
13161 2005-06-09  Martin Baulig  <martin@ximian.com>
13162
13163         * reflection.c
13164         (mono_reflection_bind_generic_method_parameters): Fix #75169.
13165
13166 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13167         * reflection.c (mono_image_basic_init): Define
13168         Version in MonoDynamicAssembly. 
13169         
13170 2005-06-08  Martin Baulig  <martin@ximian.com>
13171
13172         Fix #75136.
13173
13174         * loader.c
13175         (mono_method_signature_full): New public method; takes a
13176         `MonoGenericContext *'.
13177         (find_method): Use mono_method_signature_full() and pass the
13178         klass'es context to it.
13179
13180         * class.c (mono_class_is_inflated_method): Use
13181         mono_method_signature_full() and pass the context to it.
13182
13183 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
13184
13185         * object.c: add proper locking in mono_remote_class_vtable(),
13186         fixes possible memory corruption.
13187
13188 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
13189
13190         * marshal.c (mono_remoting_marshal_init): set
13191         initialized after initialization.
13192
13193 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
13194
13195         * locales.c : hush.
13196
13197 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
13198
13199         * object.c (extend_interface_array): fix really silly
13200         memory corrupting / comparison bug.
13201
13202 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13203
13204         * reflection.c: Functions added to support the creation
13205         of CustomAttributeData, which includes Attribute data
13206         used by ReflectionOnly methods.
13207
13208         * reflection.h:  mono_reflection_get_custom_attrs_data and
13209          mono_custom_attrs_data_construct added (functions exposed).
13210
13211          * icall.c: Added mono_reflection_get_custom_attrs_data
13212          as icall.
13213         
13214 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
13215
13216         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
13217         lupus's request.
13218
13219 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
13220
13221         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
13222
13223         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
13224         dynamic DllImportAttribute.
13225
13226         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
13227         dynamic DllImportAttribute.
13228
13229         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
13230         Fixes #75162.
13231
13232 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13233
13234         * threads.c: avoid segfault when an unstarted thread is aborted.
13235
13236 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
13237
13238         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
13239         Returns the name and version of the runtime for reporting.
13240
13241 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13242
13243         * appdomain.c: bump corlib version.
13244         * object-internals.h: new field in MonoReflectionAssembly.
13245
13246 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13247
13248         * object-internals.h: Carlos forgot to add this field.
13249
13250 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13251
13252         * icall.c: Added create_version to create instances
13253         of Version of MonoReflectionAssemblyName. This change helps
13254         the AssemblyName tests to keep running fine.
13255         
13256 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
13257   
13258         * object.c (mono_method_return_message_restore): A somehow less
13259         intrusive fix for #75138.
13260
13261 2005-06-03  Raja R Harinath  <rharinath@novell.com>
13262
13263         * object.c (mono_method_return_message_restore): Fix computation
13264         of expected number of out args.
13265
13266 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
13267
13268         * reflection.c (mono_image_get_method_info): Fix the case when the
13269         charset is empty.
13270
13271 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
13272
13273         * object.c: Added missing null check in
13274           mono_method_return_message_restore.
13275
13276 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
13277
13278         * reflection.c (mono_image_get_method_info): Handle the case when
13279         dllentry is empty.
13280
13281 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
13282
13283         * object.c: When creating the vtable for a proxy, take into account
13284         all inherited interfaces, not only the ones registered in
13285         iclass->interfaces. This fixs bug #74996.
13286         Also, in mono_method_return_message_restore, verify that the array
13287         of out args has the expected lengh.
13288
13289 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13290
13291         * socket-io.c: update the timeout in Poll when the call is interrupte.
13292
13293 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13294
13295         * socket-io.c: support abort/suspend in Select_internal after last
13296         change.
13297
13298 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13299
13300         * threadpool.c: remove warning.
13301
13302 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13303
13304         * icall.c:
13305         * socket-io.[ch]: Select_internal uses poll() now when available, thus
13306         removing the 1024 limit from select(). Runtime part of the fix for
13307         bug #71203.
13308
13309 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13310
13311         * socket-io.c: when resolving the addresses for the same
13312         host returned by gethostname(), get the local IPs from the interface
13313         list. Loopback addresses are discarded if the are interfaces up with
13314         non-loopback ones. Fixes bug #63265.
13315
13316 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
13317
13318         * appdomain.c, verify.c, object-internals.h, reflection.c:
13319         bumped corlib number to 36, and added new extra_flags field
13320         to ReflectionMethodBuilder and friends.  Fixes #75060.
13321
13322 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
13323
13324         * gc.c: register a new weak link only if the object is non-null
13325         (fixes bug#75047).
13326
13327 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
13328
13329         * culture-info.h : short time pattern too.
13330
13331 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
13332
13333         * culture-info.h : expand long time pattern string length.
13334
13335 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
13336
13337         * culture-info-table.h : update (more French date format; #72788).
13338
13339 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
13340
13341         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
13342         the method is static. Fixes #75029.
13343
13344 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
13345
13346         * reflection.c: Update the table_idx field of method builders after
13347         saving the module, since it can change. This is a workaround for
13348         bug #74914. 
13349
13350 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
13351
13352         * culture-info-table.h : update (additional French date format).
13353
13354 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
13355
13356         * icall.c (ves_icall_type_Equals): Revert last change.
13357         
13358         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
13359
13360         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
13361
13362 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
13363
13364         * class-internals.h: Added executioncontext_class field to 
13365         MonoDefaults structure.
13366         * domain.c: Cache System.Threading.ExecutionContext class in 
13367         mono_defaults.
13368         * object.c: Capture the ExecutionContext for asynchroneous calls in
13369          mono_async_result_new.
13370         * object-internals.h: Added execution_context and original_context 
13371         fields to MonoAsyncResult. Added execution_context to MonoThread.
13372         * security-manager.c|.h: Added mono_get_context_capture_method to 
13373         return the capture method (if required by the security manager or by
13374         the framework version used).
13375         * threadpool.c: Apply capture (if present) ExecutionContext in 
13376         mono_async_invoke and revert to original context after it completes.
13377
13378 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
13379
13380         * culture-info-table.h : updated (real hacky solution for zh-CHT).
13381
13382 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
13383
13384         * culture-info-table.h : zh-CHT related workaround.
13385
13386 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
13387
13388         * marshal.c (emit_marshal_custom): Add some error checking and call the
13389         methods in the ICustomMarshaler interface. Fixes #74875.
13390         
13391         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
13392         native->managed wrappers.
13393
13394 2005-05-12  Martin Baulig  <martin@ximian.com>
13395
13396         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
13397         here and use the loader lock.
13398
13399         * mono-debug.c: Properly lock when the debugger is not attached.
13400         (mono_debug_init): Release the initial lock if we're not running
13401         in the debugger.
13402
13403 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
13404
13405         * marshal.c (emit_marshal_custom): Pass through NULL values without
13406         calling the custom marshalling routines.
13407
13408         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
13409         conversion in structures. Fixes #74882.
13410
13411 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
13412
13413         * culture-info-table.h : zh-* cultures were missing.
13414
13415 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
13416
13417         * threads.c: Added a new event background_change_event which is signaled
13418         when a thread changes its background mode.
13419         Moved here several checks previously done in managed code. The checks
13420         require the thread lock, and using the thread lock in managed code
13421         can result in deadlocks.
13422         Merged Start_internal and Thread_internal into a single method. Now 
13423         Thread_internal does all work of creating and starting a thread.
13424         Added icalls for setting and getting the state of the object. Moved from
13425         managed code to avoid locking there.
13426         Added wait_for_tids_or_state_change() which is called instad of
13427         wait_for_tids when waiting for non-backround threads to end. This method
13428         will return if one of the threads ends or the background_change_event
13429         is signaled.
13430         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
13431         the background mode. This method signals the background_change_event
13432         event.
13433         * icall.c:
13434         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
13435         removed Start_internal.
13436         
13437 2005-05-11  Martin Baulig  <martin@ximian.com>
13438
13439         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
13440         to order of some fields to get proper alignment on 64-bit machines.
13441
13442 2005-05-11  Martin Baulig  <martin@ximian.com>
13443
13444         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
13445         changes as they're broken and completely fuck up the debugger.
13446
13447         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
13448
13449 2005-05-10  Martin Baulig  <martin@ximian.com>
13450
13451         * reflection.c (mono_reflection_generic_class_initialize): Don't
13452         call mono_class_setup_parent() here.
13453
13454 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13455
13456         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
13457         send/receive timeout use an integer in milliseconds. We were using a
13458         struct timeval.
13459
13460 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13461
13462         * locales.c:
13463         (internal_get_cultures): reserve the first slot of the array for the
13464         InvariantCulture, which will be filled in managed code.
13465
13466 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
13467
13468         * reflection.c (mono_image_fill_module_table): Initialize the
13469         GENERATION field as well.
13470
13471 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13472
13473         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
13474         Monitor.Enter on the object.
13475
13476 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
13477
13478         * threads.c: Enable the wait for running threads when exiting.
13479         * icall.c: Suspend all threads before exiting.
13480
13481 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
13482
13483         * assembly.c (mono_assembly_load_reference): Fix warning.
13484
13485 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13486
13487         * threadpool.c: changed the default number of threads per cpu. From now
13488         on, the default will be 20 + (5 * number of cpus) instead of 50.
13489
13490 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
13491
13492         * loader.c (mono_method_get_signature_full): Add locking here.
13493
13494 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
13495
13496         * appdomain.c: Moved methods for parsing and freeing assembly
13497         names to assembly.c.
13498         * assembly.c, domain-internals.h: Created public methods for parsing
13499         assembly names. Fixed mono_assembly_load_with_partial_name:
13500         it now finds the best match, taking into account the version,
13501         token and culture specified in the partial name. Also return
13502         the latest version if no version information is specified.
13503
13504 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
13505
13506         * threadpool.c: replace check for SocketAsyncCall class.
13507
13508 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13509
13510         * threadpool-internals.h:
13511         * Makefile.am: added threadpool-internals.h
13512
13513         * threadpool.c: call mono_unhandled_exception on exceptions not handled
13514         that happen in threadpool threads (tested on MS).
13515         (mono_thread_pool_remove_socket): new function that dispatch any pending
13516         AIO call on a socket that is closing. By now only epoll really needs it,
13517         as select/poll wake up when the socket closes.
13518
13519
13520         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
13521
13522 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
13523
13524         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
13525
13526 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
13527
13528         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
13529
13530 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
13531
13532         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
13533         has an abort request, convert it into a suspend request.
13534
13535 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
13536
13537         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
13538         warning for the usage of `UnmanagedFunctionPointerAttribute' which
13539         is not supported yet.
13540
13541 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13542
13543         * image.c: register assemblies loaded from data (bundles) in the loaded
13544         assemblies hash. Fixes bug #74772.
13545
13546 2005-04-29  Martin Baulig  <martin@ximian.com>
13547
13548         * class.c (mono_type_get_name_recurse): Update to the new naming
13549         schema from the latest .NET 2.x beta2.
13550         (mono_class_setup_vtable_general): If we're a generic instance,
13551         copy the vtable from our generic type definition and inflate all
13552         the methods in it.
13553
13554         * loader.c (find_method): Update to the new naming schema from the
13555         latest .NET 2.x beta2.
13556
13557 2005-04-29  Raja R Harinath  <harinath@gmail.com>
13558
13559         * class.c (mono_class_init): Add a mono_loader_unlock to the
13560         #74734 fix.
13561
13562 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
13563
13564         * icall.c (ves_icall_System_Environment_Exit): Remove the 
13565         suspend_all_other_threads () call for the time being, since it can hang.
13566
13567         * threads.c (mono_thread_manage): Similarly, disable the waiting for
13568         the background threads to exit, since it can also hang.
13569
13570         * class.c (mono_class_init): Applied patch from Ankit Jain 
13571         (radical@gmail.com). Avoid pending init errors when a field refers
13572         to a nested class using a typeref. Fixes #74734.
13573
13574         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
13575         this for dynamic modules.
13576
13577 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13578
13579         * threads.c: don't wait for threads that are in the process of aborting
13580         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
13581         and waiting for background threads to finish. This makes xsp and
13582         mod-mono-server exit without random length delays and/or hangs.
13583
13584 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13585
13586         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
13587
13588 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
13589
13590         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
13591         dynamic types to prevent infinite loops. Fixes #74727.
13592
13593         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
13594         ..._is_assignable_to.
13595
13596 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
13597
13598         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
13599
13600 2005-04-25  Martin Baulig  <martin@ximian.com>
13601
13602         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
13603
13604         * domain.c
13605         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
13606
13607         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
13608
13609         * reflection.c (build_compressed_metadata): Set metadata header
13610         version to 2.0.
13611
13612 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
13613
13614         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
13615         number into an integral and a decimal part. Fixes #70473.
13616
13617         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
13618
13619 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
13620
13621         * culture-info-table.h : reflected the latest locale-builder output.
13622
13623 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13624
13625         * threadpool.c: check for SuspendRequested too when deciding if
13626         mono_thread_interruption_checkpoint should be called.
13627
13628 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13629
13630         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
13631         * threads.c: remove interruption_mutex and use Interlocked instead. When
13632         suspending all the threads, wait for all the suspended events at once.
13633         If we're shutting down and get an APC that is going to be queued,
13634         call mono_thread_execute_interruption immediately, as the thread might
13635         be sleeping on a pthread condition or mutex.
13636
13637         * icall.c: call mono_runtime_set_shutting_down before suspending the
13638         threads.
13639
13640         Fixes bug #74693. And now xsp is happier when exiting.
13641
13642 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
13643
13644         * loader.c (mono_stack_walk): Fix #74690.
13645
13646 2005-04-22  Martin Baulig  <martin@ximian.com>
13647
13648         * mono-debug.h (MonoDebugMethodJitInfo): Added
13649         `MonoDebugMethodJitInfo *jit'.
13650
13651         * mono-debug.c (mono_debug_read_method): Cache the
13652         MonoDebugMethodJitInfo in `address->jit'.
13653         (mono_debug_free_method_jit_info): New public method.
13654
13655 2005-04-22  Martin Baulig  <martin@ximian.com>
13656
13657         * class.c (mono_class_is_assignable_from): Disallow
13658         type parameter -> interface.
13659
13660 2005-04-21  Dick Porter  <dick@ximian.com>
13661
13662         * threads.c (mono_thread_create): Turn an assertion into an error.
13663
13664 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
13665
13666         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
13667         
13668         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
13669         Fix some gcc 4.0 warnings.
13670
13671 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
13672
13673         * file-io.c: fix alt dir separator char on unix systems
13674         and cleanup (fixes bug #71214).
13675
13676 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
13677
13678         * marshal.c: Use CALLVIRT instead of CALL when dispatching
13679         a call to a remote domain, since the method may be an
13680         interface method in the client domain. This fixes bug #74192.
13681
13682 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13683
13684         * threadpool.c: recv/send are now performed before going back to managed
13685         code to save one transition.
13686
13687 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13688
13689         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
13690
13691         * metadata/threadpool.c: removed hack to workaround the bug above.
13692
13693         Fixes bug #74618.
13694
13695 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
13696
13697         * reflection.c reflection.h: Fix handling of parameter defaults in
13698         dynamic methods. Also fixes handling of parameter attributes.
13699         Fixes #74609.
13700
13701         * mono-debug.c (mono_debug_close_image): Fix warning.
13702
13703 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13704
13705         * socket-io.h: replaced old unused field with new 'blocking'.
13706         * threadpool.c: restore socket blocking state on windows(tm).
13707
13708 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
13709
13710         * icall.c: don't return the codebase in the AssemblyName[] returned by
13711         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
13712         * object-internals.h: Removed FIXME (fields were presents) and fixed
13713         versioncompat declaration.
13714
13715 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13716
13717         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
13718         not closed, so don't cleanup when it happens.
13719
13720 2005-04-13  Chris Toshok  <toshok@ximian.com>
13721
13722         * mono-debug-debugger.h: change prototype for
13723         mono_debugger_lookup_type.
13724
13725         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
13726         this function, although it should probably be named
13727         mono_debugger_init_type.
13728
13729 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13730
13731         * threadpool.c: fix non-AIO case.
13732
13733 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
13734
13735         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
13736         the built-in profiler to measure just JIT compilation times.
13737
13738 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13739
13740         * threadpool.c: the epollfd might be closed by another thread at
13741         any time, so ignore EBADF at treat it as a "we're closing" sign.
13742
13743 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13744
13745         * threadpool.c: release the semaphores with a count equals to the number
13746         of working threads in both IO and regular pools. Fixed typo that messed
13747         up the count of IO pool threads. Don't initialize the pipe handles if
13748         we're using epoll.
13749
13750 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13751
13752         * threadpool.c: some systems don't like a NULL when deleting the socket
13753         from epoll.
13754
13755 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13756
13757         * threadpool.c: fix semaphore allocation.
13758
13759 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13760
13761         * threadpool.c: added epoll() based implementation for asynchronous IO
13762         that is used instead of the default poll() when available.
13763         It can be disabled by setting MONO_DISABLE_AIO.
13764
13765 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13766
13767         * threadpool.c: windows needs 'closesocket' and instead of returning
13768         0 when the stream is closed while in select, it returns -1. Fixes bug
13769         #74573.
13770
13771 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
13772
13773         * class.c (class_compute_field_layout): Fix the regression caused by
13774         the previous try.
13775
13776 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13777
13778         * threadpool.c: separate pool for socket async. IO.
13779         * threadpool.h: mono_max_worker_threads is not a global any more.
13780
13781 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
13782
13783         * class.c (class_compute_field_layout): Fix #74549.
13784
13785 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13786
13787         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
13788         use 2 connected sockets instead.
13789
13790 2005-04-08  Miguel de Icaza  <miguel@novell.com>
13791
13792         * mono-config.c: Add new entry point for mkbundle
13793         mono_config_parse_memory. 
13794
13795 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13796
13797         * threadpool.c: removed another unused function.
13798
13799 2005-04-08  Ankit Jain  <radical@corewars.org>
13800
13801         * reflection.c (get_default_param_value_blobs): Add 'types'
13802         parameter to get the types encoded in the constant table.
13803         (mono_param_get_objects): Use the type from the constant table,
13804         not the type of the parameter, when creating default values.
13805         Handle null default values correctly.
13806
13807 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13808
13809         * file-io.c:
13810         * file-io.h:
13811         * threadpool.c:
13812         * threadpool.h:
13813         * icall.c:
13814         * socket-io.c: removed dead code for async IO.
13815
13816 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13817
13818         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
13819
13820         * threadpool.c: intercept socket async. calls and pass them to a thread
13821         that is polling and dispatching the job items to the threadpool as
13822         socket become ready. Fixes bugs #71217, #71933.
13823
13824         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
13825         between char and short/ushort arrays.
13826
13827         * socket-io.c: remove dead code.
13828
13829 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
13830
13831         * locales.c,
13832           icall.c : removed InternalToUpper_Comp() and
13833           InternalToLower_Comp().
13834
13835 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
13836
13837         * char-conversions.h : The tables were incorrectly generated. Should
13838           be generated against invariant culture.
13839
13840 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
13841
13842         * object.c (mono_runtime_invoke_array): Fix return value when 
13843         passing pre-created valuetype objects to ctors.
13844
13845         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
13846         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
13847         Fixes #74338.
13848
13849 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
13850
13851         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
13852         only used with --security and hides the wrong corlib version error.
13853
13854 2005-03-30  Joshua Tauberer  <tauberer@for.net>
13855
13856         * class.c: Changed mono_class_name_from_token so that types
13857         outside of a namespace don't have an initial period.  Improved
13858         the g_warning message used in _mono_class_get when loading
13859         fails.
13860         * assembly.c: In mono_assembly_load_reference, when an assembly
13861         can't be found, "No such file or directory" is misleading and
13862         unhelpful because a few paths were checked for the presence of
13863         the assembly.  When that happens (ENOENT), display a nicer
13864         message indicating the directories that were searched.  In all
13865         cases, the warning is made easier to read for non-hackers.
13866
13867 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
13868
13869         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
13870         project/solution.
13871         * appdomain.h|domain.c: Removed inline from functions.
13872         * appdomain.c: Reduced warnings when compiling on windows.
13873         * icall.c: Fixed output_debug declaration to gunichar2*.
13874         * mono-config.c: Reduced warnings when compiling on windows.
13875         * rand.c: Added missing "windows.h". Added missing return value.
13876         * rawbuffer.c: Added missing winsock2.h for windows.
13877         * sysmath.h: Added mono-compiler.h header to allow/ease 
13878         compilation with non-GCC compilers.
13879         * threads.c: Fixed declarations to compile with VS.NET C compiler.
13880         Removed cast warnings.
13881
13882         Adapted from the work of J Lothian (for VC6).
13883
13884 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
13885
13886         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
13887         from default_path.
13888
13889 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
13890
13891         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
13892         the 2.0 profile.
13893
13894 2005-03-27  Raja R Harinath  <harinath@gmail.com>
13895
13896         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
13897         has to be in $(exec_prefix).  $(prefix) is for arch-independent
13898         stuff, and it would probably use $(prefix)/share rather than
13899         $(prefix)/lib.
13900
13901 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13902
13903         * console-io.c: added 2 includes that might be missing.
13904
13905 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
13906
13907         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
13908         profile.
13909
13910         * reflection.c (create_custom_attr): Allocate the params array using
13911         alloca so it gets GC tracking.
13912
13913 2005-03-23  Chris Toshok  <toshok@ximian.com>
13914
13915         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
13916         out some spew.
13917
13918 2005-03-24  Raja R Harinath  <rharinath@novell.com>
13919
13920         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
13921         changes to pick up any changes in prefix, etc.
13922
13923 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
13924
13925         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
13926         
13927         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
13928         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
13929
13930 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
13931
13932         * class-internals.h object-internals.h class.c reflection.c: Extend the
13933         mono_lookup_dynamic_token () function to return the class of the
13934         token as well. 
13935
13936         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
13937         well. Fixes #73848.
13938
13939 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
13940
13941         * security-manager.c: Skip inheritance checks for intra-corlib
13942         class inheritance and method overrides. This skips a lot of checks
13943         and (anyway) permissions cannot work until corlib is loaded.
13944
13945 2005-03-23  Martin Baulig  <martin@ximian.com>
13946
13947         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
13948         MONO_TYPE_GENERICINST.  
13949
13950 2005-03-23  Martin Baulig  <martin@ximian.com>
13951
13952         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
13953
13954 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
13955
13956         * class.c: added locking comments to some functions.
13957         Cache the interface offsets arrays (saves about 20 KB
13958         of runtime memory in a typical app).
13959         Reduce the time overhead in mono_class_setup_supertypes ().
13960
13961 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
13962
13963         * icall.c: speedup and fix leaks in GetMethodsByName and
13964         GetPropertiesByName.
13965
13966 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
13967
13968         * reflection.c: some locking fixes.
13969
13970 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
13971
13972         * metadata.c: added missing break in case statement.
13973
13974 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
13975
13976         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
13977         typedbyref return values. Fixes #73941.
13978
13979 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
13980
13981         * security-manager.c|h: Added demandunmanaged method and 
13982         suppressunmanagedcodesecurity class to MonoSecurityManager.
13983         Renamed aptc class to allowpartiallytrustedcallers.
13984
13985 2005-03-17  Martin Baulig  <martin@ximian.com>
13986
13987         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
13988
13989 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13990
13991         * file-io.c: disabled file async. IO using aio_*. It uses the
13992         threadpool now. Workaround for bug #73718.
13993
13994 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
13995
13996         * assembly.h, mono-config.c: added code to deal with bundled configs
13997         for bundled assemblies.
13998
13999 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
14000
14001         * *.c, private.h: cleanup, removing old private.h header file.
14002
14003 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
14004
14005         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
14006         and throw_on_unmappable_char attributes.
14007
14008 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
14009
14010         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
14011         _ProcessName_internal.
14012
14013 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
14014
14015         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
14016         #73631.
14017
14018         * icall.c threads.c threads-types.h: Remove slothash icalls as they
14019         are no longer used.
14020
14021 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
14022
14023         * object.c (compute_class_bitmap): Add support for generics. Fixes
14024         #73527.
14025
14026 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
14027
14028         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
14029
14030 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14031
14032         * filewatcher.c: commented out the code for windows watcher, as we don't
14033         use it (we use the managed implementation instead).
14034
14035 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
14036
14037         * object-internals.h (MonoThread): Remove 'unused1' field.
14038
14039         * appdomain.c: Bump corlib version.
14040
14041         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
14042
14043         * reflection.c (mono_reflection_create_runtime_class): Remove the
14044         AssemblyBuilder.Save optimization since it causes too many problems.
14045
14046 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
14047
14048         * exception.c|h: Added mono_get_exception_reflection_type_load to
14049         create a ReflectionTypeLoadException object.
14050         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
14051         to return NULL is a InheritanceDemand fails during reflection. Updated
14052         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
14053         ReflectionTypeLoadException if an InheritanceDemand fails during 
14054         reflection. Added icall mapping for GetLinkDemandSecurity.
14055         * security-manager.c|h: Added ves_icall_System_Security_
14056         SecurityManager_GetLinkDemandSecurity internal call to return the
14057         class and methods permissions set for a LinkDemand. Removed unused
14058         fields in MonoSecurityManager.
14059
14060 2005-03-10  Martin Baulig  <martin@ximian.com>
14061
14062         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
14063         it's a generic instance.
14064
14065 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
14066
14067         * reflection.c (mono_get_object_from_blob): Applied patch from
14068         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
14069
14070         * class.c (mono_class_is_assignable_from): Another try at fixing 
14071         #73469 without breaking anything.
14072
14073 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
14074
14075         * class.c: (mono_class_is_assignable_from): Revert the last changes
14076         since they don't work with generics.
14077         
14078         * class.c (mono_class_is_assignable_from): Fix build bustage.
14079
14080         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
14081         the managed IsAssignableFrom method. Fixes #73469.
14082
14083         * reflection.c (mono_reflection_call_is_assignable_from): New helper
14084         function.
14085
14086 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
14087
14088         * object.c (mono_load_remote_field_new): Fix returning uninitialized
14089         memory when the remoting callback does not sets the out arguments.
14090         Fixes #73007.
14091
14092         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
14093         by mistake.
14094
14095         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
14096
14097         * object-internals.h (MonoStackFrame): Sync with managed object layout.
14098
14099         * appdomain.c: Bump corlib version.
14100
14101 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
14102
14103         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
14104         function.
14105
14106         * threads.c (mono_thread_attach): Detect threads which are not started
14107         by the GC pthread wrappers.
14108
14109 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
14110
14111         * icall.c: Added new icall for RNG.
14112         * rand.c|h: Added new icall to open the RNG. This allows to share a 
14113         single handle on Linux to access /dev/urandom and fix #73183.
14114
14115 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
14116
14117         * object.c: setting the new vtable in a transparent proxy object must
14118         not change the GC descriptor.
14119
14120 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
14121
14122         * object.c: fixed compilation without GCJ support.
14123         * reflection.c: for runtime-created types ensure klass->has_references
14124         is correct (bug #73215).
14125
14126 2005-03-02  Martin Baulig  <martin@ximian.com>
14127
14128         * class.c (mono_class_is_assignable_from): Make this work if
14129         `oklass' is a generic instance; fixes #72831.
14130
14131 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
14132
14133         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
14134         with hasthis set.
14135         
14136         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
14137
14138         * marshal.c: Reorganize native->managed marshalling code to also use
14139         the emit_marshal_... functions.
14140
14141 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
14142
14143         * object.c: typed allocs have issues with bitmap sizes > 30,
14144         so check for max_set >= 30.
14145
14146 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
14147
14148         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
14149         managed code. Fixes #73012.
14150
14151         * metadata.h (MonoMarshalSpec): Add elem_mult field.
14152
14153         * metadata.c reflection.c: Load/Emit elem_mult as well.
14154         
14155         * metadata.h (MonoMarshalSpec): Add comment.
14156
14157         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
14158
14159         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
14160         num_elem to -1 if not given.
14161
14162         * object-internals.h (MonoReflectionMarshal): Add has_size field.
14163
14164         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
14165         given values.
14166
14167 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
14168
14169         * null-gc.c (mono_gc_free_fixed): Was not compilable.
14170
14171 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
14172
14173         * reflection.c (encode_marshal_blob): Encode param_num field as well.
14174
14175         * object-internals.h (MonoReflectionMarshal): Add param_num field.
14176
14177 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
14178
14179         * object.c: generalized the reference bitmap creation
14180         and added hooks for the new GC.
14181         * class-internals.c: removed the gc_bitmap field from MonoClass.
14182
14183 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
14184
14185         * domain.c: help the compiler to produce better code
14186         in mono_jit_info_table_find ().
14187
14188 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
14189
14190         * object.c: make all allocations look typed.
14191
14192 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
14193
14194         * socket-io.c: load Mono.Posix if it's not loaded already
14195         (fixes bug#73033).
14196
14197 2005-02-24  Martin Baulig  <martin@ximian.com>
14198
14199         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
14200         * reflection.c (dup_type): Likewise.
14201
14202 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
14203
14204         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
14205         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
14206
14207 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
14208
14209         * domain.c, threads.c, object-internals.h: make the critical thread
14210         local vars use the fast access mode (even when we're compiled in
14211         a lib). Provide accessors to be used by the jit during codegen.
14212
14213 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14214
14215         * appdomain.c: Changed hook functios behavior to include
14216         support for the reflection only assemblies. Some icalls were changed
14217         to support the mentioned assemblies too. Signatures of static methods
14218         try_assembly_resolve and real_load now have an additional parameter:
14219         refonly.
14220
14221         * assembly.c: General changes to mono_assembly_ methods to support
14222         reflection only api. Functions mono_assembly_open, mono_assembly_load,
14223         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
14224         suffix, to support an additional gbool parameter to specify whether
14225         the assembli is reflection only or not. Created some new hook functions 
14226         to add support for reflection only assemblies. Signatures of static 
14227         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
14228         have now an additional parameter: refonly.
14229
14230         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
14231         indicating whether the assembly is reflection only or not.
14232
14233         * exception.c: Add mono_get_exception_invalid_operation.
14234
14235         * icall.c: Throw an InvalidOperationException when trying to invoke
14236         a property/method/event, or trying to set/get the value of a field.
14237         Also add an icall to retrieve the ref_only flag to the
14238         MonoReflectionAssembly.
14239
14240 2005-02-23  Chris Toshok  <toshok@ximian.com>
14241
14242         Part of fix for #72827.
14243         * mono-debug.c (mono_debug_add_method): add lexical block data to
14244         the info we write.  Kind of a hack at the moment - we copy the
14245         lexical block info from the MonoDebugMethodInfo to the
14246         MonoDebugMethodJitInfo here, before writing it.
14247         (mono_debug_read_method): read the lexical block info.
14248
14249         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
14250
14251         * debug-mono-symfile.h: add lexical block support.
14252
14253         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
14254         support.
14255
14256 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
14257
14258         * loader.c (mono_lookup_pinvoke_call): Fix warning.
14259
14260         * object.c (mono_runtime_free_method): Call mono_free_method () and
14261         put the TODOs there.
14262
14263         * loader.c (mono_free_method): Free up most memory allocated for 
14264         dynamic methods.
14265
14266 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
14267
14268         * reflection.c: properly flag a Type argument to a
14269         named custom attr value (bug #72248).
14270
14271 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
14272
14273         * reflection.c: reduce code duplication in named custom
14274         attribute encoding.
14275
14276 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
14277
14278         * reflection.c: properly encode custom attrs of type object
14279         (bug #72649).
14280
14281 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
14282
14283         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
14284
14285 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
14286
14287         * socket-io.c: load System.dll if it's not loaded already
14288         (bug #72850 and #70477).
14289
14290 2005-02-21  Martin Baulig  <martin@ximian.com>
14291
14292         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
14293         generic instances.
14294
14295 2005-02-21  Martin Baulig  <martin@ximian.com>
14296
14297         * reflection.c (mono_image_build_metadata): We also need to
14298         "fixup" the MethodImpl table after we computed the final method
14299         indices.  Call fixup_methodimpl() to do that.
14300         (fixup_methodimpl): New private method.
14301
14302 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
14303
14304         * assembly.c: special case mscorlib.dll (bug#72536),
14305         patch from Carlos Alberto Cortez.
14306
14307 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
14308
14309         * threads-types.h threads.c: Fix build bustage.
14310
14311         * threads.c: Use a union for long<->double conversions.
14312
14313         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
14314         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
14315
14316         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
14317         containing the checkpoint call with NOT_TAKEN.
14318         
14319         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
14320         checkpoint before pushing the arguments, so they won't have to be
14321         spilled to stack.
14322
14323 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
14324
14325         * domain.c, assembly.c, domain-internals.h: make some data
14326         const and relocation-free.
14327
14328 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
14329
14330         * object.c, appdomain.c, class-internals.h: introduce the
14331         MonoClassRuntimeInfo structure to hold the info needed to
14332         use a class at runtime. Made mono_class_vtable() lock-free
14333         for all the appdomains.
14334
14335 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
14336
14337         * metadata-internals.h, image.c: introduce a per-image mempool to
14338         be used for memory that has the same lifetime as the image.
14339
14340 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
14341
14342         * domain.c: In mono_init_internal(), instead of selecting the first
14343         runtime version supported by an executable, get a list of all
14344         supported versions and select the one for which an mscorlib exists
14345         (since even if the runtime supports a given version, it doesn't mean
14346         that the framework for that version is installed).
14347         Modified get_runtimes_from_exe to support this behavior.
14348         In supported_runtimes, added information about additional system
14349         assembly versions.
14350         
14351         * assembly.c: Added support for more than one system assembly version
14352         per runtime version. Updated the assembly list.
14353         In mono_assembly_remap_version, removed the initial version check,
14354         since we don't know to which version we need to compare until we
14355         get the version set on which the assembly is based.
14356         Moved the code for loading corlib into the new method
14357         mono_assembly_load_corlib(), so it can be used by the initialization
14358         code.
14359         
14360         * domain-internals.h: Updated data structures and added declaration
14361         for mono_assembly_load_corlib.
14362
14363 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
14364
14365         * reflection.c (resolve_object): Fix the creation of the signature in 
14366         the SignatureHelper case.
14367
14368         * assembly.c (mono_assembly_remap_version): Fix binary search.
14369         
14370 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
14371  
14372         * class.c: Added inheritance check when a method is overloaded (from a
14373         virtual method or when implementing an interface) and when a class is
14374         inherited. Added functions to set a failure for a class and to 
14375         retreive the exception from a failure.
14376         * class-internals.h: Added fields to MonoClass to keep the exception
14377         information status for inheritance (or other exceptions) to be thrown
14378         later (i.e. not at load time).
14379         * object.c: Throw the inheritance SecurityException when a type is to 
14380         be created with either class or method inheritance violations.
14381         * reflection.c|h: Fix when getting declsec from a class. Removed 
14382         unrequired code for class. Improved sanity in parameter naming.
14383         * security-manager.c|h: Added functions to check for class and method
14384         inheritance.
14385
14386 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
14387
14388         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
14389         and has_finalize in dynamic types as well.
14390
14391 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
14392
14393         * culture-info-table.h : fixed currency format for en-GB (and so on).
14394
14395 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
14396
14397         * gc.c: ensure the GC handles never have 0 as a value.
14398
14399 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
14400
14401         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
14402         a pointer to a struct to unmanaged code. Fixes #72625.
14403
14404 2005-02-16  Martin Baulig  <martin@ximian.com>
14405
14406         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
14407
14408 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
14409
14410         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
14411
14412 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
14413
14414         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
14415
14416         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
14417         UnmanagedFunctionPointerAttribute, use it for determining calling convention
14418         etc. Fixes #71471.
14419
14420         * reflection.c (mono_custom_attrs_get_attr): New helper function.
14421
14422         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
14423
14424 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
14425
14426         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
14427         changes to make the current context a field in MonoThread.
14428
14429 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
14430
14431         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
14432         the last change.
14433         
14434         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
14435         extracted from mono_marshal_get_native_wrapper.
14436
14437         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
14438         to create wrappers around native functions.
14439
14440         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
14441         delegates for arbitrary function pointers. Fixes #71472.
14442
14443 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
14444
14445         * threads.c: cleaned up the code a little.
14446
14447 2005-02-15  Martin Baulig  <martin@ximian.com>
14448
14449         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
14450         the data table.
14451
14452         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
14453         allocate larger chunks if needed.
14454
14455 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
14456
14457         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
14458         in by mistake.
14459
14460 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
14461
14462         * domain.c: keep the domains in an array and ensure the domain ids
14463         are kept small, so they can be used as indexes to domain-specific data
14464         with a small memory overhead.
14465
14466 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
14467
14468         * icall.c: Handle byref types in Type icalls. Fixes #72544.
14469
14470 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
14471
14472         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
14473
14474 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
14475
14476         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
14477
14478         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
14479         values.
14480
14481         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
14482         
14483 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
14484
14485         * domain-internals.h: add the hashtable here.
14486
14487         * class-internals.h: Remove `info' from MonoMethod
14488
14489         * domain.c: Add a new hashtable, jit_trampoline_hash
14490
14491 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
14492
14493         * object.c: don't set the value of static fields
14494         (fixes bug#72494).
14495
14496 2005-02-11  Martin Baulig  <martin@ximian.com>
14497
14498         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
14499         (mono_debug_add_method): Silently ignore the method if it's too big.
14500         (mono_debug_add_type): Likewise.
14501
14502 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
14503
14504         * threads.c, appdomain.c: remove #ifdefs from the code.
14505
14506 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
14507
14508         * metadata-internals.h: Added flags to MonoAssembly to cache the most
14509         common security informations. This allows us to stay in unmanaged code
14510         when doing LinkDemand and it's special cases (except for the first 
14511         time for initialization). The flags a very much used with --security.
14512         * reflection.c|h: Added code to get declarative security attributes 
14513         for LinkDemand and InheritanceDemand. This required to refactor the
14514         existing code for Demand.
14515         * security-manager.c|h: Added new method fields for the special cases
14516         of LinkDemand.
14517
14518 2005-02-10  Martin Baulig  <martin@ximian.com>
14519
14520         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
14521         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
14522
14523 2005-02-10  Martin Baulig  <martin@ximian.com>
14524
14525         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
14526         debugging code; this is almost a complete rewrite.
14527
14528         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
14529
14530 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
14531
14532         * domain.c, object.h: expose mono_string_equal () and 
14533         mono_string_hash ().
14534         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
14535         it's implemented in managed code.
14536
14537 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
14538
14539         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
14540         lo leak objects between appdomains.
14541
14542 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
14543
14544         * assembly.c: old compilers compilation fix from 
14545         robertj@gmx.net (Robert Jordan).
14546
14547 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
14548
14549         * class-internals.h: Little reminder for the future.
14550
14551         * debug-helpers.c: Fix up wrapper_type_names
14552
14553 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
14554
14555         * image.c, metadata-internals.h: when loading an image from a file,
14556         mmap all of it and use the same codepaths as when using a
14557         in-memory image: the code is simpler and we use less memory
14558         (both writable and readonly).
14559
14560 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
14561
14562         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
14563         API to alloc runtime data structures that need to be tracked by the
14564         GC and contain pointers.
14565         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
14566         make the code more readable and eventually use a different GC.
14567
14568 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
14569
14570         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
14571         for out arguments.
14572         
14573 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
14574
14575         * object.c: In release_type_locks(), don't release the cctor lock
14576         if it has already been released. This fixes a crash in the
14577         thread5 test.
14578
14579 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
14580
14581         * gc.c, marshal.c, icall.c: register a delegate for finalization
14582         only when the native function pointer has been allocated for it.
14583
14584 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
14585
14586         * object.c: cleaned up some code, allocate objects that are
14587         pointer free with the atomic malloc variant. Allocate memory
14588         for static data from the mempool if it's pointer-free.
14589         Allocate the bounds array at the end of the array data, when needed.
14590         * object-internals.h, object.h: move a private function in a private
14591         header.
14592         * class.c: handle missing case in tracking references in fields.
14593
14594 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
14595
14596         * class.c, class-internals.h: keep track if a type has
14597         reference fields in either the instance or static fields.
14598
14599 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
14600
14601         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
14602         and renamed to MonoRuntimeInfo. Added fields to store the expected
14603         framework assembly version. Changed mono_get_framework_version and
14604         mono_get_runtime_version for a single mono_get_runtime_info method.
14605         
14606         * assembly.c: Added method to remap system assembly versions to the
14607         current executing runtime version. Removed old mapping code.
14608         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
14609         
14610         * icall.c, reflection.c: Track api changes.
14611
14612 2005-02-06  Miguel de Icaza  <miguel@novell.com>
14613
14614         * loader.c (method_from_memberref): Improve error reporting,
14615         produce the class name instead of the typeref/typedef index. 
14616
14617 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
14618
14619         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
14620
14621 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
14622
14623         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
14624         stdcall and charset name mangling.  Reorganize the code and add
14625         some tracing stuff.
14626
14627 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
14628
14629         * monodiet.c: More iters!
14630
14631         * marshal.c: Iter usage.
14632
14633         * icall.c: Iter usage.
14634
14635         * object.c: Use iters.
14636
14637         * debug-helpers.c: More iters
14638
14639 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
14640
14641         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
14642         under win32.
14643
14644 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
14645
14646         * mono-debug-debugger.c: use iters
14647
14648         * class.c, class-internals.h: mono_class_setup_events is static
14649         now
14650
14651         * All callers: use iters
14652
14653 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
14654
14655         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
14656         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
14657
14658 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
14659
14660         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
14661
14662         * marshal.h: Add prototypes for ldfld/stfld_remote.
14663
14664         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
14665         this is called during startup.
14666         
14667 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
14668
14669         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
14670         MonoThreadsSync struct private in monitor.c. Changed the way
14671         MonoThreadsSync is allocated so it's faster and there is no
14672         need to keep track of it with a finalizer and it uses less memory.
14673         This also finally allows us to allocate mono objects as ptrfree when
14674         there are no reference fields.
14675
14676 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
14677
14678         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
14679         disappearing link to the GC interface and use them to simplify
14680         the gchandles code.
14681
14682 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
14683
14684         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
14685         stfld_remote which call mono_load/store_field_new. This allows methods
14686         calling ldfld/stfld wrappers to be AOTed.
14687
14688         * console-io.c: Include sys/filio.h under solaris.
14689         
14690         * console-io.c: Include curses.h if needed correctly.
14691
14692 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
14693         
14694         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
14695         method->klass as well.
14696
14697         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
14698
14699         * class.c (mono_class_init): Switch on lazy initialization of 
14700         methods.
14701
14702         * class.c (mono_class_get_finalizer): Handle the case when the 
14703         finalizer is inherited.
14704
14705 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14706
14707         * console-io.c: <curses.h> is needed by term.h on solaris.
14708
14709 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
14710
14711         * icall.c, class-internals.h, monodiet.c, class.c: Remove
14712         mono_class_setup_properties where possible. Remove this ftn from
14713         the header file, and make it static.
14714
14715 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
14716
14717         * loader.c: Add missing setup_... call.
14718
14719         * class.c: Add missing setup_... calls.
14720
14721         * class.c (mono_class_init): Switch on lazy initialization of 
14722         the generic vtable.
14723         
14724         * class.c (mono_class_init): Fix generics broken by the recent changes.
14725
14726         * monodiet.c (handle_type): Add missing setup_... calls.
14727
14728         * class.c: Back out garbage in previous patch.
14729         
14730         * class.c: Add missing setup_... calls.
14731
14732         * class.c (mono_class_get_method_from_name_flags): Avoid calling
14733         mono_class_setup_methods () if possible.
14734
14735         * class-internals.h (MonoClass): Add 'has_cctor' flag.
14736
14737         * class-internals.h (MonoCachedClassInfo): New structure.
14738
14739         * class.c: Initialize properties and events fields of MonoClass lazily.
14740
14741         * class.c: Add infrastructure for lazily initializing the methods and
14742         vtable fields of MonoClass. Not yet used.
14743
14744         * class.c (mono_class_get_finalizer): New helper function.
14745
14746         * class.c: Add infrastructure for loading some class related data from
14747         an AOT file.
14748
14749         * object.c: Add infrastructure for initializing the vtable from data
14750         in the AOT file.
14751
14752         * gc.c (run_finalize): Use mono_class_get_finalizer ().
14753
14754         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
14755         appropriate initialization function before accessing parts of the
14756         MonoClass structure.
14757
14758         * marshal.c: Fix warnings.
14759         
14760         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
14761
14762         * mono-debug-debugger.c (get_exception_message): Use 
14763         mono_class_get_method_from_name_flags ().
14764
14765 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
14766
14767         * reflection.c, appdomain.c: Replace a few manual searches that
14768         Zoltan missed. (Paolo approved this part of my initial patch).
14769
14770 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
14771
14772         * profiler.c: disable recording statistical events at report time.
14773
14774 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
14775
14776         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
14777         to byteswap arrays of enum values, too (bug #72080).
14778
14779 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
14780
14781         * appdomain.c (set_domain_search_path): Allow this to be called if
14782         domain->setup is not yet set.
14783
14784         * loader.c (mono_method_get_index): New helper function.
14785
14786         * loader.c reflection.c: Use mono_method_get_index ().
14787
14788         * class.c (mono_class_get_method_from_name_flags): New helper method.
14789
14790         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
14791         this.
14792
14793         * class.c (mono_class_get_cctor): New helper method.
14794
14795         * string-icalls.c object.c class.c marshal.c reflection.c: Use
14796         mono_class_get_method () to look up methods.
14797
14798 2005-02-01  Miguel de Icaza  <miguel@novell.com>
14799
14800         * console-io.c: Fix the build, this should work on Windows.
14801
14802 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
14803
14804         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
14805         be set to null to keep things valid
14806
14807 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14808
14809         * icall.c: added Console 2.0 icalls.
14810         * Makefile.am: added console-io.[ch]
14811         * console-io.[ch]: internal calls for Console 2.0 API.
14812
14813 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
14814
14815         * class.c: make sure we consider all the interfaces
14816         when calculating max_interface_id (bug found by
14817         Jeroen Frijters running ikvm).
14818
14819 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
14820
14821         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
14822         valuetype fields to null.
14823
14824         * object.c (set_value): Ditto. Fixes #71669.    
14825
14826 2005-01-31  Martin Baulig  <martin@ximian.com>
14827
14828         * metadata.c (mono_metadata_has_generic_params): New public
14829         function; checks whether something is a generic method.
14830
14831 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
14832
14833         * appdomain.c: fix infinite recursion when adding assemblies.
14834
14835 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
14836
14837         * object.c: Fix small typo to return all items for Environment.
14838         GetCommandLineArgs.
14839
14840 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
14841
14842         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
14843         reflection.c: more domain and assembly-unload related fixes
14844         and memory leaks plugs.
14845
14846 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
14847
14848         * 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.
14849
14850 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
14851
14852         * loader.c (mono_method_signature): Make this method lazy
14853         (mono_get_method_from_token): Don't computate the signature here.
14854
14855         Doing this saves quite a bit of memory. I got 90 kb on starting up
14856         monodoc. It should also save some disk reads on startup.
14857
14858         * *: MonoMethod->signature might be NULL now. You *MUST* use
14859         mono_method_signature.
14860
14861 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
14862
14863         * object.c (mono_runtime_get_main_args): Return an array from the
14864         current domain here. Fixes #71938.
14865
14866 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
14867
14868         * monitor.c: formatting changes to comply with the
14869         mono coding style and remove #ifdefs from the code.
14870
14871 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
14872
14873         * metadata.c, private.h: remove some unneeded data
14874         and use a more compact representation for table schemas.
14875
14876 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
14877
14878         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
14879         to get a better distribution in hash tables.
14880         * *.c: use mono_aligned_addr_hash() where appropriate.
14881         * assembly.c: make var static.
14882
14883 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
14884
14885         * domain-internals.h: Put MonoJitInfo on a diet.
14886
14887         * domain.c: Fix a warning.
14888
14889 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
14890
14891         * gc.c: rework the gc handles code to reuse handles
14892         when freed.
14893
14894 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
14895
14896         * domain.c: fixed long standing bug in mono_string_equal() which
14897         was brought to light with the ldstr changes.
14898
14899 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
14900
14901         * reflection.c: Remove warning by adding missing include for marshal.h
14902
14903 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
14904
14905         * domain.c, object.c: change the ldstr_table to hold
14906         MonoString* as keys: makes the runtime isinterned lookup
14907         faster and simplifies memory management.
14908
14909 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
14910  
14911         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
14912         possible to add imperative security checks before calling the icall.
14913         * reflection.c: Return security attributes on the original MonoMethod
14914         (and not the wrapped one). This fix permissions on icalls.
14915
14916 2005-01-25  Dick Porter  <dick@ximian.com>
14917
14918         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
14919         the check for mktime() support actually test the mktime() return
14920         value.  "Fixes" bug 71682, though the output is still different to
14921         MS.
14922
14923 2005-01-25  Martin Baulig  <martin@ximian.com>
14924
14925         * class.c (mono_class_is_assignable_from): Make this work for
14926         generic instances.
14927
14928 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
14929
14930         * marshal.c (mono_string_utf8_to_builder)
14931         (mono_string_builder_to_utf16): We might not have ownership of the
14932         string. In thise case, we need to create a new buffer.
14933
14934         * object-internals.h (mono_stringbuilder_capacity): sb->str might
14935         be null, in which case, use the default capacity.
14936
14937 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
14938
14939         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
14940         GC events to the profiler.
14941
14942 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
14943
14944         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
14945         if you don't want the GC to run.
14946
14947 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
14948
14949         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
14950         start providing a GC API and keeping different implementations in
14951         their own file.
14952         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
14953
14954 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
14955
14956         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
14957         mmap rather than allocating a huge buffer.
14958         (mono_debug_close_mono_symbol_file): Free the buffer allocated
14959         above.
14960
14961 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
14962
14963         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
14964         and CheckExecutionRights.
14965         * reflection.c|h: Keep the index of the declarative security to be 
14966         used, instead of the pointer, when AOT compiler is used. Also add 
14967         class initialization when requesting demands.
14968         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
14969         CheckExecutionRights. Both properties are now FALSE by default, and
14970         unmodifiable, unless the --security option is used.
14971
14972 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
14973
14974         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
14975         reflection.c: properly refcount images and assemblies, many leaks fixed.
14976
14977 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14978
14979         * threadpool.c: increase the timeout for threads in the thread pool to
14980         10s.  Fixes bug #67159.
14981
14982 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
14983
14984         * class-internals.h: Sun's compiler insists on explicit
14985         signed on bit fields to handle then correctly.
14986
14987 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
14990         Make the size of the array fit only the number of invalid path
14991         chars that we have.
14992
14993         * class.c (_mono_class_get): Improve the error reporting when a
14994         class referenced is not found, to assist debugging. 
14995
14996 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
14997
14998         * threads.c: fix off-by-one error.
14999         * domain.c: free data allocated in the domain.
15000
15001 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
15002
15003         * reflection.c (mono_method_body_get_object): Fill out exception info
15004         as well.
15005
15006         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
15007         structure.
15008         
15009 2005-01-19  Martin Baulig  <martin@ximian.com>
15010
15011         * loader.c (mono_get_method_constrained): Make this work again.
15012
15013 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
15014
15015         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
15016         guint16 to match the managed side.
15017
15018         * reflection.c (mono_reflection_body_get_object): Fill out local
15019         variables array.
15020
15021         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
15022         as well.
15023
15024         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
15025         'local_var_sig_token'.
15026
15027 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
15028
15029         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
15030         System.Drawing.
15031
15032         * reflection.c (mono_method_body_get_object): Handle abstract and
15033         runtime methods.
15034
15035 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
15036
15037         * marshal.c, loader.c, class-internals.h, reflection.c:
15038         store the emthod data for a wrapper in an array instead of a list.
15039
15040 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
15041
15042         * marshal.c: change the code to allocate memory more
15043         conservatively for method wrappers.
15044
15045 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
15046
15047         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
15048         fields from MonoClass to the marshal info structure where they belong.
15049
15050 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15051
15052         * class.c, object.c, class-internals.h, marshal.c: rearrange
15053         some fields and tweak some types to lower memory usage.
15054
15055 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
15056
15057         * threads.c (signal_thread_state_change): Handle the case when the
15058         target thread is the current thread.
15059
15060         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
15061
15062         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
15063         emit_ptr_to_object_conv. 
15064
15065         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
15066         marshalling. Fixes #71352.
15067
15068 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
15069
15070         * metadata.h, blob.h: move table enum to blob.h so it can be included
15071         in any header.
15072         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
15073         cut the size of MonoImage/MonoDynamicImage.
15074
15075 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
15076
15077         * profiler.c (mono_profiler_install_simple): Fix default arguments.
15078
15079 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
15080
15081         * reflection.c, reflection.h, icall.c: add a function to check
15082         if an attribute type is defined for a metadata object.
15083
15084 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
15085
15086         * object-internals.h: Added some needed fields from StringBuilder class.
15087         * marshal.c: Set the maxCapacity when creating a StringBuilder.
15088
15089 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
15090
15091         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
15092         threads before shutting down the runtime.
15093
15094         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
15095
15096 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
15097
15098         * object-internal.h, threads.c: implement stacksize and 
15099         parameterized thread start functionality (requires
15100         matching corlib). Marked broken code for later removal.
15101
15102 2005-01-12  Martin Baulig  <martin@ximian.com>
15103
15104         * class-internals.h (MonoGenericClass): Moved the `initialized'
15105         flag to MonoDynamicGenericClass, removed `init_pending'.
15106         (MonoGenericInst): Added `is_reference' flag.
15107
15108 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
15109
15110         * reflection.c (mono_image_create_pefile): Only set the pe_offset
15111         inside the MSDOS header. Fixes #71201.
15112
15113         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
15114         gc thread.
15115         (mono_domain_finalize): Ditto.
15116
15117 2005-01-12  Martin Baulig  <martin@ximian.com>
15118
15119         * class.c (mono_get_shared_generic_class): Use the cache for
15120         non-dynamic generic classes.
15121
15122         * class-internals.h (mono_class_create_generic_2): Removed
15123         function prototype, this function is now static inside class.c.
15124
15125         * class.c (mono_class_create_generic_2): Made this static, only
15126         call it from mono_class_init() and mono_class_setup_parent().
15127         (collect_implemented_interfaces_aux): Call mono_class_init() on
15128         the interfaces we collect.
15129         (mono_class_setup_vtable): Call mono_class_init (class->parent).
15130
15131 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
15132
15133         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
15134         it a real thread handle.
15135
15136         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
15137         MonoJitExceptionInfo, since each catch clause needs its own variable.
15138         
15139 2005-01-11  Dick Porter  <dick@ximian.com>
15140
15141         * image.c (mono_pe_file_open): New variant on mono_image_open()
15142         that does not set up the CLI metadata; used for FileVersionInfo so
15143         it can get the data for windows binaries too.
15144         
15145         * process.c (process_read_string_block): Don't read off the end of
15146         the StringTable block.
15147
15148         These both fix bug 70766.
15149
15150 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
15151
15152         * gc.c: set some fields to NULL at GC cleanup time.
15153         * threads.c: if we quit the main thread, call exit ().
15154
15155 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
15156
15157         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
15158
15159 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
15160
15161         * threads.h, threads.c, object.c: added accessor and settor for
15162         main_thread. Handle it specially when exiting from it: wait
15163         for other foreground threads to exit.
15164
15165 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
15166
15167         * process.c, verify.c: remove some bloat.
15168
15169 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
15170
15171         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
15172         the calling convention to cdecl under win32.
15173
15174 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
15175
15176         * object.c (mono_object_get_size): New function to get the size of
15177         an object instance.
15178
15179         * profiler.c (simple_allocation): Use above.
15180
15181 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
15182
15183         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
15184         ves_icall_System_AppDomain_getRootDomain (as it's not required to
15185         get an appdomain by it's id and we can't assume the root's id is 0).
15186         * domain-internals.h: Change the function prototype to match.
15187         * icall.c: Change the icall table for AppDomain.
15188
15189 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
15190
15191         * locales.c (string_invariant_compare_char): Only compute
15192         GUnicodeTypes in the case where we need them.  Test for ordinality
15193         first and return if so.
15194
15195         From the commit:
15196
15197                 /*
15198                  * FIXME: here we must use the information from c1type and c2type
15199                  * to find out the proper collation, even on the InvariantCulture, the
15200                  * sorting is not done by computing the unicode values, but their
15201                  * actual sort order.
15202                  */
15203
15204 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
15205
15206         * loader.c: for P/Invoke methods, allow the "Internal" shared
15207         library name to refer to the calling process symbol namespace.
15208
15209 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
15210
15211         * Makefile.am: Add the security manager to the build.
15212         * security-manager.c|h: New. Initialization of the security manager.
15213
15214 2005-01-07  Dick Porter  <dick@ximian.com>
15215
15216         * threads.c: 
15217         * monitor.c: Update thread state during Monitor and WaitHandle
15218         waits.  Fixes bug 71031.
15219
15220 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
15221
15222         * reflection.c (property_encode_signature): Correctly handle when the
15223         property has no methods.
15224
15225 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
15226
15227         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
15228         
15229         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
15230         fields from mb, not rmb. Fixes #71017.
15231
15232         * marshal.c (emit_ptr_to_str_conv): Add support for 
15233         ByValTStr -> string conversion. Fixes #71015.
15234
15235         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
15236
15237         * mempool.c (mono_mempool_contains_addr): New helper function.
15238
15239 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
15240
15241         * metadata.c (mono_metadata_compute_size): Fix size calculation of
15242         HasSematics encoded fields.
15243         
15244         * metadata.c (mono_type_to_unmanaged): Improve error message for 
15245         invalid string marshalling.
15246
15247         * metadata.c: Fix warnings.
15248         
15249 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
15250
15251         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
15252         profiler support.
15253
15254 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
15255
15256         * domain.c object.c domain-internals.h: Revert part of r38077 since the
15257         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
15258         tests.
15259
15260 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
15261
15262         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
15263         so methods containing these can be AOTed.
15264
15265 2005-01-03  Martin Baulig  <martin@ximian.com>
15266
15267         * loader.c (find_method): Removed the hack for generic instances.
15268         (method_from_memberref): If our parent is a generic instance, pass
15269         its generic type definition to find_method() and then inflate the
15270         method.
15271         (mono_get_method_constrained): Pass the generic type definition to
15272         find_method() and inflate the method later.
15273
15274         * class-internals.h (MonoStats): Added `generic_class_count'.
15275
15276         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
15277         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
15278
15279         * reflection.c (mono_custom_attrs_from_params): Don't ignore
15280         generic type definitions.
15281
15282 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
15283
15284         * loader.c icall.c: Fix warnings.
15285
15286 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
15287
15288         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
15289         blittable types. Fixes #70864.
15290
15291 2004-12-29  Martin Baulig  <martin@ximian.com>
15292
15293         * icall.c
15294         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
15295
15296         * reflection.c (mono_method_get_object): Create a
15297         "System.Reflection.MonoGenericMethod" for inflated methods; don't
15298         call mono_get_inflated_method().
15299
15300         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
15301
15302 2004-12-27  Martin Baulig  <martin@ximian.com>
15303
15304         * class-internals.h (MonoMethod): Added `is_inflated' flag.
15305         (MonoMethodInflated): Added `inflated' field.
15306
15307         * class.c (mono_class_inflate_generic_method): Don't really
15308         inflate the method here; just set the `is_inflated' flag in the
15309         MonoMethod.
15310         (mono_class_get_inflated_method): Actually inflate the method here
15311         if it's not already inflated; we use the MonoMethodInflated's new
15312         `inflated' field as a cache.
15313
15314 2004-12-26  Martin Baulig  <martin@ximian.com>
15315
15316         * class.c
15317         (inflate_generic_class): Moved some code out of inflate_generic_type().
15318         (mono_class_inflate_generic_method): If we're already inflated,
15319         inflate the context and use the declaring method; ie. make sure
15320         the declaring method of an inflated method is always the generic
15321         method definition.
15322         (mono_class_create_from_typedef): Create
15323         `class->generic_container->context->gclass'.
15324
15325 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
15326
15327         * metadata-internals.h, marshal.c, reflection.c: More
15328         MonoGHashTable->GHashTable.
15329
15330         * domain-internals.h, class.c: Change MonoGHashTable's into
15331         GHashTables for some cases where no gc stuff is used
15332
15333         All users: update apis
15334
15335 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
15336
15337         * metadata.c (builtin_types): Make this `const'. Makes this get
15338         put into the shareable section.
15339         (mono_metadata_init): Casts to make gcc happy.
15340
15341 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
15342
15343         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
15344
15345 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
15346
15347         * icall.c: Added an internal call to retrieve the position and length
15348         of assembly-level declarative security attributes (RequestMinimum, 
15349         RequestOptional and RequestRefuse). This is used by the Assembly class
15350         to re-create the corresponding permission sets.
15351
15352 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
15353
15354         * marshal.c: fix the stelemref wrapper to be type correct
15355         (and faster).
15356
15357 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
15358
15359         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
15360         to do key & 0x7fffffff. Hashtable already does this. It just
15361         results in longer code.
15362
15363 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
15364
15365         * appdomain.c: Bump corlib version.
15366         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
15367         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
15368         * reflection.c|h: Add functions to get declarative security infos
15369         (blob position and length) for assemblies, classes and methods.
15370
15371 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
15372
15373         * reflection.c: sort the constant table (bug #70693).
15374
15375 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
15376
15377         * object-internals.h, threads.c, domain.c: add accessors for
15378         the MonoThread and MonoDomain tls keys.
15379
15380 2004-12-18  Martin Baulig  <martin@ximian.com>
15381
15382         * class.c (inflate_generic_type): If we're inflating a generic
15383         instance, set `ngclass->context->container = context->container';
15384         ie. the container we inflated into.
15385
15386         * metadata.c (mono_metadata_parse_generic_param): Reflect above
15387         inflate_generic_type() changes.
15388
15389 2004-12-17  Martin Baulig  <martin@ximian.com>
15390
15391         * class-internals.h
15392         (MonoGenericClass): Replaced `MonoType *generic_type' with
15393         `MonoClass *generic_class'.  Removed `dynamic_info'; if
15394         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
15395         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
15396
15397 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
15398
15399         * exception.c (mono_exception_from_token): New helper function.
15400
15401 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
15402
15403         * assembly.c (mono_assembly_load_with_partial_name): Call 
15404         mono_assembly_loaded before invoking the preload hooks. Fixes
15405         #70564.
15406
15407         * object-internals.h (MonoThread): Change culture_info and 
15408         ui_culture_info into an array.
15409
15410         * threads.c: Cache culture info objects from more than one appdomain.
15411
15412         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
15413         current UI culture.
15414
15415 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
15416
15417         * threads.h threads.c appdomain.c: Clear the culture_info field of
15418         all threads during unloading if they point to an object in the dying
15419         appdomain.
15420
15421 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
15422
15423         * culture-info.h (TextInfoEntry): New struct
15424         * object-internals.h: sync with managed
15425         * locales.c: fill the `text_info_data' field
15426         * culture-info-tables.h: update
15427
15428 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
15429
15430         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
15431         collector.
15432
15433 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
15434
15435         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
15436         (ves_icall_ModuleBuilder_getMethodToken): Ditto
15437
15438 2004-12-12  Martin Baulig  <martin@ximian.com>
15439
15440         * mono-debug-debugger.c (write_type): If we're an enum and the
15441         builtin types have already been initialized, call mono_class_init().
15442
15443 2004-12-11  Martin Baulig  <martin@ximian.com>
15444
15445         * metadata.c (mono_metadata_load_generic_params): Added
15446         `MonoGenericContainer *parent_container' argument; automatically
15447         compute `container->is_method'; pass the correct owner to
15448         get_constraints().      
15449
15450         * reflection.c (compare_genericparam): Sort the GenericParam table
15451         according to increasing owners. 
15452
15453 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
15454
15455         * profiler.c: allow disabling the default profiler.
15456
15457 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
15458
15459         * decimal.c, icall.c: allow disabling System.Decimal support.
15460
15461 2004-12-09  Marek Safar <marek.safar@seznam.cz>
15462
15463         * reflection.c: Add support for null attribute arguments.
15464
15465 2004-12-09  Martin Baulig  <martin@ximian.com>
15466
15467         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
15468         names to get rid of compiler warnings.
15469
15470 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
15471
15472         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
15473         mono_marshal_load_type_info (). Fixes #69625.
15474         (mono_marshal_get_ptr_to_struct): Likewise.
15475
15476 2004-12-08  Martin Baulig  <martin@ximian.com>
15477
15478         * mono-debug.h: Bumped version number to 47.
15479
15480         * mono-debug-debugger.c
15481         (mono_debugger_event_handler, mono_debugger_event): Take two
15482         guint64 arguments insteed of a gpointer and a guint32.  
15483
15484 2004-12-08  Martin Baulig  <martin@ximian.com>
15485
15486         * debug-mono-symfile.h
15487         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
15488         `address' to `native_offset'.
15489
15490 2004-12-08  Martin Baulig  <martin@ximian.com>
15491
15492         * class.c (mono_class_create_from_typespec): Only inflate if we
15493         either have `context->gclass' or `context->gmethod'.
15494
15495 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
15496
15497         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
15498
15499         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
15500
15501         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
15502
15503         * reflection.c (mono_assembly_get_object): Remove the workaround put
15504         in for the release.
15505         
15506         * appdomain.c: Use the corlib_internal field from MonoAssembly.
15507
15508         * appdomain.c: Bump corlib version.
15509
15510         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
15511         be visible in other appdomains.
15512
15513 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
15514
15515         * threads.c: Interlocked inc and dec for longs were messed up,
15516         use a KISS based impl for this. Fixes 70234
15517
15518 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
15519
15520         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
15521
15522 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
15523
15524         * icall.c: fix to follow policy not to allow struct
15525         arguments in icalls.
15526
15527 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15528
15529         * process.c: make the patch that handles spaces in file paths work
15530         on mono/windows too.
15531
15532 2004-12-06  Martin Baulig  <martin@ximian.com>
15533
15534         * class.c (mono_class_create_generic): Call
15535         mono_class_setup_supertypes() if we're dynamic.
15536         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
15537
15538 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
15539
15540         * object-internals.h: Add new fields to MonoThread.
15541
15542         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15543
15544         * icall.c threads-types.h threads.c: Add new icalls.
15545
15546         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
15547
15548         * object-internals.h (MonoReflectionAssembly): Sync object layout with
15549         managed side.
15550
15551         * appdomain.c: Bump corlib version.
15552
15553         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
15554         internal assemblies. Fixes #69181.
15555
15556 2004-12-05  Martin Baulig  <martin@ximian.com>
15557
15558         * class.c (mono_class_inflate_generic_signature): Make this a
15559         no-op if `context' is NULL or we don't have any type parameters;
15560         also copy `sentinelpos'.        
15561
15562 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
15563
15564         * image.c: Add unbox_wrapper_cache.
15565
15566         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
15567
15568         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
15569         function generator.
15570         
15571         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
15572         Fixes #70173.
15573
15574         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
15575         
15576 2004-12-04  Martin Baulig  <martin@ximian.com>
15577
15578         * loader.c (mono_method_get_signature_full): New public function;
15579         like mono_method_get_signature(), but with an additional
15580         `MonoGenericContext *' argument.
15581
15582         * class.c (mono_class_inflate_generic_signature): Formerly known
15583         as inflate_generic_signature(); make this public.
15584
15585 2004-12-04  Martin Baulig  <martin@ximian.com>
15586
15587         * metadata.c
15588         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
15589         instead of a `MonoGenericContainer *'.  
15590         (mono_metadata_parse_array_full): Likewise.
15591         (mono_metadata_parse_signature_full): Likewise.
15592         (mono_metadata_parse_method_signature_full): Likewise.
15593         (mono_metadata_parse_generic_inst): Likewise.
15594         (mono_metadata_parse_generic_param): Likewise.
15595         (mono_metadata_parse_mh_full): Likewise.
15596         (mono_type_create_from_typespec_full): Likewise.
15597
15598 2004-12-03  Martin Baulig  <martin@ximian.com>
15599
15600         * class-internals.h (MonoGenericContainer): Replaced the
15601         `MonoGenericContext * pointer with a `MonoGenericContext'
15602         structure and made it the first element.
15603
15604 2004-12-03  Martin Baulig  <martin@ximian.com>
15605
15606         * class.c
15607         (inflate_generic_type): Set the `context->container' when creating
15608         a new MonoGenericContext.
15609         (mono_class_inflate_generic_method): Likewise.
15610         (mono_class_create_from_typespec): Just use `context->container'
15611         to get the container.
15612
15613         * loader.c (method_from_methodspec): Set `context->parent' from
15614         `context->container' - and if that's a method container, use its
15615         parent.  Also set the `context->container' when creating a new
15616         MonoGenericContext.
15617         (mono_get_method_from_token): Use just `context->container' to get
15618         the container.
15619
15620         * metadata.c (do_mono_metadata_parse_generic_class): Also set
15621         `gclass->context->container'.
15622
15623         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
15624         the `context->container' when creating a new MonoGenericContext.
15625
15626 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
15627
15628         * reflection.c (compare_genericparam): Sort params with identical
15629         owner by their number. Fixes gen-111 on sparc.
15630
15631 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
15632
15633         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
15634         around the domain changes.
15635
15636         * appdomain.c (mono_domain_unload): Handle the case when the thread
15637         calling Unload is itself being aborted during unloading. Fixes #70022.
15638
15639         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
15640
15641         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
15642         checkpoint_func as an icall so it gets a wrapper.
15643         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
15644         in the cross-appdomain wrappers too.
15645
15646         * threads.c (mono_thread_has_appdomain_ref): Make this public.
15647
15648         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
15649
15650         * reflection.c: Fix some memory leaks.
15651         
15652 2004-12-02  Martin Baulig  <martin@ximian.com>
15653
15654         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
15655
15656         * metadata.c (generic_class_cache): New static hashtable.
15657         (mono_metadata_lookup_generic_class): New public method.
15658
15659 2004-12-02  Martin Baulig  <martin@ximian.com>
15660
15661         * class.c (mono_class_create_from_typedef): Call
15662         mono_class_setup_parent() and mono_class_create_mono_type() before
15663         parsing the interfaces.
15664
15665 2004-12-02  Martin Baulig  <martin@ximian.com>
15666
15667         * metadata.c (generic_inst_cache): New static hashtable.
15668         (mono_metadata_lookup_generic_inst): New public function.
15669         (mono_metadata_inflate_generic_inst): New public function.
15670         (mono_metadata_parse_generic_inst): New public function.
15671         (do_mono_metadata_parse_generic_class): Use the new
15672         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
15673         since this'll also use the cache.
15674
15675         * reflection.c (mono_reflection_bind_generic_method_parameters):
15676         Use mono_metadata_lookup_generic_inst() to use the new cache.
15677
15678         * class.c (inflate_mono_type): Use
15679         mono_metadata_inflate_generic_inst() to inflate a generic
15680         instance; this'll also use the new cache.
15681
15682         * loader.c (method_from_methodspec): Use
15683         mono_metadata_parse_generic_inst() and
15684         mono_metadata_inflate_generic_inst() rather than parsing it
15685         manually, so we can use the new cache.
15686
15687 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
15688
15689         * threads.c (wait_for_tids): Do not incorrectly free threads when 
15690         the wait times out.
15691
15692 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
15693
15694         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
15695         iter->args based on whether parameters are passed in registers (i.e.
15696         MONO_ARCH_REGPARMS is defined)
15697
15698 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
15699
15700         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
15701         the exception message. Fixes #70070.
15702         (method_from_methodspec): Fix warnings.
15703
15704 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15705
15706         * process.c: (complete_path) return the path quoted
15707
15708 2004-12-01  Martin Baulig  <martin@ximian.com>
15709
15710         * class-internals.h (MonoGenericInst): New structure.
15711         (MonoGenericClass): Replaced `type_argc', `type_argv' and
15712         `is_open' with `MonoGenericInst *inst'.
15713         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
15714         `is_open' with `MonoGenericInst *inst'.
15715
15716 2004-11-30  Martin Baulig  <martin@ximian.com>
15717
15718         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
15719
15720         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
15721         to `generic_class_cache'.
15722
15723         * metadata.c
15724         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
15725         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
15726         (mono_generic_inst_is_valuetype): Renamed to
15727         mono_generic_class_is_valuetype().
15728
15729         * class-internals.h
15730         (MonoGenericInst): Renamed to MonoGenericClass.
15731         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
15732         (MonoClass): Renamed `generic_inst' to `generic_class'.
15733         (MonoGenericContext): Renamed `ginst' to `gclass'.
15734
15735         * object-internals.h
15736         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
15737
15738         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
15739         mono_reflection_generic_class_initialize().
15740
15741         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
15742         now known as "System.Reflection.MonoGenericClass".
15743         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
15744
15745 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
15746
15747         * class-internals.h: Added a flag field to MonoClass to cache the
15748         declarative security attributes actions associated with the class.
15749         * domain-internals.h: Added booleans to MonoJitInfo to cache the
15750         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
15751         applicable to the JITted method.
15752         * reflection.c|h: Added functions to extract (as flags) which security
15753         actions are available (declaratively) for a method, class or assembly.
15754         * metadata.c|h: Added functions to search the declarative security
15755         table in the metadata.
15756         
15757 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
15758
15759         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
15760         EXPORTEDTYPES are already in the class name cache, so there is no
15761         need to add extra code here to look at them. Just removes a bit of
15762         cruft.
15763
15764         (ves_icall_System_Environment_get_TickCount): No need for #if
15765         WINDOWS. We already have the code in io-layer.
15766
15767 2004-11-28  Martin Baulig  <martin@ximian.com>
15768
15769         * loader.c
15770         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
15771         Fixes gen-112.cs.
15772
15773 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
15774
15775         * assembly.c (do_mono_assembly_open): Instead of having a
15776         conditional WITH_BUNDLE, incorporate support for bundles here, by
15777         having a global `bundles' variable holding a pointer to the actual
15778         bundles. 
15779
15780         (mono_register_bundled_assemblies): New API call used by the
15781         bundle code. 
15782
15783         See mkbundle.1 for details.
15784         
15785 2004-11-27  Martin Baulig  <martin@ximian.com>
15786
15787         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
15788         the vtable for generic methods.
15789
15790 2004-11-26  Martin Baulig  <martin@ximian.com>
15791
15792         * metadata.c
15793         (mono_metadata_generic_method_hash): New public function.
15794         (mono_metadata_generic_method_equal): Likewise.
15795
15796         * class-internals.h
15797         (MonoGenericContainer): Added `GHashTable *method_hash'.
15798
15799         * reflection.c (ReflectionMethodBuilder): Added
15800         `MonoGenericContainer *generic_container'.
15801         (reflection_methodbuilder_to_mono_method): Don't create a new
15802         MonoGenericContainer each time we're called.
15803         (mono_reflection_bind_generic_method_parameters): Use
15804         `container->method_hash' to cache the results so we don't create a
15805         different method if we're called several times with the same
15806         arguments.
15807
15808         * loader.c (method_from_methodspec): Use the new
15809         `container->method_hash' here, too.
15810
15811 2004-11-26  Martin Baulig  <martin@ximian.com>
15812
15813         * class.c (inflate_generic_signature): Correctly compute
15814         `res->has_type_parameters'.
15815         (mono_class_vtable): Use the `has_type_parameters' flag to
15816         determine whether we're a generic method.
15817
15818         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
15819
15820 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
15821
15822         * object.c (mono_runtime_run_main): Fix a small memory leak.
15823
15824 2004-11-25  Martin Baulig  <martin@ximian.com>
15825
15826         * class.c (set_generic_param_owner): Fixed the loop.
15827
15828 2004-11-25  Martin Baulig  <martin@ximian.com>
15829
15830         * object.c (mono_class_vtable): Don't create any JIT wrappers for
15831         generic methods.
15832
15833 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
15834
15835         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
15836         names. Fixes #69787.
15837
15838 2004-11-24  Martin Baulig  <martin@ximian.com>
15839
15840         * class.c (mono_class_create_generic_2): If we don't have a
15841         `ginst->parent', inflate `gklass->parent' to get our parent.
15842
15843 2004-11-24  Martin Baulig  <martin@ximian.com>
15844
15845         * reflection.c (compare_genericparam): Correctly sort the
15846         GenericParam table; fixes #69779.
15847
15848 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
15849
15850         * reflection.c: When writing a PE file, don't create a huge
15851         buffer in memory. Just write the arrays we have to the file.
15852         This reduces memory usage.
15853
15854         * metadata-internals.h: MonoDynamicStream pefile is no longer used
15855         globally.
15856
15857 2004-11-17  Martin Baulig  <martin@ximian.com>
15858
15859         * class.c (mono_class_init): Don't setup `class->parent' for
15860         dynamic instances; moved this to mono_class_generic_2().
15861         (mono_class_create_generic): Also set `klass->inited' for dynamic
15862         generic instances.
15863         (mono_class_create_generic_2): Don't do anything for dynamic
15864         generic instances.  Set `klass->parent' here and also call
15865         mono_class_setup_parent() here. 
15866
15867         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
15868         `MonoType *parent' argument; set `ginst->parent' before calling
15869         mono_class_create_generic_2(), so we set the correct parent.
15870
15871 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
15872
15873         * reflection.c: allow getting attributes from ModuleBuilder
15874         (used by ikvm).
15875
15876 2004-11-17  Martin Baulig  <martin@ximian.com>
15877
15878         * class.c (mono_class_create_from_typedef): If a type parameter is
15879         inherited from an outer class, set its owner to that class.
15880
15881 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
15882
15883         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
15884           for (int*) written size. This fixes bug #69592.
15885
15886 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
15887
15888         * icall.c: Added IsAuthenticodePresnet internal call.
15889         * image.c|h: New function that check a MonoImage for an Authenticode
15890         signature in the certificate PE data directory.
15891         * security.c|h: New internal call to ask the runtime if an 
15892         Authenticode signature seems referenced in the PE header.
15893
15894 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
15895
15896         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
15897
15898         * reflection.c (mono_image_create_pefile): Free the assembly streams
15899         after writing out the assembly file.
15900
15901         * object.c (mono_runtime_run_main): Fix small memory leak.
15902
15903         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
15904         property access modifiers. Fixes #69389.
15905
15906 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
15907
15908         * domain.c, object.c, object-internals.h, domain-internals.h,
15909         object.h, marshal.c: keep dynamic code info per domain.
15910
15911 2004-11-15  Martin Baulig  <martin@ximian.com>
15912
15913         * class.c (mono_type_get_name_recurse): Put type arguments in
15914         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
15915         see bug #68387.
15916
15917 2004-11-15  Martin Baulig  <martin@ximian.com>
15918
15919         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
15920         (mono_class_setup_vtable): When computing `the_cname' for a
15921         generic instance, don't include the namespace since we'd otherwise
15922         add it twice.
15923
15924 2004-11-15  Martin Baulig  <martin@ximian.com>
15925
15926         * class.c (mono_class_create_generic): Changed return type to void.
15927         (mono_class_create_generic_2): New public function; setup
15928         `class->method', `class->field' and `class->interfaces' here
15929         instead of in mono_class_init().
15930
15931         * class.h (mono_class_create_generic): Moved to class-internals.h.
15932
15933 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
15934
15935         * reflection.c (mono_image_create_pefile): take a file HANDLE.
15936         rather than writing to memory, write to this file. Right now,
15937         we are just writting into a buffer, and copying that. However
15938         we can avoid the buffer later.
15939
15940         (mono_dynamic_stream_reset): new function
15941
15942         * icall.c, object-internals.h: update for the above.
15943
15944 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
15945
15946         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
15947         have been using gc'd memory. First it is slower, unlikely
15948         the comment in the source code said, secondly, it increases
15949         our footprint to do it in the gc.
15950
15951         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
15952         the method so that it does not have to copy to managed code.
15953
15954 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
15955
15956         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
15957
15958 2004-11-12  Martin Baulig  <martin@localhost>
15959
15960         * reflection.c (mono_image_create_token): Allow generic method
15961         definitions here, since they may appear in an `.override'; see
15962         gen-98/gen-99 for an example.
15963
15964 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
15965
15966         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
15967         #69365.
15968
15969         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
15970         descriptive.
15971
15972 2004-11-11  Martin Baulig  <martin@ximian.com>
15973
15974         * class.c (mono_class_setup_vtable): In an explicit interface
15975         implementation, the method name now includes the arity.
15976
15977 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
15978
15979         * object.c (mono_array_full_copy): Fix warning.
15980
15981 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
15982
15983         * appdomain.c: Removed look_for_method_by_name(). Use the new method
15984         mono_class_get_method_from_name() instead.
15985         
15986         * class-internals.h: Added two new types of wrappers. 
15987         Added MonoRemotingTarget enum. Added new trampoline function type, which
15988         takes an additional MonoRemotingTarget value as parameter, so it is
15989         possible to request a trampoline for a specific target.
15990         
15991         * class.c: Added new mono_class_get_method_from_name() method.
15992         
15993         * class.h: In MonoRemoteClass, we can have now to vtables, one for
15994         general remoting sinks and one specific for cross domain calls.
15995         
15996         * debug-helpers.c: Added new wrapper names.
15997         
15998         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
15999         of a remote class.
16000         
16001         * image.c: Porperly delete value objects form the remoting invoke hashtable.
16002         
16003         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
16004         with several other methods (mono_marshal_get_xappdomain_dispatch,
16005         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
16006         and others) can generate a fast remoting wrapper for cross domain calls.
16007         More information can be found in docs/remoting.
16008         Other changes: Removed mono_find_method_by_name, and used
16009         mono_class_get_method_from_name instead.
16010         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
16011         is stored in the remoting invoke hashtable.
16012         
16013         * marshal.h: published the new method for getting the xdomain wrapper,
16014         and also added a method for getting the adequate wrapper for a given
16015         method and target.
16016         
16017         * object-internals.h, object.c: Added a couple of methods for capying and
16018         cloning arrays.
16019         Modified mono_install_remoting_trampoline, which takes the new remoting
16020         trampoline that has a remoting target as parameter.
16021         mono_class_proxy_vtable now also takes a remoting target as parameter, and
16022         will return the most suitable vtable for the target.
16023         Added mono_remote_class_vtable, which returns the vtable of a remote class
16024         (which can be the normal remoting vtable or the xdomain vtable).
16025         
16026         * threads.c: the xdomain invoke and dispatch wrappers must also be
16027         protected against interruptions.
16028
16029 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16030
16031         * icall.c: use memmove in BlockCopyInternal when the source and
16032         destination arrays are the same.
16033
16034 2004-11-09  Martin Baulig  <martin@ximian.com>
16035
16036         * class-internals.h (MonoGenericContainer): Removed `method' and
16037         `signature', replaced them with `is_method' and `is_signature'
16038         flags.  Added `context'.
16039
16040         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
16041         instead of a `MonoGenericContainer *'.
16042
16043         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
16044         for dynamic type parameters.
16045         (mono_metadata_load_generic_params): Setup `container->context'.
16046
16047         * reflection.c (mono_reflection_setup_generic_class): Setup
16048         `tb->generic_container->context'.
16049         (do_mono_reflection_bind_generic_parameters): Use
16050         mono_class_inflate_generic_type() to correctly inflate types,
16051         rather than using our own hack just for MONO_TYPE_VAR.
16052
16053 2004-11-09  Martin Baulig  <martin@ximian.com>
16054
16055         * class.c (mono_class_inflate_generic_method): Small fix; don't
16056         crash here.
16057
16058         * icall.c
16059         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
16060         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
16061         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
16062         (ves_icall_Type_BindGenericParameters): Likewise.
16063         (ves_icall_Type_get_IsGenericInstance): Likewise.
16064         (ves_icall_Type_GetGenericParameterPosition): Likewise.
16065         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
16066         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
16067         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
16068
16069 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
16070
16071         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
16072         assembly versions and public key tokens. Fixes #69113.
16073
16074 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
16075
16076         * metadata.c: fix bug introduced with the type cache changes
16077         on 2004-11-06.
16078
16079 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
16080
16081         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
16082         the MonoClass pointer instead of the token in exception clauses.
16083         * reflection.c: updates for the above and make the code not depend
16084         on the structure of MonoExceptionClause.
16085
16086 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
16087
16088         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
16089         Add support for dynamic assemblies. Fixes #69114.
16090
16091         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
16092
16093 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
16094
16095         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
16096         since most only those methods use it. the code member of
16097         MonoMethodPInvoke was dead, so that can be removed too. Also,
16098         remove inline_count (again, not used), and move slot so that it
16099         can share bits with some other flags. This saves 8 bytes in the
16100         structure and gives us about 50 kb back for mcs helloworld.cs
16101
16102         * *.[ch]: Do naming changes for the above.
16103
16104         * loader.c (mono_method_get_header): Lazily init the header
16105         on first access.
16106         (mono_get_method_from_token): don't init the header here
16107         (mono_free_method): the header may never be allocated
16108
16109         Overall, this saves 150 kb of unmanaged allocations
16110         for mcs helloworld.cs. That accounts for 10% of the unmanaged
16111         memory at runtime.
16112         
16113         * loader.c, loader.h (mono_method_get_header): new accessor.
16114
16115         * *.[ch]: use the above method. Prepares us to lazily load
16116         the header.
16117
16118         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
16119         three warnings, which are actual bugs (see 69206).
16120
16121         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
16122         unused. Saves a cool 4 bytes / method.
16123
16124 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
16125
16126         * metadata.c (builtin_types): Add types for System.Object here.
16127         (mono_metadata_parse_type_full): Cache MonoType*'s that are
16128         for a class or valuetype from klass->this_arg or klass->byval_arg.
16129
16130         On mcs for a hello world, this gets us down from 21836 MonoType's
16131         to 14560.
16132
16133         (mono_metadata_free_type): Account for the above change.
16134
16135 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
16136
16137         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
16138         exception instead of asserting if name is null.
16139         (ves_icall_System_AppDomain_GetData): Ditto.
16140
16141 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
16142
16143         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
16144         EnumBuilder.
16145
16146         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
16147         Return NULL when the domain does not have entry_assembly set.
16148
16149         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
16150         Add a 'resource_modules' argument.
16151         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
16152
16153         * reflection.c (mono_reflection_create_runtime_class): Move setting
16154         of wastypebuilder here, so mono_get_type_object () returns a MonoType
16155         for enums too.
16156
16157         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
16158         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
16159         Throw an ArgumentNullException if 'ptr' is null.
16160
16161         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
16162         assemblies here. Fixes #69020.
16163
16164 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
16165
16166         * reflection.c (build_compressed_metadata): Fix the previous patch for
16167         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
16168         the stack.
16169
16170 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
16171
16172         * assembly.c (mono_assembly_names_equal): Allow a match if one of
16173         the cultures is false. Fixes #69090.
16174
16175         * reflection.c (build_compressed_metadata): Fix invalid memory read 
16176         detected by valgrind.
16177         
16178         * reflection.c (mono_reflection_get_type): Avoid triggering a 
16179         TypeResolve multiple times for the same type. Fixes #65577.
16180
16181 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
16182
16183         * marshal.c: Avoid using ldftn to call managed functions. It is
16184         much slower than just a call.
16185
16186         * reflection.c (mono_module_get_object): free the basename we
16187         allocate here from glib.
16188         
16189         * reflection.c (ensure_runtime_vtable): make sure to free
16190         overrides.  Also, we were allocating an array of MonoMethod not an
16191         array of MonoMethod*.
16192
16193         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
16194
16195         * image.c (mono_image_close): free image->guid here.
16196
16197 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
16198
16199         * reflection.c: Fix some spec conformance issues with the PE file
16200         structures so mcs compiled apps run on the Net 2.0 beta.
16201
16202 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
16203
16204         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
16205         Implement this. Fixes #67264.
16206
16207         * debug-helpers.h debug-helpers.c marshal.c: Move 
16208         mono_find_method_by_name to debug-helpers.c.
16209
16210 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
16211
16212         * object.c (mono_release_type_locks): type_initialization_hash is
16213         a GHashTable.
16214
16215         * reflection.c object.c object-internals.h: Fix warnings.
16216
16217         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
16218         without accessors. Fixes #61561.
16219
16220         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
16221         application base from the root domain if not set. Fixes #65641.
16222         (mono_runtime_init): Fix warning.
16223
16224 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16225
16226         * appdomain.c: call mono_thread_pool_init.
16227         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
16228         of worker threads based on the number of CPUs and the environment
16229         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
16230         for non-windows (windows) systems.
16231
16232 2004-10-27  Chris Toshok  <toshok@ximian.com>
16233
16234         * mono-debug-debugger.c (write_class): don't call mono_class_init
16235         here, as even with the check for (!klass->init_pending), we get
16236         into a situation where we're hitting cycles in class
16237         initialization.  Fixes #68816.
16238
16239 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
16240
16241         * image.c: Avoid overwriting values in the loaded_images_hash when an
16242         assembly is loaded multiple times. Fixes #61152.
16243
16244         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
16245         so multiple satellite assemblies for the same name can be loaded.
16246         Fixes #68259.
16247
16248         * mono_domain_assembly_preload: Actually return the loaded assembly, 
16249         not NULL.
16250
16251         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
16252         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
16253
16254         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
16255         pending finalizers are not invoked after the appdomain has been 
16256         unloaded. Fixes #67862.
16257
16258 2004-10-22  Martin Baulig  <martin@ximian.com>
16259
16260         * mono-debug-debugger.c
16261         (mono_debugger_runtime_invoke): Don't box valuetypes.
16262
16263 2004-10-22  Chris Toshok  <toshok@ximian.com>
16264
16265         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
16266         don't hide private methods.
16267
16268 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
16269
16270         * icall.c: Allows the runtime to "share" (when known) the public key
16271         token of an assembly. This avoid the need to recalculate the token 
16272         (from the public key) in managed code.
16273
16274 2004-10-21  Chris Toshok  <toshok@ximian.com>
16275
16276         * debug-helpers.c (append_class_name): argh, revert last patch.
16277         
16278 2004-10-21  Chris Toshok  <toshok@ximian.com>
16279
16280         * debug-helpers.c (append_class_name): use '+' as the delimiter,
16281         not '/', so that it matches what the debugger uses to look up
16282         methods.
16283
16284 2004-10-21  Martin Baulig  <martin@ximian.com>
16285
16286         * mono-debug-debugger.c (mono_debugger_throw_exception): New
16287         public method; this is called each time an exception is thrown and
16288         allows the debugger to use exception catch points.
16289
16290 2004-10-21  Martin Baulig  <martin@ximian.com>
16291
16292         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
16293         the stack pointer and the exception object in some struct and pass
16294         that to the debugger.
16295
16296 2004-10-21  Chris Toshok  <toshok@ximian.com>
16297
16298         * mono-debug-debugger.c (do_write_class): add instance/static
16299         event support.  We don't expose "raise" or "other" yet.
16300         (event_is_static): new method.
16301
16302 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
16303
16304         * mono-debug-debugger.c
16305         (mono_debugger_handle_exception): Remove
16306         bogus return value for fussy compilers.
16307
16308 2004-10-20  Martin Baulig  <martin@ximian.com>
16309
16310         * mono-debug-debugger.c
16311         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
16312         (mono_debugger_handled_exception): Likewise.
16313
16314 2004-10-20  Martin Baulig  <martin@ximian.com>
16315
16316         * mono-debug-debugger.h (MonoDebuggerEvent): Added
16317         MONO_DEBUGGER_EVENT_EXCEPTION.
16318
16319         * mono-debug-debugger.c (mono_debugger_handle_exception): New
16320         public function to send the debugger a notification for an
16321         exception and inform it about a catch/finally clause.
16322
16323 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
16324
16325         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
16326         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
16327         fix 2.95 build. 
16328
16329         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
16330
16331 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
16332
16333         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
16334         marshalled as [In,Out]. Fixes #58325.
16335
16336 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
16337
16338         * reflection.c (mono_method_body_get_object): Implement some fields.
16339
16340 2004-10-12  Martin Baulig  <martin@ximian.com>
16341
16342         * reflection.c (mono_reflection_bind_generic_parameters): Small
16343         fix, correctly retrieve our parent from a generic instance.
16344
16345 2004-10-12  Martin Baulig  <martin@ximian.com>
16346
16347         * metadata.c (mono_metadata_generic_param_equal): We always have
16348         an owner.
16349
16350         * class.c
16351         (mono_class_from_generic_parameter): We need to have an owner.
16352         (my_mono_class_from_generic_parameter): Likewise.
16353
16354         * reflection.c (mono_reflection_setup_generic_class): Renamed to
16355         mono_reflection_create_generic_class() and added a new
16356         mono_reflection_setup_generic_class().  
16357         (mono_reflection_initialize_generic_param): If we're a nested
16358         generic type and inherited from the containing class, set our
16359         owner to the outer class.
16360
16361 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
16362
16363         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
16364
16365         * reflection.c (mono_method_body_get_object): New function to create
16366         a MethodBody object.
16367
16368         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
16369
16370 2004-10-11  Martin Baulig  <martin@ximian.com>
16371
16372         * metadata.c (_mono_metadata_type_equal): Renamed to
16373         do_mono_metadata_type_equal() and made static.
16374
16375 2004-10-11  Martin Baulig  <martin@ximian.com>
16376
16377         * appdomain.c: Bump corlib version number to 28.
16378
16379 2004-10-10  Martin Baulig  <martin@ximian.com>
16380
16381         * class-internals.h
16382         (MonoGenericInst): Added `MonoGenericContainer *container'.
16383         (MonoGenericMethod): Likewise.
16384         (MonoGenericContext): Likewise.
16385         (MonoGenericParam): Added `MonoGenericContainer *owner'.
16386
16387         * metadata.c
16388         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
16389         (do_mono_metadata_parse_generic_inst): Likewise.
16390         (mono_metadata_parse_type_full): New public method.  This is the actual
16391         mono_metadata_parse_type() implementation - with an additional
16392         `MonoGenericContainer *' argument.
16393         (mono_metadata_parse_array_full): Likewise.
16394         (mono_metadata_parse_signature_full): Likewise.
16395         (mono_metadata_parse_method_signature_full): Likewise.
16396         (mono_metadata_parse_mh_full): Likewise.
16397         (mono_type_create_from_typespec): Likewise.
16398         (mono_metadata_interfaces_from_typedef_full): New public method;
16399         this is similar to the other _full() methods, but we take a
16400         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
16401         (mono_metadata_parse_generic_param): Take an additional
16402         `MonoGenericContainer *' argument and lookup the MonoGenericParam
16403         from that container.
16404         (mono_metadata_generic_param_equal): New static method to compare
16405         two type parameters.
16406         (_mono_metadata_type_equal): New static method; takes an
16407         additional `gboolean signature_only' argument - if true, we don't
16408         compare the owners of generic parameters.
16409         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
16410         with a TRUE argument - do a signature-only comparision.
16411
16412         * loader.c: Use the new _full() methods and pass the
16413         MonoGenericContainer to them.
16414
16415         * object-internals.h (MonoReflectionTypeBuilder): Added
16416         `MonoGenericContainer *generic_container' field.
16417         (MonoReflectionMethodBuilder): Likewise.
16418
16419 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
16420
16421         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
16422         case initial images of dynamic assemblies.
16423
16424         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
16425
16426         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
16427
16428         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
16429         length of event->other array.
16430         (typebuilder_setup_events): Ditto.
16431
16432         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
16433         'assembly_by_name' and add an 'assemblies' list.
16434
16435         * assembly.h assembly.c: Add a new search hook for determining whenever
16436         an assembly is already loaded. Use this instead of searching in the
16437         loaded_assemblies list.
16438
16439         * domain.c appdomain.c: Implement the new search hook so loaded 
16440         assemblies are now scoped by appdomain. Fixes #67727.
16441
16442 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
16443
16444         * threads.c (mono_thread_attach): Initialize synch_lock field so
16445         mono_thread_detach works again.
16446
16447         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
16448         'lib' too. Fixes #63130.
16449
16450 2004-10-06  Jackson Harper  <jackson@ximian.com>
16451
16452         * culture-info-tables.h: regenerated.
16453
16454 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
16455
16456         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
16457         implemented by other interfaces in the result. Fixes #65764.
16458         
16459         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
16460         Handle unloadable modules without crashing.
16461
16462         * image.c (load_modules): Revert the previous patch since modules must
16463         have a fixed index inside the array.
16464         
16465         * image.c (load_modules): Don't include native modules in the modules
16466         array.
16467
16468 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
16469
16470         * reflection.h: Add param_defaults field.
16471
16472         * reflection.c: Add support for parameter defaults in dynamic methods.
16473         Fixes #64595.
16474
16475         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
16476         an empty string when a type has no namespace. Fixes #64230.
16477
16478 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
16479
16480         * tabledefs.h: Added "internal" security actions to support non-CAS
16481         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
16482         Note: they do not seems to be used anymore in 2.0 (new metadata format)
16483
16484 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
16485
16486         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
16487         constructor of abstract class. Fixes #61689.
16488
16489 2004-10-04  Martin Baulig  <martin@ximian.com>
16490
16491         * class-internals.h (MonoGenericContainer): New type.
16492         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
16493         `MonoGenericContainer *generic_container'.
16494         (MonoClass): Replaced `gen_params' and `num_gen_params' with
16495         `MonoGenericContainer *generic_container'.
16496
16497         * metadata.c (mono_metadata_load_generic_params): Return a
16498         `MonoGenericContainer *' instead of a `MonoGenericParam *';
16499         removed the `num' argument.
16500
16501 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
16502
16503         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
16504         for dynamic images.
16505
16506         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
16507         machine fields.
16508
16509         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
16510
16511         * reflection.c: Save pe_kind and machine values into the generated
16512         image file.
16513
16514         * appdomain.c: Bump corlib version number.
16515
16516         * object-internals.h: Reorganize layout of LocalBuilder.
16517
16518         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
16519         New helper function.
16520
16521         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
16522         created MonoType for dynamic types. Fixes #66180.
16523
16524 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
16525
16526         * threadpool.c: the ares hashtable needs a critical section around it.
16527         this prevents some nasty segfaults
16528
16529 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
16530
16531         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
16532         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
16533         bug 67324).
16534         
16535 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
16536
16537         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
16538         
16539 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
16540
16541         * image.c: Always canonicalize image file names, to avoid loading
16542         the same assembly twice when referenced using a relative path.
16543
16544 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
16545
16546         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
16547
16548         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
16549
16550         * marshal.c: Fix warnings.
16551
16552 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
16553
16554         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
16555         attempting to marshal the delegate_trampoline as the method_addr.
16556         This patch has a static hashtable of marshalled delegates so that 
16557         we can map delegate_trampoline addresses back to delegates.  This
16558         allows a delegate passed to managed code to be passed back into native
16559         code.  Fixes #67039
16560
16561 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
16562
16563         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
16564
16565         * reflection.c (method_encode_code): Align method headers properly.
16566         Fixes #66025.
16567
16568 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
16569
16570         * marshal.c: In the runtime invoke wrapper, reset the abort
16571         exception if it is cached. This avoids the automatic rethrowal of 
16572         the exception after the catch of the wrapper. Also check for pending
16573         interruptions before calling the managed method. This is done using
16574         the new method emit_thread_force_interrupt_checkpoint, since the
16575         normal checkpoint method is ignored when running the invoke wrapper.
16576         * object.c: If the abort exception is rethrown, set the abort_exc
16577         field of the thread, so it will be rethrown aftere every catch.
16578         * threadpool.c: Only run an interruption checkpoint if what has been
16579         requested is a stop of the thread (aborts will be ignored).
16580         * threads.c: By default, a thread will now never be interrumped while
16581         running the runtime invoke wrapper (this ensures that runtime_invoke
16582         will always return to the caller if an exception pointer is provided).
16583         There is a new special method mono_thread_force_interruption_checkpoint()
16584         to force an interruption checkpoint even if running a protected
16585         wrapper, which is used by the same runtime invoke wrapper to do a check
16586         at a safe point.
16587
16588 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
16589
16590         * object.c, object-internals.h: Implemented mono_release_type_locks,
16591         which releases the cctor locks held by a thread.
16592         * threads.c, threads.h: In thread_cleanup, release cctor locks held
16593         by a thread. Added mono_thread_exit() method to be used to safely stop
16594         a thread.
16595
16596 2004-09-28  Raja R Harinath  <rharinath@novell.com>
16597
16598         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
16599         Move null check before dereference.  Avoid indexing beyond the end
16600         of the 'modules' array.
16601
16602 2004-09-28  Raja R Harinath  <rharinath@novell.com>
16603
16604         * metadata-internals.h (MonoImage): Add module_count field.
16605         * image.c (load_modules): Set image->module_count.
16606         (mono_image_load_file_for_image): Use image->module_count.
16607         * reflection.c (mono_image_load_module): Append to image->modules array 
16608         of dynamic assembly.
16609         (mono_module_get_object): Fix loop to actually increment index.
16610         Use image->module_count.
16611         * assembly.c (mono_assembly_load_references): Use image->module_count.
16612         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
16613         Likewise.
16614
16615 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
16616
16617         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
16618         Avoid assert on generic types.
16619
16620 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
16621
16622         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
16623
16624         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
16625
16626         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
16627         function to convert a MarshalSpec structure to its managed counterpart.
16628
16629         * reflection.c: Fix warnings.
16630         
16631         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
16632         field.
16633
16634         * icall.c (mono_create_icall_signature): Fix build.
16635
16636 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
16637
16638         * icall.c: Add MakePointType icall.
16639
16640         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
16641         warnings.
16642
16643 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16644
16645         * threadpool.c: reuse allocated slots in the queue.
16646
16647 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
16648
16649         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
16650
16651         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
16652
16653         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
16654         previous change.
16655
16656         * tabledefs.h: Add constants for pinvoke attributes BestFit and
16657         ThrowOnUnmappableChar.
16658
16659         * icall.c (ves_icall_Type_GetPacking): New icall.
16660
16661 2004-09-24  Martin Baulig  <martin@ximian.com>
16662
16663         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
16664
16665 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16666
16667         * appdomain.c:
16668         (mono_domain_set): allow setting a domain that is being unloaded.
16669         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
16670         being unloaded.
16671
16672 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
16673
16674         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
16675         the GetCustomAttributes icall.
16676
16677 2004-09-23  Martin Baulig  <martin@ximian.com>
16678
16679         * object-internals.h (MonoReflectionGenericParam): Replaced
16680         'has_ctor_constraint', `has_reference_type' and `has_value_type'
16681         with `guint32 attrs'.
16682
16683 2004-09-23  Martin Baulig  <martin@ximian.com>
16684
16685         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
16686
16687 2004-09-23  Martin Baulig  <martin@ximian.com>
16688
16689         * object-internals.h (GenericParameterAttributes): New enum.
16690
16691 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
16692
16693         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
16694         
16695         * class.c (init_events): Fill out event->other field.
16696
16697         * class.c: Fix warnings.
16698
16699         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
16700
16701 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
16702
16703         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
16704         walk which doesn't supply the IL offset.
16705
16706 2004-09-22  Martin Baulig  <martin@ximian.com>
16707
16708         * reflection.c (mono_reflection_setup_internal_class): If we're
16709         System.ValueType, System.Object or System.Enum, set
16710         `klass->instance_size' and create the vtable.
16711         (mono_reflection_create_internal_class): If we're an enum type,
16712         get the base class from our current corlib.
16713
16714 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
16715
16716         * reflection.h (MonoResolveTokenError): New type.
16717
16718         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
16719         icall.
16720
16721         * icall.c: Add an 'error' argument to the ResolveToken icalls.
16722
16723 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
16724
16725         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
16726         Support also calling constructors, but only for already allocated objects.
16727
16728 2004-09-17  Geoff Norton <gnorton@customerdna.com>
16729
16730         * reflection.c (type_get_qualified_name): If the klass is null
16731         return the typename to avoid a NullRefEx.
16732         (encode_cattr_value): Get the qualified name of the boxed type,
16733         not the underlying enumtype.  Fixes #62984.
16734
16735 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
16736
16737         * marshal.c: Fix problems with previous checkin.
16738
16739 2004-09-21    <vargaz@freemail.hu>
16740
16741         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
16742         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
16743
16744         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
16745
16746 2004-09-21  Geoff Norton <gnorton@customerdna.com>
16747
16748         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
16749         should only return a type for pointers, arrays, and passbyref types.
16750         Fixes bug #63841.
16751
16752 2004-09-21  Martin Baulig  <martin@ximian.com>
16753
16754         * domain.c (mono_debugger_check_runtime_version): New public
16755         function.
16756
16757         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
16758
16759 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
16760
16761         * reflection.c: Added missing sort to the declarative security 
16762         attributes table. MS implementation stops seeing the attributes if the
16763         token number regress in the table (as shown by ildasm and permview).
16764
16765 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
16766
16767         * object-internals.h (MonoReflectionModule): Add 'token' field.
16768         
16769         * reflection.c (mono_reflection_get_token): Add support for Module
16770         and Assembly.
16771         (mono_module_get_object): Set 'token' field.
16772         (mono_module_file_get_object): Set 'token' field.
16773
16774         * icall.c: Add new Assembly and Module icalls.
16775
16776         * appdomain.c: Bump corlib version.
16777
16778 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
16779
16780         * loader.h loader.c class.h class.c: Add helper functions for obtaining
16781         tokens of metadata objects.
16782
16783         * reflection.h reflection.c (mono_reflection_get_token): New function
16784         to obtain the token of a metadata object.
16785
16786         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
16787
16788 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
16789
16790         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
16791         
16792         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
16793
16794 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
16795
16796         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
16797         * object-internals.h: Added 3 MonoArray* members to MonoReflection
16798         AssemblyBuilder to access the permissions set in the class lib.
16799         * reflection.c: Added security attributes encoding step in 
16800         mono_image_build_metadata.
16801         * tabledefs.h: Added new security actions defined in 2.0:
16802         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
16803
16804 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
16805
16806         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
16807         macro parameter.
16808
16809 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
16810  
16811         * locales.c: nullify the ICU_collator member of CompareInfo when it is
16812           finalized. There where random SIGSEVs at program termination, when
16813           an object being finalized was trying to do a string comparison and
16814           the current culture was already finalized.
16815  
16816 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16817
16818         * threads.c: call thread_cleanup before finishing the thread if we get
16819         there.
16820
16821 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
16822
16823         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
16824         assemblies from the parent. Fixes #65665.
16825
16826 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
16827
16828         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
16829         modifiers.
16830
16831 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
16832
16833         * reflection.h: add prototype for mono_get_dbnull_object
16834         * reflection.c: add prototypes for get_default_param_value_blobs 
16835         and mono_get_object_from_blob for fussier compilers
16836
16837 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
16838  
16839         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
16840         false deadlock checks in class initialization.
16841  
16842 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
16843
16844         * image.c (mono_image_addref): Fix comment.
16845
16846         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
16847         possible.
16848
16849 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
16850
16851         * reflection.c (mono_param_get_objects): Modified to return
16852         ParameterInfo.DefaultValue object.
16853
16854         (get_default_param_value_blobs):
16855         (mono_get_object_from_blob):
16856         (mono_get_dbnull_object): New helper routines. 
16857
16858         * object.c (mono_get_constant_value_from_blob): New helper routine
16859         carved out from get_default_field_value ()
16860
16861         * object-internals.h (mono_get_constant_value_from_blob): Added
16862         function declaration.
16863
16864 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
16865
16866         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
16867         referenced assemblies. Fixes #62135.
16868
16869         * exception.h exception.c (mono_get_exception_file_not_found2): New
16870         helper function.
16871
16872 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
16873
16874         * class.h class.c: Add mono_type_get_underlying_type ().
16875
16876 2004-09-09  Geoff Norton <gnorton@customerndna.com>
16877
16878         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
16879         Fix GetTypes() to support dynamically created assemblies.
16880
16881 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
16882
16883         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
16884         
16885         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
16886         previous patch.
16887
16888         * reflection.h reflection.c loader.c: Allow dynamic construction of
16889         pinvoke methods. Fixes #65571.
16890         
16891         * reflection.c (mono_reflection_get_type): Revert previous change since
16892         it causes regressions.
16893
16894 2004-09-08  Martin Baulig  <martin@ximian.com>
16895
16896         * class.c (class_compute_field_layout): Don't call
16897         mono_class_layout_fields() for open generic instances.
16898
16899 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
16900         * threads.c appdomain.c: fix typo in GC macro
16901
16902 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16903
16904         * threads.c: don't call mono_thread_detach() in start_wrapper(),
16905         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
16906
16907 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
16908
16909         * image.c (mono_image_close): Applied patch from 
16910         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
16911         assembly is loaded multiple times from data.
16912         
16913         * image.c (mono_image_open): Fix warning.
16914
16915 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
16916
16917         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
16918         once. Fixes #58334.
16919         
16920         * reflection.c (mono_reflection_create_runtime_class): Initialize
16921         klass->nested_classes. Fixes #61224.
16922
16923 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
16924
16925         * threads.c: sched_yield() on exit, to allow threads to quit.
16926
16927 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
16928
16929         * object.c (mono_unhandled_exception): Remove leftover debug code.
16930
16931 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
16932
16933         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
16934
16935 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
16936
16937         * marshal.c (emit_marshal_array): Really null terminate string arrays.
16938         
16939         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
16940
16941 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
16942
16943         * marshal.c (emit_marshal_array): Null terminate string arrays.
16944         
16945         * marshal.c (raise_auto_layout_exception): Fix warning.
16946
16947         * reflection.c (mono_param_get_objects): Initialize the default value
16948         with DBNull.Value, not null. Fixes #62123.
16949
16950 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
16953         throw an exception with a cute explanation.
16954
16955 2004-09-06  Dick Porter  <dick@ximian.com>
16956
16957         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
16958         Close the new process's thread handle, as we don't use it.  The
16959         handle stays around forever otherwise.
16960
16961 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
16962
16963         * object.c (arith_overflow): Fix warning.
16964
16965         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
16966         calling conventions in method refs. Fixes #65352.
16967
16968         * reflection.c: Fix warnings.
16969
16970 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16971
16972         * icall.c: Add a new icall for Array.Clear
16973
16974 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16975
16976         * object.c: When allocating an array, we have to throw
16977         an overflow exception if any of the lengths are < 0.
16978
16979 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
16980
16981         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
16982         properly. Also move implementation of string array marshalling to 
16983         managed code. Fixes #42316.
16984
16985 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16986
16987         * assembly.c: provide more information when loading an assembly fails.
16988
16989 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16990
16991         * filewatcher.c: don't expect the development fam package to be
16992         installed.
16993
16994 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
16995
16996         * marshal.c: Make a copy of the signature cookie since it will be
16997         freed by the caller.
16998         
16999         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
17000
17001         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
17002
17003         * metadata.c (mono_metadata_free_marshal_spec): New function to free
17004         marshal specs.
17005
17006         * marshal.c: More refactoring.
17007         
17008         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
17009         smaller functions.
17010
17011 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
17012
17013         * object.c: In mono_message_invoke, fill the output parameter array after
17014           calling the managed method (it was done before the call). This fixes
17015           bug #59299.
17016
17017 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
17018
17019         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
17020         as well.
17021
17022 2004-09-02  Martin Baulig  <martin@ximian.com>
17023
17024         * class.c (mono_class_instance_size): Don't allow generic type
17025         definitions or open generic instances.
17026         (mono_class_array_element_size): If we're a value type, call
17027         mono_class_instance_size() on the original class.
17028
17029         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
17030         handle generic instances.
17031
17032         * mono-debug-debugger.c (write_type): Handle generic instances
17033         like classes.
17034
17035 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
17036
17037         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
17038         the allocation request fails. Fixes #65089.
17039
17040         * object.c (mono_runtime_free_method): Do not call mono_free_method.
17041         
17042         * object.c (mono_runtime_free_method): New function to free a dynamic
17043         method.
17044
17045         * marshal.c (mono_delegate_free_ftnptr): New function to free the
17046         delegate trampoline.
17047
17048         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
17049         with hasthis as dynamic,
17050
17051         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
17052
17053         * domain.c (mono_jit_info_table_remove): New function to remove an
17054         entry from the jit info table.
17055
17056         * class-internals.h (MonoMethod): Add 'dynamic' field.
17057
17058         * loader.c: Fix warnings.
17059
17060 2004-09-01  Martin Baulig  <martin@ximian.com>
17061
17062         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
17063         instead of mono_debugger_lock() because the latter one is a no-op
17064         unless running in the debugger.
17065
17066 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
17067
17068         * class.c (class_compute_field_layout): Classes with auto-layout or
17069         reference fields are not blittable.
17070         
17071 2004-09-01  Dick Porter  <dick@ximian.com>
17072
17073         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
17074         mono_image_get_filename() to get the assembly location.
17075
17076         * icall.c:
17077         * metadata.h: Fix compile warnings
17078
17079 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
17080
17081         * class.c (class_compute_field_layout): System.Object is blittable.
17082
17083         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
17084         as in/out. Fixes #59909.
17085
17086 2004-09-01  Martin Baulig  <martin@ximian.com>
17087
17088         * metadata.h (MONO_TYPE_ISREFERENCE): Call
17089         mono_metadata_generic_inst_is_valuetype() if we're a generic
17090         instance to check whether our underlying type is a reference type.
17091
17092 2004-09-01  Martin Baulig  <martin@ximian.com>
17093
17094         * metadata.c (mono_type_size): If we're a generic instance, call
17095         mono_class_value_size() for value types.
17096
17097 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
17098
17099         * marshal.c: Implement more custom marshalling functionality. Fixes
17100         #64915.
17101
17102 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
17103
17104         * mono-debug.c, debug-mono-symfile.c: add some locking love.
17105
17106 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
17107
17108         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
17109
17110         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
17111
17112         * icall.c: Fix some warnings.
17113
17114         * threads.c (abort_appdomain_thread): Fix unref errors.
17115         (mono_thread_current): Fix THREAD_DEBUG define.
17116
17117 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
17118
17119         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
17120
17121         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
17122
17123 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
17124
17125         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
17126         string arrays.
17127
17128 2004-08-28  Martin Baulig  <martin@ximian.com>
17129
17130         * metadata.c
17131         (mono_metadata_generic_inst_is_valuetype): New public function.
17132
17133         * metadata.h (MONO_TYPE_ISSTRUCT): Call
17134         mono_metadata_generic_inst_is_valuetype() if we're a generic
17135         instance to check whether our underlying type is a valuetype.
17136
17137 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
17138
17139         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
17140         #63768.
17141
17142 2004-08-25  Martin Baulig  <martin@ximian.com>
17143
17144         * loader.c (mono_get_method_from_token): Abstract methods can also
17145         be generic and thus have type parameters.
17146
17147         * metadata-internals.h
17148         (MonoDynamicImage): Added `GPtrArray *gen_params'.
17149
17150         * reflection.c (mono_image_get_generic_param_info): Don't create a
17151         metadata row, just add an entry to the `gen_params' array.
17152         (build_compressed_metadata): Sort the `gen_params' array and then
17153         actually create the metadata.
17154
17155 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17156
17157         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
17158
17159 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
17160
17161         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
17162
17163 2004-08-24  Martin Baulig  <martin@ximian.com>
17164
17165         * class.cs (mono_class_is_subclass_of): Like an interface, a
17166         generic instance also derives from System.Object.
17167
17168 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
17169
17170         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
17171         custom modifiers to be in any order. Fixes #61990.
17172
17173 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
17174
17175         * object.c: Register mono_object_new_fast icall.
17176         
17177         * object.c (mono_class_get_allocation_ftn): Return to calling
17178         mono_object_new_fast, since it seems faster to compute the object 
17179         size in unmanaged code than passing it as a parameter.
17180
17181         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
17182
17183         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
17184         this function with Boehm as the oom handler, so we don't have to check
17185         the result of GC_malloc.
17186
17187         * object.c: Remove checks for oom.
17188
17189         * object.h object.c (mono_class_get_allocation_ftn): New function to
17190         return the icall which can be used to allocate an instance of a given
17191         class. 
17192
17193         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
17194
17195         * class-internals.h: Add 'enabled' field.
17196
17197 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
17198
17199         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
17200
17201 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
17202         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
17203         value 0x0010.
17204
17205 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
17206
17207         * appdomain.c: use the Tls function for appdomain too,
17208         at Zoltan's request. Actually return in mono_context_get
17209
17210         * appdomain.c, profiler.c, threads.c: use __thread
17211
17212 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
17213
17214         * appdomain.c threads.c: Call GC_CreateThread on windows.
17215
17216         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
17217         multiple libraries since this don't work on windows.
17218
17219 2004-08-18  Martin Baulig  <martin@ximian.com>
17220
17221         * class-internals.h
17222         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
17223         MonoMethodHeader.
17224
17225         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
17226         MonoMethodNormal since we also need it for abstract and interface
17227         methods.
17228
17229         * reflection.c
17230         (build_compressed_metadata): Sort the GenericParam table.
17231         (mono_image_create_token): Added `gboolean create_methodspec'
17232         argument; this is false when generating a MethodImpl token.
17233         (reflection_methodbuilder_to_mono_method): Abstract and interface
17234         methods may also have generic parameters.
17235
17236 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17237
17238         * appdomain.c: thread local alloc
17239
17240 2004-08-17  Martin Baulig  <martin@ximian.com>
17241
17242         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
17243
17244         * icall.c
17245         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
17246         argument.
17247
17248         * class.c (mono_type_get_full_name): New public function.
17249         (mono_type_get_name): Don't include the type arguments.
17250
17251 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
17252
17253         * Makefile.am: Build static versions of libmetadata and libmonoruntime
17254         for inclusion into the mono executable.
17255
17256 2004-08-16  Martin Baulig  <martin@ximian.com>
17257
17258         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
17259         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
17260
17261 2004-08-14  Martin Baulig  <martin@ximian.com>
17262
17263         * class.c (dup_type): Also copy the `byref' field.
17264
17265 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
17266
17267         * reflection.c (create_dynamic_mono_image): Revert the last change 
17268         since it breaks bootstrap.
17269
17270 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
17271
17272         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
17273
17274         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
17275         not free them with g_free.
17276
17277 2004-08-11  Martin Baulig  <martin@ximian.com>
17278
17279         * reflection.c (mono_reflection_setup_internal_class): Also call
17280         mono_class_setup_mono_type() if we already have a `tb->type.type'.
17281
17282 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
17283
17284         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
17285         called during default (first) AppDomain creation. Keep track of
17286         Evidence when loading assemblies.
17287
17288 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
17289
17290         * opcodes.c, opcodes.h: reduce runtime relocations.
17291
17292 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
17293
17294         * culture-info.h, locales.c: fixes and chages to sue the new
17295         optimized format of the locale data.
17296         * culture-info-tables.h: regenerated.
17297
17298 2004-08-06  Geoff Norton <gnorton@customerdna.com>
17299         
17300         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
17301
17302 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
17303
17304         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
17305         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
17306         * domain-internals.h: icall declaration.
17307         * icall.c: icall registration.
17308         * object-internals.h: New fields in MonoAssembly for CAS.
17309
17310 2004-08-05  Duncan Mak  <duncan@ximian.com>
17311
17312         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
17313         CEE_LDELEM_ANY.
17314
17315 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
17316
17317         * reflection.c: fix to deal with object[] arrays in custom ctors
17318         (bug #62550).
17319
17320 2004-08-05  Martin Baulig  <martin@ximian.com>
17321
17322         * class.c (mono_class_array_element_size): Added support for
17323         generic instances and correctly handle "recursive" types.
17324
17325 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
17326
17327         * assembly.c: Fix warnings.
17328
17329 2004-08-04  Martin Baulig  <martin@ximian.com>
17330
17331         * class.c
17332         (mono_type_get_name_recurse): Added `gboolean include_arity'
17333         argument specifying whether or not we should include the generic
17334         arity in the type name.
17335         (_mono_type_get_name): New static function.
17336         (mono_class_setup_vtable): If we're a generic instance, don't
17337         include the generic arity in the names of explicit method
17338         implementations.        
17339
17340 2004-08-03  Martin Baulig  <martin@ximian.com>
17341
17342         * class.c (mono_type_get_name_recurse): Enclose the generic type
17343         arguments in `<', '>'.
17344
17345 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
17346
17347         * gc.c: make GC warning messages use the trace API, they are just
17348         noise to most of the users.
17349
17350 2004-08-03  Martin Baulig  <martin@ximian.com>
17351
17352         * debug-mono-symfile.c (read_string): Correctly read the string.
17353
17354 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
17355
17356         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
17357         
17358         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
17359         icalls.
17360         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
17361
17362 2004-07-30  Martin Baulig  <martin@ximian.com>
17363
17364         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
17365         Reflect latest symbol writer changes.   
17366
17367 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
17368
17369         * object.c: always create an object if null is passed
17370         to Invoke() where a valuetype is expected.
17371
17372 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
17373
17374         * marshal.c (mono_marshal_init): make managed
17375         signatures match native ones better for 64bits.
17376
17377 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17378
17379         * appdomain.c: hack to build correctly the private bin path on windows.
17380         Fixes bug #61991.
17381
17382 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
17383
17384         * assembly.c: Load mscorlib from the correct framework directory
17385           (mono/<version>/mscorlib.dll).
17386         * appdomain.h: Added prototypes for new functions.
17387         * internals.h: Added some prototypes.
17388         * domain.c: When initializing the runtime, get from the executable and
17389           the configuration files the runtime version that the app supports.
17390           Added support methods for reading app.exe.config. Added list of versions
17391           supported by the JIT. Added two new methods: mono_init_from_assembly,
17392           which initializes the runtime and determines the required version from
17393           the provided exe file, and mono_init_version, which initializes
17394           the runtime using the provided version.
17395         * icall.c: Get machine.config from version-specific directory.
17396         * reflection.c: When generating an image, embed the version number
17397           of the current runtime.
17398
17399 2004-07-28  Dick Porter  <dick@ximian.com>
17400
17401         * socket-io.c
17402         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
17403         returned sockaddr size before creating the remote address object.
17404         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
17405         61608.
17406
17407 2004-07-28  Dick Porter  <dick@ximian.com>
17408
17409         * locales.c (string_invariant_compare_char): Fix invariant char
17410         compares between upper and lower cases.  Fixes bug 61458.
17411
17412 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
17413         
17414         * marshal.c: actually cache stelem.ref wrappers.
17415         
17416 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
17417
17418         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
17419         sections and remove the mono_cli_rva_map () function.
17420
17421 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
17422
17423         * debug-mono-symfile.c: fix one more endianess issue, from a patch
17424         by Geoff Norton (<gnorton@customerdna.com>).
17425
17426 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
17427
17428         * class.c: fix class loads for pointer types (typeof(int) !=
17429         typeof(int*)).
17430
17431 2004-07-27  Martin Baulig  <martin@ximian.com>
17432
17433         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
17434         reading the debugging information from an external ".mdb" file.
17435
17436 2004-07-24  Martin Baulig  <martin@ximian.com>
17437
17438         * reflection.c (mono_image_get_type_info): Only write a class
17439         layout entry if we actually have a size or a packing size.
17440
17441 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
17442
17443         * reflection.c (type_get_fully_qualified_name): 
17444         insert cast to get type checking of ?: with non-gcc compilers
17445
17446 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
17447
17448         * rand.c: use g_getenv for both lookups of
17449         MONO_EGD_SOCKET
17450
17451 2004-07-17  Martin Baulig  <martin@ximian.com>
17452
17453         * reflection.c (mono_reflection_bind_generic_method_parameters):
17454         Set `gmethod->reflection_info'.
17455
17456 2004-07-17  Martin Baulig  <martin@ximian.com>
17457
17458         * class.c (mono_class_create_from_typedef): Insert the newly
17459         created class into the hash table before computing the interfaces
17460         since we could be called recursively.
17461
17462 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
17463
17464         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
17465         function to implement stelem.ref in managed code
17466         * class-internals.h, debug-helpers.c: a new wrapper type
17467         for the above.
17468
17469 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
17470
17471         * gc.c: allow GC handles to work even when no GC is compiled in.
17472         Fix part of bug #61134 (GetAddrOfPinnedObject).
17473
17474 2004-07-13  Peter Williams  <peter@newton.cx>
17475  
17476         * process.c (complete_path): Make sure we don't attempt to execute
17477         directories.
17478  
17479 2004-07-12  Geoff Norton <gnorton@customerdna.com>
17480
17481         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
17482           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
17483           and will add/subtract the hour if needed
17484
17485 2004-07-12  Martin Baulig  <martin@ximian.com>
17486
17487         * reflection.c (mono_field_get_object): If we have
17488         `field->generic_info', take the attributes from
17489         `field->generic_info->generic_type'.    
17490
17491 2004-07-12  Martin Baulig  <martin@ximian.com>
17492
17493         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
17494         This function must be called before initializing the runtime.
17495         (mono_debug_init_1): New function; call this after initializing
17496         the runtime, but before loading the assembly.  It tells the
17497         debugger to load corlib and the builtin types.
17498
17499         * mono-debug-debugger.c: Did some larger changes in the debugging
17500         code; support recursive class declarations, make sure we actually
17501         add all classes.
17502
17503 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17504
17505         * debug-helpers.c: undo my previous patch and fixed the real issue in
17506         ../mini/exceptions-x86.c
17507
17508 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17509
17510         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
17511         when no HOME env. variable was set and a NullRef was thrown in a .cctor
17512         called from other .cctors.
17513
17514 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
17515
17516         * loader.c: Removed the mono_loader_wine_init hack now that we are
17517         doing a managed version of Windows.Forms.
17518
17519 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
17520
17521         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
17522         threadpool.c, threads.c: remove static data from rootset.
17523
17524 2004-07-09  Dick Porter  <dick@ximian.com>
17525
17526         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
17527         Don't do any more processing if the matched length was 0.  It was
17528         increasing the size of the string before.  Fixes bug 61167.
17529
17530 2004-07-09  Dick Porter  <dick@ximian.com>
17531
17532         * socket-io.h:
17533         * socket-io.c
17534         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
17535         Add support for SO_PEERCRED if its available.
17536
17537 2004-07-09  Peter Bartok <pbartok@novell.com>
17538         * loader.c: winelib.exe.so error message is now only displayed if
17539         MONO_DEBUG is set. To help us avoid questions when people are trying
17540         out the new Managed.Windows.Forms.
17541
17542 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
17543
17544         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
17545         for isinst and castclass wrappers.
17546
17547         * class-internals.h icall.c: Move registration and lookup of JIT icalls
17548         to libmetadata from the JIT, so they could be used by the marshalling
17549         code and the interpreter.
17550
17551         * marshal.c: Register marshalling related JIT icalls here instead of
17552         in mini.c. Use CEE_MONO_ICALL instead of the family of 
17553         CEE_MONO_PROC<x> opcodes to call marshalling functions.
17554
17555         * metadata.h: Remove unneeded marshalling conversions.
17556
17557         * opcodes.c: Update for new opcodes.
17558         
17559 2004-07-08  Martin Baulig  <martin@ximian.com>
17560
17561         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
17562         (mono_debug_get_domain_data): Make this function static.
17563
17564 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
17565
17566         * gc.c, object.h: add nice GC handle API for embedders.
17567
17568 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
17569
17570         * reflection.c: more changes for the new api
17571
17572         * object.c: When we reflect on a field w/ a constant value, it
17573         will not have a memory location, so we must access metadata. Also,
17574         allow easier reading of strings so that we can read them from
17575         the constant data.
17576
17577         * class.c (mono_class_layout_fields): no need for literal fields here.
17578
17579         * class-internals.h: api changes for const fields
17580
17581         * icall.c (ves_icall_get_enum_info): use new apis for const fields
17582
17583 2004-07-06  Martin Baulig  <martin@ximian.com>
17584
17585         * mono-debug.h: Increment version number to 44.
17586
17587         * mono-debug.c (mono_debug_add_wrapper): The second argument is
17588         now a gpointer, rewrote this whole method.
17589
17590         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
17591         function.  Add information about the wrapper in a new "misc table".
17592
17593         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
17594         for the new misc table.
17595
17596 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
17597
17598         * metadata-internals.h image.c: Add a cache for helper signatures.
17599
17600         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
17601
17602 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
17603
17604         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
17605         delegates from a delegate. Fixes #61033.
17606         
17607         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
17608         marshalling of stringbuilder arrays. Fixes #59900.
17609
17610 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
17611
17612         * icall.c: Add EnumBuilder:setup_enum_type icall.
17613
17614 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
17615
17616         * icall.c: Added a new icall for the property version of
17617         OffsetOfStringData.
17618
17619 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
17620
17621         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
17622         it has a constant size across platforms.
17623
17624         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
17625         stack trace.
17626
17627 2004-06-29  Martin Baulig  <martin@ximian.com>
17628
17629         * mono-debug.c (mono_debug_add_method): Protect the whole function
17630         in mono_debugger_lock(), not just parts of it.
17631
17632 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
17633
17634         * reflection.c: make sure padding bytes in heaps are zeroed.
17635
17636 2004-06-24  David Waite  <mass@akuma.org>
17637
17638         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
17639         image.c, loader.c, locales.c, marshal.c, metadata.c,
17640         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
17641         string-icalls.c, threads.c: change to C90-style comments from C99 /
17642         C++ -style
17643
17644 2004-06-24  Dick Porter  <dick@ximian.com>
17645
17646         * threads.c
17647         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
17648         return createdNew.  Fixes bug 60412.
17649
17650         * threads-types.h: 
17651         * icall.c: Add createdNew parameter to CreateMutex icall
17652
17653 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
17654
17655         * reflection.c, object-internals.h: save default value in params.
17656
17657 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17658
17659         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
17660         no need to build a new path combining that with the application base.
17661         Fixes bug #60442.
17662
17663 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
17664
17665         * reflection.c: fixed minor standard compliance issues.
17666
17667 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
17668
17669         * reflection.c: fixed issue with encoding some custom attributes
17670         (arrays in properties and fields, bug #60411).
17671
17672 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17673
17674         * reflection.c: fix start address when copying the public key token.
17675
17676 2004-06-23  Martin Baulig  <martin@ximian.com>
17677
17678         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
17679         the `exc' object in a static object to put it into the GC's root set.
17680
17681 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
17682
17683         * reflection.c: make mono_reflection_setup_internal_class ()
17684         callable a second time to setup a new parent class.
17685
17686 2004-06-23  Dick Porter  <dick@ximian.com>
17687
17688         * threads.c: Check for WAIT_IO_COMPLETION return values.
17689
17690 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
17691
17692         * appdomain.c: Removed the g_free on the public key token. Now copy 
17693         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
17694         * assembly.c: Added public key token string value when loading 
17695         assemblies. Fix bug #60439.
17696         * icall.c: Added missing informations (like public key) in 
17697         GetReferencedAssemblies. Fix #60519.
17698         * image.h: Changed definition for public key token from const char*
17699         public_tok_value to guchar public_key_token [17];
17700         * reflection.c: Updated for changes to public key token.
17701
17702 2004-06-22  Lluis Sanchez Gual
17703
17704         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
17705         for the field in base classes.
17706
17707 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
17708
17709         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
17710         mark headers as not supported, they are installed only for use by the
17711         debugger.
17712
17713 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
17714
17715         * *.c, *.h: avoid namespace pollution in public headers.
17716
17717 2004-06-21  Martin Baulig  <martin@ximian.com>
17718
17719         * exception.c (mono_get_exception_security): It's in
17720         "System.Security", not in "System".
17721
17722         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
17723         the exception classes.
17724
17725 2004-06-21  Martin Baulig  <martin@ximian.com>
17726
17727         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
17728         Protect the exception object from being finalized.
17729
17730 2004-06-21  Martin Baulig  <martin@ximian.com>
17731
17732         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
17733         public function.
17734
17735 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
17736
17737         * reflection.c: Load the assembly in mono_reflection_type_from_name,
17738         if it was not loaded before. Fix parts of #60439.
17739
17740 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
17741
17742         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
17743         code that was broken since Ben's change: wrappers are now
17744         dependent on the method signature only again.
17745
17746 2004-06-21  Martin Baulig  <martin@ximian.com>
17747
17748         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
17749         added interface support.
17750
17751 2004-06-21  Martin Baulig  <martin@ximian.com>
17752
17753         * class.c (mono_vtable_get_static_field_data): New public method.
17754
17755 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
17756
17757         * filewatcher.c : Windows build fix to be compliant with API changes.
17758
17759 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
17760
17761         * class.h, class.c: more accessors.
17762         * metadata.h, metadata.c: prepare for hiding MonoType and
17763         MonoMethodSignature: people should use the accessors from now on
17764         outside of the tree.
17765
17766 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
17767
17768         * *.c, *.h: more API cleanups.
17769
17770 2004-06-18  Jackson Harper  <jackson@ximian.com>
17771
17772         * assembly.c: Trace loading assemblies.
17773         * loader.c: Trace loading native libraries.
17774         * mono-config.c: Trace loading config files.
17775         
17776 2004-06-18  Dick Porter  <dick@ximian.com>
17777
17778         * locales.c: Tell ICU the lengths of strings, it can cope with
17779         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
17780
17781 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
17782
17783         * image.c: swapped name/filename;
17784
17785 2004-06-18  Martin Baulig  <martin@ximian.com>
17786
17787         * mono-debug-debugger.c (write_class): Write the parent class at
17788         the end of the header.
17789
17790 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
17791
17792         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
17793
17794 2004-06-17  Raja R Harinath  <rharinath@novell.com>
17795
17796         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
17797         (bundle_obj): New conditional define.
17798         (BUILT_SOURCES): Remove.
17799         ($(bundle_srcs)): Make parallel-make safe.
17800         (libmonoruntime_la_LIBADD): Make unconditional.
17801         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
17802         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
17803
17804 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
17805
17806         * culture-info-tables.h: It was inconsistent with the latest
17807           supp info files.
17808
17809 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
17810
17811         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
17812         be loaded.
17813
17814         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
17815         with gcc 2.95.
17816
17817 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
17818
17819         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
17820         cleaned up public header threads.h.
17821
17822 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
17823
17824         * Makefile.am, *.c, *.h: more API cleanups.
17825
17826 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
17827
17828         * Makefile.am: removed monosn from compilation.
17829         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
17830         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
17831         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
17832         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
17833         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
17834         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
17835
17836 2004-06-15  Jackson Harper  <jackson@ximian.com>
17837
17838         * assembly.c: Make locales lower case when searching the GAC for
17839         assemblies. gacutil will always make locales lowercase when
17840         installing so this effectively makes them case insensitive.
17841         
17842 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
17843
17844         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
17845         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
17846           parameter which allows to choose whether the wait can be interrupted or 
17847           not. Also added the method mono_monitor_enter(), which locks the monitor
17848           using an infinite wait and without allowing interruption.
17849           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
17850           interrupted.
17851         * object.h: Added new fields in MonoThread. suspend_event holds the event
17852           used to susped/resume the thread. synch_lock is the lock object to use for
17853           modifying the thread state.
17854         * threads.c: Use the new synch_lock object for locking, instead of "this",
17855           which can generate deadlocks.
17856           Moved thread state change in Thread.Sleep and Thread.Join from managed
17857           to unmanaged code. This avoids a deadlock when the thread was suspended
17858           just after acquiring the thread lock.
17859           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
17860           Implemented Thread.Suspend using an event instead of ThreadSuspend,
17861           which is not fully implemented in the io-layer.
17862         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
17863
17864 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
17865
17866         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
17867         threads-types.h: more API cleanups.
17868
17869 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
17870
17871         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
17872         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
17873         threadpool.c, threads.c: first pass at the exported API cleanup.
17874
17875 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
17876
17877         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
17878
17879 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17880
17881         * icall.c: added internalGetHome.
17882
17883 2004-06-14  Dick Porter  <dick@ximian.com>
17884
17885         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
17886         possible to return successfully when '.' or '..' were the only
17887         entries in a directory, but were skipped.  The MonoIOStat was not
17888         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
17889         Fixes bug 59574.
17890
17891 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
17892
17893         * reflection.c: make binaries run on .Net 1.1 by default.
17894
17895 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
17896
17897         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
17898
17899 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
17900
17901         * marshal.c: keep track of struct size with explicit layout
17902         (bug #59979).
17903
17904 2004-06-12  Martin Baulig  <martin@ximian.com>
17905
17906         * mono-debug-debugger.c: Comment out a debugging g_message().
17907
17908 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
17909
17910         * reflection.c, reflection.h: do not free custom attrs that are cached.
17911         * icall.c: use braces to make code clearer.
17912
17913 2004-06-11  Martin Baulig  <martin@ximian.com>
17914
17915         * class.h (MonoInflatedField): New type.
17916         (MonoClassField): Replaced `MonoType *generic_type' with
17917         `MonoInflatedField *generic_info'.
17918
17919         * icall.c
17920         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
17921
17922 2004-06-11  Martin Baulig  <martin@ximian.com>
17923
17924         * reflection.c (mono_image_create_method_token): Correctly encode
17925         varargs methods.
17926
17927 2004-06-11  Martin Baulig  <martin@ximian.com>
17928
17929         * metadata.c (mono_metadata_parse_method_signature): When parsing
17930         a MethodDef which has VarArgs, also set sentinelpos if we don't
17931         have any parameters.
17932
17933 2004-06-11  Martin Baulig  <martin@ximian.com>
17934
17935         * verify.c (mono_method_verify): In CEE_CALL, use
17936         mono_method_get_signature() to get the method's signature, unless
17937         we're a PInvoke method.
17938
17939 2004-06-10  Jackson Harper  <jackson@ximian.com>
17940
17941         * assembly.c: Use <path>/lib/mono/gac for the extra paths
17942         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
17943         logical name as the supplied path is just a prefix to the gac not
17944         the direct path to it.
17945         
17946 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
17947
17948         * reflection.c: make the token for a created method match
17949         the token of the MethodBuilder it was created from
17950         (IKVM requires this behaviour now).
17951
17952 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
17953
17954         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
17955         reflection.c, socket-io.c: leak fixes.
17956
17957 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
17958
17959         * icall.c: handle sentinel pos in vararg methods in position different
17960         from 0.
17961
17962 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17963
17964         * culture-info-tables.h: freshly generated.
17965
17966 2004-06-09  Martin Baulig  <martin@ximian.com>
17967
17968         * loader.c (mono_get_method_constrained): Call `mono_class_init
17969         (constrained_class)'.   
17970
17971 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
17972
17973         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
17974         any methods. Fixes #59629.
17975
17976 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
17977
17978         * culture-info-tables.h: reflecting locale-builder updates.
17979
17980 2004-06-08  Dick Porter  <dick@ximian.com>
17981
17982         * object.h:
17983         * locales.c: Fixed compile warnings, including a real bug in
17984         CompareInfo_internal_compare.
17985         
17986 2004-06-08  Dick Porter  <dick@ximian.com>
17987
17988         * locales.c
17989         (ves_icall_System_Globalization_CompareInfo_internal_index):
17990         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
17991         Double-check the resuls of usearches, because ICU currently
17992         ignores most of the collator settings here.  Fixes bug 59720.
17993         
17994 2004-06-08  Dick Porter  <dick@ximian.com>
17995
17996         * locales.c
17997         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
17998         Fix memory leak and segfault-causing typo.  No idea how this one
17999         lasted so long without being noticed.
18000
18001 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
18002
18003         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
18004         any methods. Fixes #59629.
18005
18006 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18007
18008         * assembly.c:
18009         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
18010         own the critical section before). Removed dead code (that's done
18011         in the preload hook).
18012
18013         (mono_assembly_load_with_partial_name): call the preload hook.
18014
18015 2004-06-08  Martin Baulig  <martin@ximian.com>
18016
18017         * metadata.c (mono_metadata_signature_alloc): Default
18018         `sentinelpos' to -1.
18019
18020         * reflection.c (mono_image_get_array_token): Likewise.
18021
18022 2004-06-08  Martin Baulig  <martin@ximian.com>
18023
18024         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
18025
18026         * metadata.c (mono_metadata_parse_method_signature): When parsing
18027         a MethodDef which has VarArgs, set sentinelpos.
18028
18029         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
18030         `gint16' since we're using -1 for non-varargs methods.
18031
18032         * reflection.c
18033         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
18034         (method_encode_signature): Added varargs support.
18035         (method_builder_encode_signature): Likewise.
18036         (mono_image_get_varargs_method_token): New static method.
18037         (mono_image_create_method_token): New public method; this is
18038         called via an icall instead of mono_image_create_token() when
18039         calling a varargs method.       
18040
18041 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
18042
18043         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
18044
18045 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
18046
18047         * culture-info-tables.h : Reflecting the latest locale-builder that
18048           fixed empty array representation ({} to {0}).
18049
18050 2004-06-07  Jackson Harper  <jackson@ximian.com>
18051
18052         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
18053         looking up extra gac paths. This allows MONO_GAC_PATH to act
18054         exactly like a prefix.
18055         
18056 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
18057
18058         * reflection.c (mono_reflection_type_from_name): Make a copy of the
18059         type name before modifying it. Fixes #59405.
18060
18061 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
18062
18063         * culture-info.h: added fields for "all datetime patterns".
18064         * locales.c: (  ves_icall_System_Globalization_CultureInfo
18065           _construct_datetime_format ()): fill xxx_patterns fields.
18066         * object.h: added fields for "all datetime patterns" to
18067           MonoDateTimeFormatInfo.
18068         * culture-info-tables.h: reflecting locale-builder updates.
18069
18070 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
18071
18072         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
18073         the event has no add and remove methods. Fixes #59629.
18074
18075 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
18076
18077         * object.c: Fixed possible integer overflow when allocating large
18078         strings.
18079
18080 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
18081
18082         * culture-info-tables.h: reflecting locale-builder updates.
18083
18084 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
18085
18086         * culture-info-tables.h: reflecting locale-builder updates.
18087
18088 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
18089
18090         * culture-info-tables.h: reflecting locale-builder updates.
18091
18092 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
18093
18094         * threads.c: Made Thread.Sleep abortable.
18095
18096 2004-06-02  Martin Baulig  <martin@ximian.com>
18097
18098         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
18099
18100         * debug-mono-symfile.h: Bumped symbol file version number to 37.
18101
18102 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
18103
18104         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
18105
18106 2004-05-30  Jackson Harper  <jackson@ximian.com>
18107
18108         * reflection.c: Do not hardcode assembly versions or public key
18109         tokens anymore. All of this except the corlib section was dead
18110         code anyways.
18111         
18112 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
18113
18114         * object.c (mono_runtime_invoke_array): Automatically create boxed
18115         objects for byref valuetypes if needed. Fixes #59300.
18116         
18117         * object.c (mono_method_return_message_restore): Handle 
18118         MONO_TYPE_OBJECT as well.
18119
18120 2004-05-28  Jackson Harper  <jackson@ximian.com>
18121
18122         * reflection.c: The modified type encoding was causing build
18123         problems. Reverted for now.
18124         
18125 2004-05-28  Jackson Harper  <jackson@ximian.com>
18126
18127         * reflection.c/h: Take an assembly ref so that we dont create
18128         fully qualified names when encoding types in the same assembly as
18129         the custom attribute being emitted.
18130         * appdomain.c: Increment version number.
18131         
18132 2004-05-26  Duncan Mak  <duncan@ximian.com>
18133
18134         * icall.c
18135         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
18136         Set the full version number (major, minor, build, revision).
18137
18138 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
18139
18140         * marshal.c (emit_struct_conv): increment src/dst after blit
18141         (mono_marshal_get_managed_wrapper,
18142         mono_marshal_get_native_wrapper): make sure we have marshalling
18143         info before marshalling params (info computation affects
18144         blittable)
18145
18146         * class.c (class_compute_field_layout): correctly deal with
18147         blittable
18148         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
18149         value types (as per what windows dows by default)
18150         (mono_class_setup_mono_type): System.ValueType is blittable
18151         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
18152         blittable
18153
18154         * marshal.c (mono_marshal_load_type_info): flag types  as
18155         non-blittable if the native layout doesn't match the managed
18156         layout
18157
18158 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18159
18160         * appdomain.c: don't add stuff in the private search path that is
18161         above the application base. If application base is not set, there's
18162         no private search path.
18163
18164 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
18165
18166         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
18167         byref struct arguments in native->managed marshalling.
18168
18169 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
18170
18171         * marshal.c (mono_marshal_get_runtime_invoke): correctly
18172         cache methods using signature (special case for methods
18173         that are value type or string class)
18174         
18175         * image.c (mono_image_close): clean up allocated GSList's
18176         in runtime_invoke_cache.
18177
18178 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18179
18180         * mono-config.c: set the correct path for mono_cfg_dir on windows when
18181         there's no MONO_CFG_DIR environment variable defined.
18182
18183 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18184
18185         * threads.c: windows version must be >= 0x0500 to include OpenThread.
18186
18187 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
18188
18189         * threadpool.c: Really wait for 500ms after the async call, even if the wait
18190           is interrumped.
18191         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
18192           before waiting for it, and call CloseHandle after the wait to unref it.
18193           This will make sure that handles are not disposed too early.
18194
18195 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18196
18197         * appdomain.c:
18198         * appdomain.h:
18199         * icall.c: removed
18200         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
18201         needed now.
18202
18203         * object.c: se the application_base only for the domain that runs
18204         Main. Fixes bug #59216,
18205
18206 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18207
18208         * appdomain.c:
18209         * object.c: only the domain in which Main is run have
18210         SetupInformation.ConfigurationFile set, so moved a few lines from
18211         appdomain.c to object.c.
18212
18213 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18214
18215         * appdomain.c: we tried to load [name].(dll|exe), but according
18216         to bug #57710, we must also try [culture]/[name].(dll|exe) and
18217         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
18218         There's a test case attached to bug #58922.
18219
18220 2004-05-27  Dick Porter  <dick@ximian.com>
18221
18222         * icall.c:
18223         * file-io.c: Implemented icalls for locking and unlocking regions
18224         in a file.
18225         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
18226         FALSE on error (fixes both compiler warning and real bug.)
18227
18228 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
18229
18230         * culture-info-tables.h: reflecting locale-builder updates.
18231
18232           (Added missing ChangeLog entry for 05/26)
18233
18234 2004-05-27  Jackson Harper  <jackson@ximian.com>
18235
18236         * locales.c: Fix some cut and paste errors.
18237         
18238 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18239
18240         * mono-config.c: set the correct path for config. directory on windows.
18241
18242 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
18243
18244         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
18245           on win32.
18246
18247 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
18248
18249         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
18250         from pinvoke functions.
18251         
18252         * marshal.c (mono_ftnptr_to_delegate): Implement this.
18253
18254 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
18255
18256         * culture-info-tables.h: reflecting locale-builder updates.
18257
18258 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
18259
18260         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
18261         #59086.
18262
18263 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
18264
18265         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
18266         * icall.c: Modified icalls for RNG.
18267         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
18268         Windows (CryptoAPI).
18269
18270 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
18271
18272         * locales.c: Fix build.
18273
18274 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
18275
18276         * culture-info-tables.h: reflecting locale-builder updates.
18277
18278 2004-05-25  Jackson Harper  <jackson@ximian.com>
18279
18280         * locales.c: When creating the current culture use the $LANGs
18281         specific culture. So DateTimeFormat and NumberFormat entries are created.
18282         
18283 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
18284
18285         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
18286         a char array as parameter.
18287
18288 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
18289
18290         * image.c: In mono_image_open(), always use an absolute path name to
18291           look for already loaded images.
18292
18293 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
18294
18295         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
18296         missing in the windows build (like older cygwin include files).
18297
18298 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
18299
18300         * icall.c: Fixed check for possible integer overflow in Buffer_
18301         BlockCopy icall. Replaced comments style // by /* */.
18302
18303 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
18304
18305         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
18306         
18307         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
18308         check after MONO_VTADDR. Fixes pinvoke2.exe.
18309
18310         * marshal.h marshal.c metadata.h: Add beginnings of support for
18311         ftnptr -> delegate marshalling.
18312
18313 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
18314
18315         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
18316         * threads.c: Fix warnings.
18317
18318 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
18319
18320         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
18321         * icall.c: Registered icalls for Suspend and Resume.
18322         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
18323           Thread.Abort.
18324         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
18325         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
18326         * process.c: Use WaitForSingleObjectEx.
18327         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
18328           checkpoints.
18329         * threads.c, threads.h: Make use of new Ex wait methods. Improved
18330           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
18331           for Suspend and Resume. Added new mono_thread_stop, used for stoping
18332           background threads. Added basic support for Abort in Windows.
18333           Start new threads using a managed delegate invoke wrapper. This wrapper
18334           has an interruption checkpoint that is needed since an interruption
18335           can be requested before the thread leaves the unmanaged code that starts 
18336           the thread.
18337         * marshal.c: Added interruption checkpoint after every native call, and
18338           also before managed calls for wrappers called from unmanaged code to
18339           go into managed code.
18340         * object.h: Added new field in MonoThread to keep track of interruption
18341           requests.
18342
18343 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
18344
18345         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
18346         calls.
18347
18348 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18349
18350         * appdomain.c:
18351         * assembly.c:
18352         * gc.c:
18353         * locales.c:
18354         * mono-config.c:
18355         * rand.c: getenv -> g_getenv (windows!)
18356
18357         * process.c: complete_path is also used on non-windows platforms.
18358
18359 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18360
18361         * icall.c: new signature for Process_Start.
18362
18363         * process.[ch]: new signature for Process_Start. If we're on windows
18364         and UseShellExecute is false, we have to search for the program by
18365         ourselves if we don't get a full path.
18366
18367 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
18368
18369         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
18370         marshalling and call CleanUpNativeData if needed. Fixes #58646.
18371
18372 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18373
18374         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
18375         Fixes bug #58373.
18376
18377 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18378
18379         * process.c: use double quotes to quote program name and arguments on
18380         windows. Fixes bug #58575.
18381
18382 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18383
18384         * file-io.c: don't return "." and ".." when using windows Find*File.
18385
18386 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
18387
18388         * marshal.c: Don't pass wrappers to message init because method 
18389         addressed used to lookup metadata. part of remoting[2|3] fix.
18390
18391 2004-05-15  Jackson Harper  <jackson@ximian.com>
18392
18393         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
18394         path is essentially the same as MONO_PATH except that it points to
18395         GACs instead of lib directories.
18396         * loader.h: The user gac is gone so we dont need function to
18397         enable/disable it.
18398         * mono-config.c: user gac option is now gone.
18399         
18400 2004-05-15  Jackson Harper  <jackson@ximian.com>
18401
18402         * culture-info.h: Make defines more consistent, add calendar data
18403         to the culture info table.
18404         * culture-info-tables.h: Add basic calendar data. Basically
18405         everyone gets default gregorian until all the data is
18406         updated.
18407         * locales.c: Use the new consistent defines. Set calendar data for
18408         culture info objects.
18409         * object.h: add a field for calendar data to CultureInfo
18410         
18411 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
18412
18413         * image.c: image->runtime_invoke_cache is keyed on signatures now.
18414         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
18415         a signature.
18416         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
18417         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
18418         an extra param that is the pointer of the method to invoke. The IL for
18419         the invoke method is no longer specific to the method, but to the
18420         signature of the method. Thus, we can share the same code for multiple
18421         methods. This reduces the number of methods that have to be compiled.
18422
18423 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
18424
18425         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
18426
18427         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18428
18429         * icall.c: Optimize Buffer.BlockCopy.
18430
18431 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18432
18433         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
18434         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
18435         quote). Changed them to "MMMM yyyy".
18436
18437 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
18438
18439         * rand.c
18440         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
18441
18442 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
18443
18444         * reflection.h: Updated after changes to managed structures.
18445
18446         * appdomain.c: Bump corlib version.
18447
18448 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18449
18450         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
18451         windows.
18452
18453 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18454
18455         * Makefile.am: link to ../os/libmonoos.la on windows.
18456
18457         * assembly.c:
18458                 -If MONO_DEBUG, warn about non-existing directories in
18459                 MONO_PATH.
18460                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
18461                 compile time variable.
18462                 -Removed init_default_path and call mono_set_rootdir from
18463                 libmonoos.a instead (windows only).
18464
18465         * assembly.h: declare mono_assembly_getrootdir().
18466
18467         * domain.c:
18468         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
18469
18470         * loader.c: s/getenv/g_getenv/
18471
18472 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
18473
18474         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
18475
18476         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
18477
18478         * metadata.h: Add new marshalling conversions.
18479
18480         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
18481         function.
18482
18483         * reflection.c (mono_reflection_get_type): Lookup the type in all
18484         modules of a multi-module assembly. Fixes #58291.
18485
18486 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
18487
18488         * threads.c: Before aborting a background, set the StopRequested
18489         state.  This avoids throwing the Abort exception.
18490         In mono_thread_manage, don't continue with the shutdown until all
18491         aborted threads have actually stopped.
18492
18493 2004-05-10  Jackson Harper  <jackson@ximian.com>
18494
18495         * locales.c: Remove the modifier from culture names.
18496         
18497 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18498
18499         * Makefile.am: monosn is not installed any more. It has been deprecated
18500         in favor of sn.
18501
18502 2004-05-07  Jackson Harper  <jackson@ximian.com>
18503
18504         * locales.c
18505         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
18506         Fix array construction, add bailout if the length is 0.
18507
18508 2004-05-07  Dick Porter  <dick@ximian.com>
18509
18510         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
18511         machine doesn't have a DNS entry.  Patch by Urs Muff
18512         (umuff@quark.com), fixes bug 57928.
18513
18514 2004-05-06  Jackson Harper  <jackson@ximian.com>
18515
18516         * reflection.c: Handle null PublicTokens properly. alloc mem for
18517         assembly names culture so we dont crash when freeing it.
18518         
18519 2004-05-06  Jackson Harper  <jackson@ximian.com>
18520
18521         * assembly.c: Check the usergac when loading with partial names.
18522         
18523 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
18524
18525         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
18526         does nothing for now (not required for Linux/Windows) but the class
18527         library can call it (and a newer or modified runtime could need it).
18528         * icall.c: Registred icall.
18529
18530 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18531
18532         * loader.c: prints a message on module loading error we set MONO_DEBUG
18533         environment variable.
18534
18535 2004-05-05  Jackson Harper  <jackson@ximian.com>
18536
18537         * appdomain.c: Handle PublicKeyToken=null properly.
18538         
18539 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
18540
18541         * environment.c|h: Added icall ves_icall_System_Environment_
18542         GetOSVersionString to get the current OS version as a string.
18543         * icall.c: Registred icall.
18544
18545 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
18546
18547         * object.c: in mono_object_get_virtual_method(), take into account that
18548         non-virtual methods don't have a slot in the vtable. Check needed when
18549         the object is a proxy.
18550
18551 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
18552
18553         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
18554         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
18555
18556         * object.c (mono_class_compute_gc_descriptor): Fix warning.
18557
18558         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
18559         passed when a valuetype is expected.
18560
18561         * object.c (mono_unhandled_exception): Only set the exit code if the
18562         exception happens in the main thread. Fixes thread5.exe.
18563
18564         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
18565         invalid names. Fixes #58047.
18566
18567 2004-05-03  Jackson Harper  <jackson@ximian.com>
18568
18569         * assembly.c: This line was committed accidently and is unneeded.
18570         
18571 2004-05-03  Jackson Harper  <jackson@ximian.com>
18572
18573         * icall.c: Add new icall for Assembly::LoadWithPartialName
18574         * assembly.c/.h: new function that probes the GAC to load partial
18575         assembly names by Paolo Molaro.
18576         
18577 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18578
18579         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
18580         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
18581         (type_get_fully_qualified_name): Added PublicKeyToken when building a
18582         full type name.
18583
18584 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18585
18586         * appdomain.c: fixed check for 'neutral' culture and removed warning.
18587         * reflection.c: fix bug when parsing a full type name and Version is not
18588         the last thing in the string.
18589
18590 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
18591
18592         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
18593         crashes when it is freed.
18594
18595 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18596
18597         * assembly.c: print the compat warning to stderr.
18598
18599 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
18600
18601         * assembly.c (mono_assembly_load_references): Add a compatibility
18602         hack to run old applications that might be still referencing the
18603         3300-based assemblies, only do this for System.xxx.
18604
18605 2004-05-01  Jackson Harper  <jackson@ximian.com>
18606
18607         * appdomain.c: If the culture is neutral we set it to "".
18608         
18609 2004-04-29  Jackson Harper  <jackson@ximian.com>
18610
18611         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
18612
18613 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
18614  
18615         * string-icalls.c: added low overhead function for copying chars
18616         * icall.c: added needed icall for the above function
18617  
18618 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18619
18620         * icall.c: fix return value of get_global_assembly_cache.  Implemented
18621         Environment.GetLogicalDrives.
18622
18623 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
18624
18625         * rand.c: try and talk to egd or prngd
18626         for random bytes if opening devices fail.
18627
18628 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
18629
18630         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
18631         alignment for the type using the native alignment of its members 
18632         instead of using klass->min_align.
18633
18634         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
18635
18636 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18637
18638         * file-io.c:
18639         * socket-io.c: added check for sys/aio.h.
18640
18641 2004-04-28  Dick Porter  <dick@ximian.com>
18642
18643         * threads.c: Don't abort a thread thats already aborting, when
18644         terminating everything.
18645
18646 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18647
18648         * icall.c: added 2 new async calls for Socket.
18649
18650         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
18651         IO on *nix systems.
18652
18653         * threadpool.c: removed unused variable.
18654
18655 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
18656
18657         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
18658
18659 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
18660
18661         * locales.c: put back string_invariant_tolower () and
18662         string_invariant_toupper ().
18663
18664 2004-04-26 David Waite <mass@akuma.org>
18665
18666         * file-io.h:
18667         * socket-io.h:
18668         * threads.h:
18669         * unicode.h: remove comma from end of enumeration declarations
18670
18671 2004-04-26 David Waite <mass@akuma.org>
18672
18673         * debug-mono-symfile.h:
18674         * decimal.c:
18675         * mono_debug.h:
18676         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
18677
18678
18679 2004-04-26  Jackson Harper  <jackson@ximian.com>
18680
18681         * appdomain.c: Increment version number.
18682         
18683 2004-04-26  Jackson Harper  <jackson@ximian.com>
18684
18685         * appdomain.c: Set assembly references public token value when
18686         PublicKeyToken is specified, not the hash_value. Free public token
18687         values when free assembly name data. Previously the public key
18688         token was hex decoded, however we are using hex encoded public key
18689         tokens, so this is not neccasary.
18690         * assembly.c: Lookup assemblies in the gac if their public token
18691         value is set. Add function to allow enabling user gac
18692         lookups. Specify whether or not the assembly was loaded from the
18693         GAC. Compare full assembly names when checking the cache for
18694         assemblies (Temporarily disabled see comment in code). Remove
18695         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
18696         specifies trace-loader they get extra info to stdout on the
18697         loading of assemblies.
18698         * image.h: Add a field for an assembly references public token
18699         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
18700         whether an assembly has been loaded from the GAC.
18701         * image.c: Remove a corlib -> mscorlib name mapping.
18702         * loader.h: Add function to enable/disable the user gac.
18703         * mono-config.c: Check if the usergac is enabled in the config
18704         file.
18705         * icall.c: New icall to determine whether or not an assembly has
18706         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
18707         * tabldefs.h: Add constant for assemblyref flag that specifies a
18708         full public key is used instead of a public token.
18709         * reflection.c: Remove mscorlib -> corlib mappings. Set
18710         PublicTokenValue instead of hash value. This value is a hex
18711         string so it does not need to be expanded.
18712
18713 2004-04-26  Martin Baulig  <martin@ximian.com>
18714
18715         * mono-debug-debugger.c (mono_debugger_initialize): Set
18716         `mono_debugger_initialized' before calling mono_debug_lock().
18717
18718 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
18719
18720         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
18721           InternalToUpper/InternalToLower.
18722         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
18723           removed invariant culture shortcut.  This is now done in managed code.
18724         * locales.c: (string_invariant_toupper/tolower) removed.
18725
18726 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18727
18728         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
18729         Added Poll internal call.
18730
18731         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
18732         call for Poll. Select was too heavy for polling a single socket.
18733
18734         * threadpool.[ch]: added mono_threadpool_cleanup.
18735         * threads.c: use it. Don't use Thread_Abort on windows.
18736
18737 2004-04-23  Martin Baulig  <martin@ximian.com>
18738
18739         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
18740
18741 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
18742
18743         * icall.c: Registred new icalls for key pair protection and added an
18744         icall for Environment.GetFolderPath on Windows.
18745         * security.c|h: Added new icalls for key pair protection.
18746
18747 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18748
18749         * socket-io.c: don't display the non-supported family warning for known
18750         families. Now this is not displayed on windows when checking support
18751         for IPv4/IPv6.
18752
18753 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18754
18755         * class.c: don't display the layout warning for static fields.
18756
18757 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
18758
18759         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
18760         * locales.c, locales.h: Added new icalls for culture-specific
18761         Char.ToLower and Char.ToUpper.
18762
18763 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18764
18765         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
18766         by David Waite.
18767
18768 2004-04-20  Martin Baulig  <martin@ximian.com>
18769
18770         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
18771         of the type name before passing it to mono_reflection_type_from_name().
18772
18773 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
18774
18775         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
18776         encodings here. Fixes #56965.
18777
18778 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
18779
18780         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
18781         fix test on strstr result not that I can see anything that
18782         relies on the result.
18783
18784 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
18785
18786         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
18787         Fixes #57081.
18788
18789         * marshal.c (mono_marshal_get_string_encoding): New helper function.
18790
18791         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
18792         function to determine which marshalling to use for strings. Fixes
18793         #56965.
18794
18795         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
18796
18797         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
18798
18799 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
18800
18801         * icall.c: #include mono-config.h
18802
18803 2004-04-15  Jackson Harper  <jackson@ximian.com>
18804
18805         * culture-info-tables.h: Fix date formats for en-US culture.
18806         
18807 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
18808
18809         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
18810         ThreadPool.SetMinThreads.
18811         * threadpool.c: Implemented ThreadPool.GetMinThreads and
18812         ThreadPool.SetMinThreads.
18813
18814 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
18815
18816         * mono-config.c: also load the .config file in the directory
18817         where the assembly was found.
18818
18819 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
18820
18821         * assembly.c: load per-assembly config files.
18822         * icall.c: decrapified code to get the config dir and moved to
18823         mono-config.c.
18824         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
18825         per-assembly config files. When doing a dll map lookup give precedence
18826         to the per-assembly data.
18827
18828 2004-04-14  Martin Baulig  <martin@ximian.com>
18829
18830         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
18831         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
18832         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
18833
18834         * mono-debugger-debugger.c: While the debugger is locked, remember
18835         whether the symbol tables have changes and send one single
18836         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
18837
18838 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
18839
18840         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
18841
18842         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
18843         function.
18844
18845         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
18846         account when marshalling string arrays. Fixes #56965.
18847
18848 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
18849
18850         * icall.c: Add new icalls mapping for security.
18851         * security.c|h: Add internal calls for WindowsIdentity,
18852         WindowsImpersonationContext and WindowsPrincipal.
18853
18854 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
18855
18856         * class.c: Added comment to ensure the System.MonoDummy class
18857         is removed when no longer necessary
18858
18859 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
18860
18861         * appdomain.c: Pass arguments to the bootstraping exceptions to
18862         minimize JITed methods at boot
18863
18864         * metadata.c (mono_exception_from_name_two_strings): Allow for the
18865         second string to be null.
18866
18867         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
18868         Change the protocol to minimize the JIT methods at startup.  Now
18869         it Returns the internal codepage, if the value of "int_code_page"
18870         is 1 at entry, and we can not compute a suitable code page
18871         number, returns the code page as a string.
18872
18873 2004-04-13  Jackson Harper  <jackson@ximian.com>
18874
18875         * culture-info-tables.h: Fix number of decimal digits for all
18876         english locales.
18877
18878 2004-04-13  Jackson Harper  <jackson@ximian.com>
18879
18880         * icall.c: Clairfy out of sync error message. It is not always
18881         your corlib that is out of sync.
18882
18883 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
18884
18885         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
18886         properties when only the set accessor is overriden. Fixes #55874.
18887
18888 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
18889
18890         * assembly.c (mono_assembly_load_references): Make this thread safe.
18891         Fixes #56327.
18892
18893 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
18894
18895         * monosn.c: Add missing initialization calls.
18896
18897 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
18898
18899         * locales.c:
18900         ves_icall_System_Globalization_CultureInfo_construct_number_format
18901         Fix g_assert so it compiles on fussier compilers re int/ptr
18902         mismatch
18903
18904 2004-04-08  Dick Porter  <dick@ximian.com>
18905
18906         * socket-io.h:
18907         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
18908         53992.  Also rearrange the code so that the internal calls return
18909         an error value and exceptions are thrown from managed code.
18910
18911         * icall.c: Add type info to the socket icalls.
18912
18913 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18914
18915         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
18916         owes me a beer.
18917
18918 2004-04-07  Martin Baulig  <martin@ximian.com>
18919
18920         * class.c (mono_class_from_generic_parameter): Don't default
18921         `klass->parent' to `mono_defaults.object_type'.
18922
18923 2004-04-07  Martin Baulig  <martin@ximian.com>
18924
18925         * reflection.c (mono_reflection_initialize_generic_parameter): Set
18926         `param->pklass->reflection_info'.       
18927
18928 2004-04-07  Jackson Harper  <jackson@ximian.com>
18929
18930         * culture-info-tables.h: Fix date separator symbol.
18931         
18932 2004-04-07  Martin Baulig  <martin@ximian.com>
18933
18934         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
18935         from System.Type to System.MonoType.
18936
18937 2004-04-07  Martin Baulig  <martin@ximian.com>
18938
18939         * reflection.h
18940         (MonoReflectionGenericParam): Added `has_reference_type' and
18941         `has_value_type' fields.
18942
18943         * reflection.c (mono_image_get_generic_param_info): Encode the
18944         correct flags if we have the `class' or `struct' constraint.
18945
18946 2004-04-07  Martin Baulig  <martin@ximian.com>
18947
18948         * reflection.h
18949         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
18950
18951 2004-04-07  Jackson Harper  <jackson@ximian.com>
18952
18953         * appdomain.c: Revert extra patches, just wanted to bump the
18954         version number.
18955         
18956 2004-04-07  Jackson Harper  <jackson@ximian.com>
18957
18958         * Makefile.am: Add culture-info private headers.
18959         * icall.c: Add new icalls for contructing locales.
18960         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
18961         * locales.h: Declare new culture info construction methods.
18962         * object.h: Add new fields used to avoid the CultureMap to
18963         MonoCultureInfo.
18964         * culture-info.h: Definition of structs used in the culture info
18965         tables.
18966         * culture-info-tables.h: Autogenerated tables that contain culture
18967         info data. This file was generated with the locale-builder tool.
18968         * appdomain.c: Incement corlib version number.
18969         
18970 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
18971
18972         * appdomain.c: (mono_runtime_init) move mono_thread_init
18973         to before mono_object_new calls so critical sections
18974         are initialized before use.
18975
18976 2004-04-07  Martin Baulig  <martin@ximian.com>
18977
18978         * icall.c
18979         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
18980         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
18981         (ves_icall_MonoGenericParam_initialize): Removed.
18982         (monogenericparam_icalls): Removed.
18983         (generictypeparambuilder_icalls): Added new table for
18984         System.Reflection.Emit.GenericTypeParameterBuilder.
18985
18986         * reflection.c
18987         (mono_reflection_define_generic_parameter): Removed.
18988         (mono_reflection_initialize_generic_parameter): This is now called
18989         from GenericTypeParameterBuilder's .ctor.
18990
18991 2004-04-06  Martin Baulig  <martin@ximian.com>
18992
18993         * class.c (mono_class_init): Don't inflate nested classes in a
18994         generic instance.
18995         (mono_type_get_name_recurse): Include the generic arguments for
18996         generic instances and generic type declarations.
18997         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
18998         (_mono_class_get_instantiation_name): Removed.
18999         (mono_class_create_generic): Always use `gklass->name' as our name.
19000
19001         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
19002
19003         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
19004         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
19005         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
19006         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
19007         closed generic methods here.
19008
19009         * reflection.c
19010         (mono_reflection_generic_inst_get_nested_types): Removed.
19011         (inflate_mono_method): Copy the generic parameters from the
19012         MonoMethodHeader into out MonoGenericMethod.
19013
19014 2004-04-06  Martin Baulig  <martin@ximian.com>
19015
19016         * row-indexes.h
19017         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
19018
19019         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
19020
19021         * reflection.c (build_compressed_metadata): If we have any entries
19022         in the GenericParam, MethodSpec or GenericParamConstraint tables,
19023         set the header version to 1.1.
19024
19025 2004-04-06  Martin Baulig  <martin@ximian.com>
19026
19027         * class.c (mono_class_init): If we're a generic instance,
19028         initialize our nested classes, too.
19029         (_mono_class_get_instantiation_name): Deal with the new `!%d'
19030         suffix. 
19031
19032 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19033
19034         * process.c: quote the argument passed to the shell on windows.
19035
19036 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
19037
19038         * threads.c (mono_alloc_special_static_data): Allow this to be
19039         called during startup.
19040
19041 2004-04-02  Martin Baulig  <martin@ximian.com>
19042
19043         * icall.c
19044         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
19045
19046 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
19047
19048         * icall.c: Fix build.
19049
19050 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
19051
19052         * Makefile.am: Added security.c|h.
19053         * icall.c: Added icall for get_UserName;
19054         * security.c: New file for security related icalls. Added function
19055         get_UserName for System.Environment (fix #56144).
19056         * security.h: New. Header file for security.c
19057
19058 2004-04-02  Dick Porter  <dick@ximian.com>
19059
19060         * icall.c: Deleted the icalls that were obsoleted some time ago
19061         by the ICU string code, and which were mixed into the icall
19062         rearranging.  Fixes bug 55969.
19063
19064         * string-icalls.h: 
19065         * string-icalls.c: Deleted the code that those icalls reference.
19066
19067 2004-04-01  Martin Baulig  <martin@ximian.com>
19068
19069         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
19070
19071         * class.c (mono_class_from_generic_parameter): Don't set 
19072         TYPE_ATTRIBUTE_INTERFACE.
19073         (my_mono_class_from_generic_parameter): Likewise.
19074
19075 2004-04-01  Martin Baulig  <martin@ximian.com>
19076
19077         * loader.c (find_method): Added an optional `MonoClass *ic'
19078         argument to search in a specific interface.
19079         (mono_get_method_constrained): New public function.
19080
19081 2004-04-01  Martin Baulig  <martin@ximian.com>
19082
19083         * reflection.c (mono_image_get_generic_field_token): Use the
19084         `handleref' cache here.
19085
19086 2004-04-01  Martin Baulig  <martin@ximian.com>
19087
19088         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
19089
19090         * reflection.c (create_generic_typespec): Use the `typespec' hash
19091         here, not the `typeref' one.    
19092
19093 2004-04-01  Martin Baulig  <martin@ximian.com>
19094
19095         * class.c (mono_class_inflate_generic_type): Moved the
19096         functionality into a new static inflate_generic_type() which
19097         returns NULL if it didn't do anything.  Only increment the
19098         `mono_stats.inflated_type_count' if we actually inflated
19099         something.
19100         (mono_class_get_full): Check the classes type to see whether we
19101         need to inflate it; also inflate MONO_TYPE_(M)VAR.
19102
19103 2004-04-01  Jackson Harper  <jackson@ximian.com>
19104
19105         * reflection.c: Set culture for assembly references.
19106         
19107 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
19108
19109         * reflection.[ch], icall.[ch], Fix support for pinning variables.
19110
19111 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19112
19113         * assembly.c:
19114         (do_mono_assembly_open): the critical section also covers
19115         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
19116
19117 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19118
19119         * threads.c:
19120         (mono_manage_threads): abort the background threads when finishing.
19121         Fixes bug #47232.
19122
19123 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19124
19125         * gc.c: only close the done_event handle if there was no timeout.
19126         C-ified comments.
19127
19128 2004-03-30  Martin Baulig  <martin@ximian.com>
19129
19130         * icall.c (icall_entries): It's called "System.Activator", not
19131         "System.Activation".    
19132
19133 2004-03-30  Martin Baulig  <martin@ximian.com>
19134
19135         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
19136         (mono_class_create_from_typespec): Likewise.
19137
19138 2004-03-30  Martin Baulig  <martin@ximian.com>
19139
19140         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
19141         `has_ctor_constraint' and `initialized'.
19142
19143 2004-03-30  Martin Baulig  <martin@ximian.com>
19144
19145         * reflection.c (encode_new_constraint): New static function to add
19146         the constructor constraint attribute to a type parameter.
19147         (encode_constraints): Call encode_new_constraint() if necessary.
19148
19149         * reflection.h
19150         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
19151
19152         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
19153         
19154 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
19155
19156         * reflection.c, icall.c: add support for pinning variables. 
19157
19158 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
19159
19160         * marshal.c (mono_marshal_get_managed_wrapper):
19161         init bool local with zero rather than null.
19162
19163 2004-03-29  Martin Baulig  <martin@ximian.com>
19164
19165         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
19166         the "official" behavior here.
19167         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
19168
19169 2004-03-29  Martin Baulig  <martin@ximian.com>
19170
19171         * icall.c: Reflect latest API changes.
19172
19173 2004-03-29  Martin Baulig  <martin@ximian.com>
19174
19175         * loader.c (mono_get_method_from_token): Also call
19176         mono_metadata_load_generic_params () for abstract and interface
19177         methods; replace the type arguments in the method signature with
19178         the ones which are loaded from the metadata.
19179
19180 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
19181
19182         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
19183         of the lock is not the current thread. MS.NET don't do it, in spite of
19184         what the documentation says. See bug #56157.
19185
19186 2004-03-28  Martin Baulig  <martin@ximian.com>
19187
19188         * class.c (mono_class_init): Don't call init_properties() and
19189         init_events() for generic instances; set `prop->parent' when
19190         inflating properties.
19191
19192         * reflection.c (mono_generic_inst_get_object): Call
19193         `mono_class_init (ginst->klass)'.
19194         (mono_type_get_object): Only create a MonoGenericInst if your
19195         generic type is a TypeBuilder.
19196         (do_mono_reflection_bind_generic_parameters): Only set
19197         `ginst->is_dynamic' if our generic type is a TypeBuilder.
19198
19199 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
19200
19201         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
19202         Fixes #56091.
19203
19204 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19205
19206         * icall.c: added Kill_internal icall.
19207         * process.[ch]: added Kill_internal icall.
19208
19209 2004-03-25  Martin Baulig  <martin@ximian.com>
19210
19211         * class.h (MonoStats): Added `generic_instance_count',
19212         `inflated_method_count', `inflated_type_count' and
19213         `generics_metadata_size'.       
19214
19215 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19216
19217         * reflection.c: no warnings now.
19218
19219 2004-03-25  Martin Baulig  <martin@ximian.com>
19220
19221         * class.c (mono_class_get_full): New public function; does a
19222         mono_class_get(), but also takes a `MonoGenericContext *'.
19223
19224         * loader.c (mono_field_from_memberref): Renamed to
19225         `field_from_memberref', made static and added `MonoGenericContext *'
19226         argument.
19227         (mono_field_from_token): Added `MonoGenericInst *' argument.
19228         (method_from_memberef): Likewise.
19229         (mono_get_method_from_token): Likewise.
19230         (mono_get_method_full): New public function; does a
19231         mono_get_method(), but also takes a `MonoGenericContext *'.
19232
19233         * verify.c (mono_method_verify): Get the method's generic context
19234         and pass it to mono_field_from_token(), mono_get_method_full() and
19235         mono_class_get_full().
19236
19237 2004-03-25  Martin Baulig  <martin@ximian.com>
19238
19239         * class.c (mono_class_inflate_generic_type): Take a
19240         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
19241         `MonoGenericMethod *'.
19242
19243 2004-03-25  Martin Baulig  <martin@ximian.com>
19244
19245         * loader.h (MonoMethodInflated): Store the MonoGenericContext
19246         instead of the MonoGenericMethod here.
19247
19248 2004-03-25  Martin Baulig  <martin@ximian.com>
19249
19250         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
19251         each time we create a new MonoGenericInst, we also create a new
19252         context which points back to us.
19253
19254         * class.c (inflate_method): Use `ginst->context' instead of
19255         creating a new context.
19256
19257         * loader.c (method_from_memberref): Use
19258         `klass->generic_inst->context' instead of creating a new context.
19259
19260 2004-03-25  Martin Baulig  <martin@ximian.com>
19261
19262         * class.h (MonoGenericContext): New struct.
19263         (MonoGenericMethod): Removed `generic_inst'.
19264
19265         * class.c (mono_class_inflate_generic_method): Take a
19266         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
19267
19268 2004-03-25  Martin Baulig  <martin@ximian.com>
19269
19270         * loader.h (MonoMethodInflated): New typedef.
19271
19272         * metadata.h (MonoMethodSignature): Removed `gen_method', make
19273         `generic_param_count' consume just 30 bits, added `is_inflated'
19274         and `has_type_parameters' flags (one bit each).
19275
19276         * class.c (mono_class_inflate_generic_method): Create a
19277         MonoMethodInflated instead of a MonoMethodNormal and set
19278         `is_inflated' in the method signature.
19279
19280         * class.h (MonoGenericMethod): Removed `generic_method'.
19281
19282 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
19283
19284         * image.c: Make sure the name of a MonoImage is always an absolute path.
19285           This fixes bug #54415.
19286
19287 2004-03-24  Martin Baulig  <martin@ximian.com>
19288
19289         * class.c (mono_class_setup_vtable): If we're a generic instance,
19290         use our generic type's vtable size.
19291
19292 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
19293
19294         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
19295         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
19296         problems.
19297
19298 2004-03-23  Martin Baulig  <martin@ximian.com>
19299
19300         * class.h (MonoDynamicGenericInst): Added `int count_events' and
19301         `MonoEvent *events'.
19302
19303         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
19304         (typebuilder_icalls): Added "get_event_info"; calls
19305         mono_reflection_event_builder_get_event_info(). 
19306
19307         * reflection.c (mono_reflection_generic_inst_initialize): Added
19308         `MonoArray *events'.
19309         (mono_reflection_event_builder_get_event_info): New function.
19310
19311 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
19312
19313         * object.h: add mono_type_initialization_init
19314
19315         * object.c (mono_runtime_class_init): 
19316         implement class constructor synchronization rules
19317         to cope with threading issues.  
19318         add mono_type_initialization_init
19319
19320         * appdomain.c (mono_runtime_init): call 
19321         mono_type_initialization_init
19322
19323         * class.h: removing initializing field from MonoVTable
19324
19325 2004-03-23  Martin Baulig  <martin@ximian.com>
19326
19327         * class.c (my_mono_class_from_generic_parameter): Use
19328         `param->name' if it's not NULL. 
19329
19330 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
19331
19332         * class.c: do not insert non-virtual methods in the vtable.
19333         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
19334         that means the method is non-virtual. This never would have
19335         happened before.
19336
19337 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
19338
19339         * profiler.c: Added lock for accessing coverage_hash.
19340
19341 2004-03-22  Martin Baulig  <martin@ximian.com>
19342
19343         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
19344         `method->method->signature->generic_param_count != 0' to make it
19345         work for interface methods.
19346
19347 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19348
19349         * process.c: quote the string passed to the shell using g_shell_quote.
19350
19351 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19352
19353         * threads.c:
19354         (mono_threads_manage): don't remove the finalizer thread and self
19355         from the threads hash table so that mono_thread_manage can be called
19356         more than once.
19357
19358 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19359
19360         * process.c: quote the arguments when UseShellExecute is true. Fixes
19361         bug #55790.
19362
19363 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19364
19365         * threads.c: set mono_thread_detach as a cleanup routine for every
19366         thread. This way it's always executed upon thread termination, either
19367         aborted or finished normally. No more xsp hangs!
19368
19369 2004-03-17  Martin Baulig  <martin@ximian.com>
19370
19371         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
19372         `int count_nested' and a `MonoType **nested'.
19373
19374         * reflection.c (mono_reflection_bind_generic_parameters): Moved
19375         most of the functionality into a new static
19376         do_mono_reflection_bind_generic_parameters() and don't take a
19377         `MonoType *nested_in' argument any more.  Don't compute nested
19378         types here.
19379         (mono_reflection_generic_inst_get_nested_types): New public method
19380         to get nested types.
19381
19382         * class.c (mono_class_create_generic): Set `klass->nested_in' if
19383         we're a nested class.
19384
19385         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
19386         mono_reflection_generic_inst_get_nested_types() to compute the
19387         nested types.
19388
19389 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
19390
19391         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
19392         descriptive error message under windows.
19393         
19394 2004-03-17  Martin Baulig  <martin@ximian.com>
19395
19396         * class.c (dup_type): Added `const MonoType *original' argument;
19397         copy the attrs from the original type.
19398
19399 2004-03-17  Martin Baulig  <martin@ximian.com>
19400
19401         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
19402         `m->generic_inst_cache' here.
19403
19404 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
19405
19406         * exception.h exception.c: Add stack_overflow_exception.
19407
19408 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19409
19410         * threadpool.c:
19411         (overlapped_callback): call SetEvent *after* invoking the callback.
19412         No need to call CloseHandle.
19413
19414 2004-03-16  Martin Baulig  <martin@ximian.com>
19415
19416         * reflection.c (mono_image_get_fieldref_token): Take a
19417         `MonoReflectionField *' instead of a `MonoClassField *' and a
19418         `MonoClass *'; store the `MonoReflectionField *' in the hash.
19419
19420 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19421
19422         * appdomain.c: don't add the culture to the filename we're looking for
19423         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
19424
19425 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19426
19427         * locales.c: don't ignore symbols when doing case insensitive compares.
19428         Thanks Dick! Fixes bug #54046.
19429
19430         * threads.c: surround 'threads' usage with enter/leave in
19431         mono_thread_manage.
19432
19433 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
19434
19435         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
19436         implicitly marshalled as [Out]. Fixes #55450.
19437
19438         (mono_marshal_get_runtime_invoke): Zero out the result if there is
19439         an exception.
19440
19441 2004-03-16  Martin Baulig  <martin@ximian.com>
19442
19443         * class.c (mono_class_from_generic_parameter): Use the actual
19444         parameter name. 
19445
19446 2004-03-16  Martin Baulig  <martin@ximian.com>
19447
19448         * reflection.c (type_get_signature_size): New static function.
19449         Compues the size of the type in a method signature.
19450         (method_get_signature_size): New static function; calls
19451         type_get_signature_size() to compute the actual size of the
19452         method's signature.
19453         (method_encode_signature): Use method_get_signature_size() to get
19454         the signature's size rather than using `nparams * 10'.
19455
19456 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19457
19458         * file-io.h: define here WapiOverlapped on windows. I don't want the
19459         regular OVERLAPPED one.
19460
19461         * file-io.c:
19462         * threadpool.c: somehow, BindIoCompletionCallback is not found.
19463         Disabling AIO on windows.
19464
19465 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19466
19467         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
19468         bug #55385.
19469
19470 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19471
19472         * appdomain.c: upgraded corlib version.
19473
19474         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
19475         and BeginWrite. Allow opening files for asynchrnous operations.
19476
19477         * file-io.h: new struct that maps FileStreamAsyncResult.
19478         * icall.c: added new icalls.
19479         * process.[ch]: support setting child process environment variables
19480         and use the SHELL or COMSPEC when UseShellExecute is true.
19481
19482         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
19483         callback for async. IO is here and also BindHandle.
19484
19485         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
19486         from here.
19487
19488 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
19489
19490         * reflection.c (create_custom_attr): Allow len == 0.
19491
19492         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
19493         computation on big-endian machines.
19494
19495 2004-03-13  Martin Baulig  <martin@ximian.com>
19496
19497         * class.h (MonoGenericInst): Added `int count_ifaces'.
19498
19499         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
19500         `ginst->count_ifaces' instead `klass->interface_count' since we
19501         may get called before the vtable is created.
19502
19503         * loader.c (mono_method_get_param_names): If we're a generic
19504         instance, return and don't initialize the class.
19505
19506         * reflection.c (mono_reflection_setup_generic_class): Don't call
19507         ensure_runtime_vtable().
19508         (mono_reflection_bind_generic_parameters): Set
19509         `ginst->count_ifaces'.
19510
19511 2004-03-11  Jackson Harper <jackson@ximian.com>
19512
19513         * icall.c:
19514         * unicode.c:
19515         * unicode.h: Remove unused System.Char icalls.
19516         
19517 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
19518
19519         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
19520         code when we P/Invoke the first library in Windows.Forms, instead
19521         of when we first open the assembly.
19522
19523         * assembly.c: Drop the lookup from here.
19524
19525 2004-03-10  Martin Baulig  <martin@ximian.com>
19526
19527         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
19528         class for properties, fields and events.  Finally fixes #54945.
19529
19530 2004-03-10  Martin Baulig  <martin@ximian.com>
19531
19532         * metadata.c (mono_metadata_class_equal): New static function;
19533         checks whether two generic instances or two generic parameters are
19534         equal.
19535         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
19536         compare classes.        
19537
19538 2004-03-10  Martin Baulig  <martin@ximian.com>
19539
19540         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
19541
19542         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
19543         argument and write it into the `reflection_info' field.
19544
19545         * icall.c
19546         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
19547         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
19548
19549 2004-03-09  Jackson Harper  <jackson@ximian.com>
19550
19551         * char-conversions.h: use 8 bits for numeric data its all we need
19552         * icall.c: numeric data is only 8 bits now.
19553
19554 2004-03-09  Martin Baulig  <martin@ximian.com>
19555
19556         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
19557
19558         * class.c (init_properties, init_events): Initialize the new
19559         `parent' field.
19560
19561         * reflection.c (typebuilder_setup_properties): Likewise.
19562         (typebuilder_setup_events): Likewise.
19563
19564         * reflection.h (MonoEventInfo): Replaced `parent with
19565         `declaring_type' and `reflected_type'.
19566
19567         * icall.c (ves_icall_get_property_info): Distinguish between
19568         declaring and reflected type.
19569         (ves_icall_get_event_info): Likewise.
19570
19571 2004-03-09  Martin Baulig  <martin@ximian.com>
19572
19573         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
19574         (ves_icall_Type_GetField): Correctly set field->klass.
19575
19576 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
19577
19578         * loader.h: Fix warning.
19579
19580 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
19581
19582         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
19583         library routine if present.  Notice that it will still continue
19584         executing even if its missing, for those working on the Gtk#
19585         edition of Windows.Forms.
19586
19587         * assembly.c (do_mono_assembly_open): If loading the
19588         System.Windows.Forms call mono_loader_wini_init.
19589
19590 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
19591
19592         * class.h: Added MonoRemoteClass struct.
19593         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
19594         function for MonoStrings.
19595         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
19596         Added internal call for getting the proxy type.
19597         * marshal.c: Get the type of transparent proxies from its remote_class.
19598         Added methods that generate the IL for type checks and casts:
19599         mono_marshal_get_isinst, mono_marshal_get_castclass, 
19600         mono_marshal_get_proxy_cancast.
19601         * marshal.h: Declaration of the previous new methods.
19602         * object.c: Added new moethods for creating and updating MonoRemoteClass
19603         instances: mono_remote_class, mono_upgrade_remote_class, 
19604         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
19605         * verify.c: FIx transparent_proxy_fields layout.
19606         * appdomain.c: Bump corlib version.
19607
19608 2004-03-04  Jackson Harper  <jackson@ximian.com>
19609
19610         * icall.c: Add icall to access char conversion tables.
19611         * char-conversions.h: Character conversion tables.
19612         * Makefile.am: Add char-conversions.h private header file.
19613         
19614 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
19615
19616         * appdomain.c (unload_thread_main): Increase unloading timeout to
19617         10 sec as a temporary workaround for Nant problems.
19618
19619 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
19620
19621         * gc.c: Add checks for GC_enable and GC_disable.
19622
19623         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
19624         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
19625         (bug #54988).
19626         
19627 2004-02-27  Martin Baulig  <martin@ximian.com>
19628
19629         * reflection.c (mono_reflection_bind_generic_parameters): Take a
19630         `MonoReflectionType *' instead of a `MonoType *'.
19631
19632 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
19633
19634         * gc.c (run_finalize): Avoid finalizing the object representing the
19635         finalizer thread.
19636         (finalizer_thread): Fix warning.
19637
19638 2004-02-25  Martin Baulig  <martin@ximian.com>
19639
19640         * class.c (_mono_class_get_instantiation_name): Added `int offset'
19641         argument for nested types.
19642         (mono_class_create_generic): Added support for nested generictypes.
19643
19644         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
19645         `GList *nested'.
19646
19647         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
19648
19649         * reflection.c (method_encode_signature): Increase the minimum
19650         value of `size' from 10 to 11.
19651         (mono_reflection_bind_generic_parameters): Take `int type_argc'
19652         and `MonoType **types' arguments instead of the `MonoArray
19653         *types'; added `MonoType *nested_in'.  Recursively instantiate
19654         nested classes. 
19655
19656 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
19657
19658         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
19659         stack_overflow_ex members which are used by exception handling.
19660
19661         * appdomain.c (mono_runtime_init): Initialize the new members.
19662
19663         * gc.c (mono_gc_enable): New helper function.
19664         * gc.c (mono_gc_disable): New helper function.
19665
19666 2004-02-23  Martin Baulig  <martin@ximian.com>
19667
19668         * icall.c: I must have been really stupid - make it actually work
19669         this time ;-)
19670
19671 2004-02-23  Martin Baulig  <martin@ximian.com>
19672
19673         * loader.c (method_from_memberref): Only inflate the method if
19674         it's in another klass.
19675
19676 2004-02-23  Martin Baulig  <martin@ximian.com>
19677
19678         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
19679         (mono_class_init): If we're a generic instance and an interface,
19680         compute `class->interface_id'; also create `class->interfaces'
19681         here and inflate them.
19682
19683         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
19684         `ginst->is_open'.
19685         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
19686
19687         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
19688
19689 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
19690
19691         * reflection.c (method_encode_code): Improved the error message
19692         generated by the exception.
19693
19694 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19695
19696         * icall.c: Martin did not do what he said in the ChangeLog for
19697         2004-02-18, but put back the changes for properties and events.
19698         Commenting those changes out again and adding comment to bug #54518.
19699         
19700         * process.c: removed warning.
19701
19702 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
19703
19704         * marshal.c (emit_struct_conv): Print an error message instead of
19705         asserting when a type does not have the StructLayout attribute.
19706
19707 2004-02-20  Martin Baulig  <martin@ximian.com>
19708
19709         * reflection.c (mono_type_get_object): Also use the cache for
19710         generic instances.
19711         (mono_reflection_bind_generic_parameters): Always compute
19712         `ginst->ifaces'.        
19713
19714 2004-02-20  Martin Baulig  <martin@ximian.com>
19715
19716         * class.h (MonoGenericMethod): Removed `klass'.
19717
19718         * class.c (mono_class_inflate_generic_method): Added `MonoClass
19719         *klass' argument.
19720
19721 2004-02-20  Martin Baulig  <martin@ximian.com>
19722
19723         * reflection.c (method_encode_methodspec): Actually use the
19724         uninflated signature for the memberref.
19725
19726 2004-02-20  Martin Baulig  <martin@ximian.com>
19727
19728         * class.h (MonoGenericMethod): Removed `declaring'.
19729
19730         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
19731         is NULL, compute it here.
19732
19733 2004-02-20  Martin Baulig  <martin@ximian.com>
19734
19735         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
19736
19737         * metadata.c (mono_metadata_generic_inst_hash): New method.
19738         (mono_metadata_generic_inst_equal): New method.
19739
19740         * reflection.c (mono_reflection_bind_generic_parameters): Use the
19741         `klass->image->generic_inst_cache' cache to avoid creating
19742         duplicate MonoGenericInst's.
19743
19744         * class.c (mono_class_inflate_generic_type): Use the cache.
19745
19746 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
19747
19748         * object.c: fixed gc descriptor calculation for embedded valuetypes.
19749
19750 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19751
19752         * icall.c: added Socket.WSAIoctl icall.
19753
19754         * socket-io.[ch]: implemented
19755         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
19756
19757 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
19758
19759         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
19760
19761 2004-02-18  Urs C Muff  <umuff@quark.com>
19762
19763         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
19764         this work on PPC and other big-endian architectures.
19765
19766         * debug-mono-symfile.h: Prepended the names of all the `guint32'
19767         fields with an underscore to make sure they're only accessed by
19768         the read32() macro.
19769
19770 2004-02-18  Martin Baulig  <martin@ximian.com>
19771
19772         * icall.c: Put the klass->refclass changes back for methods and
19773         fields, but not for properties and events.  We're currently not
19774         distinguishing between DeclaringType and ReflectedType for
19775         properties and events, that's what caused the regressions.
19776
19777 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19778
19779         * object.c:
19780         (mono_async_result_new): the handle can be NULL.
19781
19782         * threadpool.c: Use an event instead of a semaphore, don't initialize
19783         it until needed. This saves quite a few semaphores from being created
19784         when using the threadpool.
19785
19786 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
19787
19788         * object.c (mono_string_is_interned_lookup): Fix interning of long
19789         strings. Fixes #54473.
19790
19791         * domain.c (ldstr_equal): Optimize if the two strings are equal.
19792
19793         * icall.c: Revert the klass->refclass changes since they introduce
19794         regressions (bug #54518).
19795
19796 2004-02-18  Martin Baulig  <martin@ximian.com>
19797
19798         * class.c (mono_class_init): If we're a generic instance and don't
19799         come from a TypeBuilder, inflate our members here.
19800         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
19801         (mono_class_create_generic): New public method.
19802         (mono_class_initialize_generic): Removed.
19803         (get_instantiation_name): Renamed to
19804         _mono_class_get_instantiation_name() and made it public.
19805
19806 2004-02-18  Martin Baulig  <martin@ximian.com>
19807
19808         * class.c (mono_class_inflate_generic_type): Clear the new
19809         instance's `nginst->klass' when inflating a generic instance.
19810         (mono_class_is_subclass_of): Added (basic) support for generic
19811         instances.
19812
19813 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
19814
19815         * appdomain.h, domain.c: use a MonoCodeManager instead of a
19816         MonoMempool to hold compiled native code.
19817
19818 2004-02-17  Martin Baulig  <martin@ximian.com>
19819
19820         * class.h (MonoDynamicGenericInst): Added `count_properties' and
19821         `properties'.
19822
19823         * reflection.c (mono_reflection_generic_inst_initialize): Added
19824         `MonoArray *properties' argument.
19825
19826         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
19827
19828 2004-02-17  Martin Baulig  <martin@ximian.com>
19829
19830         * icall.c (ves_icall_Type_GetFields): Renamed to
19831         ves_icall_Type_GetFields_internal() and added a
19832         `MonoReflectionType *rtype' argument; pass it to
19833         mono_field_get_object() to set the field's "reflected" type.
19834         (ves_icall_Type_GetConstructors): Likewise.
19835         (ves_icall_Type_GetEvents): Likewise.
19836         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
19837         argument; pass it to mono_method_get_object() to set the method's
19838         "reflected" type.       
19839
19840 2004-02-17  Martin Baulig  <martin@ximian.com>
19841
19842         * class.h (MonoDynamicGenericInst): New type.
19843         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
19844
19845         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
19846         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
19847         (ves_icall_MonoGenericInst_GetFields): New interncall.
19848
19849         * class.c (mono_class_from_generic): Don't call
19850         mono_class_initialize_generic() if this is a dynamic instance;
19851         ie. it's being created from a TypeBuilder.
19852         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
19853         `class->byval_arg.type'.
19854
19855         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
19856         to `inflate_method' and made static.
19857         (mono_reflection_inflate_field): Removed.
19858         (mono_reflection_generic_inst_initialize): New public method.
19859
19860         * reflection.h (MonoReflectionGenericInst): Removed `methods',
19861         `ctors' and `fields'; added `initialized'.
19862
19863 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
19864
19865         * debug-helpers.c (mono_method_full_name): Fix output for empty
19866         namespaces.
19867
19868 2004-02-12  Martin Baulig  <martin@ximian.com>
19869
19870         * class.h (MonoClassField): Added `MonoType *generic_type'.
19871
19872         * reflection.c (mono_image_get_fieldref_token): Added support for
19873         instantiated generic types.
19874         (field_encode_inflated_field): Removed.
19875         (mono_image_get_inflated_field_token): Removed.
19876         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
19877
19878         * reflection.h (MonoReflectionInflatedField): Removed.
19879
19880 2004-02-12  Martin Baulig  <martin@ximian.com>
19881
19882         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
19883         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
19884
19885         * reflection.c (mono_image_get_methodspec_token): Take a
19886         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
19887         (mono_image_create_token): Check whether we have a
19888         `method->signature->gen_method' and call
19889         mono_image_get_methodspec_token() if appropriate.
19890         (inflated_method_get_object): Removed.
19891         (mono_reflection_bind_generic_method_parameters): Return a
19892         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
19893         (mono_reflection_inflate_method_or_ctor): Likewise.
19894
19895         * reflection.h (MonoReflectionInflatedMethod): Removed.
19896
19897 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
19898
19899         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
19900         for custom valuetype marshalling.
19901
19902         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
19903
19904 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19905
19906         * icall.c: fixed WSAGetLastError_internal name.
19907
19908 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
19909
19910         * threads.c (mono_thread_attach): Allow this to be called multiple
19911         times for a thread.
19912         
19913         * threads.c (build_wait_tids): Do not wait for ourselves.
19914
19915         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
19916         appdomain list is empty.
19917
19918         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
19919         memory returned by mono_string_builder_to_utf16, since it points into
19920         managed memory. Thanks to Bernie Solomon for noticing this.
19921
19922         * icall.c: Add AppDomainSetup icalls.
19923
19924         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
19925
19926         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
19927         types.
19928
19929         * reflection.c (reflection_methodbuilder_to_mono_method): Save
19930         custom attributes to the method_aux struct. Also fix array indexes etc.
19931
19932         * loader.c (mono_method_get_param_names): Make dynamic case work again.
19933         
19934 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
19935
19936         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
19937         (both static and runtime) and reduce startup time.
19938
19939 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
19940
19941         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
19942         AsAny marshalling conversion instead of crashing.
19943
19944         * marshal.c: Fix warnings.
19945
19946 2004-02-09  Martin Baulig  <martin@ximian.com>
19947
19948         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
19949
19950         * reflection.h (MonoReflectionInflatedMethod): Removed the
19951         `declaring' field, it's now in the unmanaged MonoGenericMethod.
19952
19953         * reflection.c (method_encode_methodspec): Removed the `method'
19954         argument; we get it from `gmethod->declaring'.
19955         (inflated_method_get_object): Removed the `declaring' argument.
19956
19957 2004-02-09  Martin Baulig  <martin@ximian.com>
19958
19959         * class.h (MonoGenericMethod): New type.
19960         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
19961         `generic_method'.
19962
19963         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
19964         a `MonoGenericMethod *gen_method' one.
19965
19966         * class.c (mono_class_inflate_generic_type): Take an additional
19967         `MonoGenericMethod * argument.  This is only non-NULL if we're
19968         inflating types for a generic method.   
19969         (mono_class_inflate_generic_signature): Renamed to
19970         inflate_generic_signature() and made static; take a
19971         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
19972         (inflate_generic_header): Take a `MonoGenericMethod *' argument
19973         instead of a `MonoGenericInst *' one.
19974         (mono_class_inflate_generic_method): Likewise.
19975
19976         * reflection.c (encode_generic_method_sig): Take a
19977         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
19978         (method_encode_methodspec): Likewise.
19979         (inflated_method_get_object): Likewise. 
19980
19981         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
19982         field with a `MonoGenericMethod *gmethod' one.  
19983
19984 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
19985
19986         * class.h (mono_class_has_parent): add parens to expansion
19987         so you can ! this.
19988
19989 2004-02-08  Martin Baulig  <martin@ximian.com>
19990
19991         * image.h (MonoImage): Removed `generics_cache'.
19992
19993         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
19994         instead of a `MonoType *' argument; removed the `inflate_methods'
19995         argument.  Don't inflate methods here.
19996
19997         * loader.c (find_method): If it's a generic instance, call
19998         mono_class_init() on the `sclass->generic_inst->generic_type'.
19999
20000         * metadata.c (mono_type_size): Make this work on uninitialized
20001         generic instances; call it on the `ginst->generic_type's class.
20002
20003         * reflection.c (mono_reflection_bind_generic_parameters): Call
20004         mono_class_from_generic() to create the `ginst->klass'.
20005
20006 2004-02-08  Martin Baulig  <martin@ximian.com>
20007
20008         * class.h (MonoClass): Changed type of `generic_inst' from
20009         `MonoType *' to `MonoGenericInst *'.
20010
20011 2004-02-08  Martin Baulig  <martin@ximian.com>
20012
20013         * icall.c (ves_icall_Type_BindGenericParameters): Just call
20014         mono_type_get_object(), this is now creating a `MonoGenericInst'
20015         for MONO_TYPE_GENERICINST.
20016         (ves_icall_MonoGenericInst_GetParentType): Likewise.
20017         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
20018
20019         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
20020         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
20021         (inflated_method_get_object): Added `MonoClass *refclass' argument.
20022         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
20023         and reflected type.
20024
20025         * reflection.h (MonoReflectionInflatedMethod): Removed
20026         `declaring_type' and `reflected_type'.
20027
20028 2004-02-08  Martin Baulig  <martin@ximian.com>
20029
20030         * class.h (MonoGenericInst): Added `MonoType *parent' and
20031         `MonoType **ifaces'.
20032
20033         * reflection.h (MonoReflectionGenericInst): Removed `klass',
20034         `parent' and `interfaces'.
20035
20036         * reflection.c (mono_reflection_bind_generic_parameters): Take a
20037         `MonoType *' argument and return a `MonoType *'.
20038
20039         * icall.c
20040         (ves_icall_MonoGenericInst_GetParentType): New interncall.
20041         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
20042
20043 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
20044
20045         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
20046         valuetype marshalling.
20047
20048 2004-02-06  Martin Baulig  <martin@ximian.com>
20049
20050         * class.c
20051         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
20052         (my_mono_class_from_generic_parameter): Likewise.
20053
20054 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
20055
20056         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
20057         contents of the symbol files lazily.
20058
20059         * object.h (MonoThread): Add 'name' and 'name_len' fields.
20060
20061         * threads.h threads.c icall.c: New icalls for getting and setting the
20062         threads name.
20063
20064 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
20065
20066         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
20067         Raise an exception when the domain is not found.
20068
20069 2004-02-03  Martin Baulig  <martin@ximian.com>
20070
20071         * reflection.c (mono_image_get_methodspec_token): Use the
20072         uninflated signature; fixes gen-33.
20073
20074 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
20075
20076         * gc.c threads.c: Make the finalizer thread a normal managed thread so
20077         the finalizer code can use thread functionality.
20078
20079         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
20080         the finalizer thread.
20081
20082         * threads.c: Make some functions more robust.
20083
20084         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
20085
20086         * metadata.h: Add new marshalling conventions.
20087
20088         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
20089         stringbuilder marshalling. Fixes #53700.
20090
20091         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
20092
20093         * reflection.c (mono_image_get_type_info): Save declarative security
20094         info.
20095
20096         * reflection.c (mono_image_get_field_info): Handle uninitialized 
20097         unmanaged fields as well.
20098
20099         * appdomain.c: Bump corlib version.
20100
20101 2004-02-01  Martin Baulig  <martin@ximian.com>
20102
20103         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
20104         method type arguments.  
20105
20106 2004-01-30  Duncan Mak  <duncan@ximian.com>
20107
20108         * marshal.h: Add prototype for
20109         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
20110         and
20111         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
20112         fix the build.
20113
20114 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
20115
20116         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
20117         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
20118
20119 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
20120
20121         * marshal.c (mono_marshal_get_native_wrapper): Add support for
20122         custom marshalling of valuetypes.
20123
20124         * marshal.c: Fix some warnings.
20125
20126 2004-01-29  Martin Baulig  <martin@ximian.com>
20127
20128         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
20129         for generic method parameters.
20130
20131         * reflection.c (method_encode_methodspec): Write the uninflated
20132         signature into the methodspec table.
20133         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
20134         is always the uninflated method.
20135         (reflection_methodbuilder_to_mono_method): Copy the generic
20136         parameters from the MethodBuilder into `header->gen_params'.
20137
20138 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
20139
20140         * class.c (mono_class_from_generic_parameter): Fix warning.
20141
20142 2004-01-27  Martin Baulig  <martin@ximian.com>
20143
20144         * class.c (mono_class_from_generic_parameter): Don't create
20145         `klass->methods' here.  
20146
20147 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
20148
20149         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
20150         extension since it does not work with libraries named lib<FOO>.dll.so.
20151
20152 2004-01-25  Martin Baulig  <martin@ximian.com>
20153
20154         * class.c (mono_class_inflate_generic_type): Added support for
20155         MONO_TYPE_GENERICINST.
20156
20157         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
20158         inflate methods on open constructed types.      
20159
20160 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20161
20162         * object.c: fire ProcessExit event in the root AppDomain after running
20163         Main. Fixes bug #53299.
20164
20165 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
20166
20167         * socket-io.c: include the new socket-wrappers.h header.
20168         Use the wrappers instead of the unix socket functions to make the code
20169         more clear.
20170
20171 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
20172
20173         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
20174
20175         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
20176         Fixes #22532.
20177
20178 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
20179
20180         * reflection.c (mono_image_create_pefile): Handle the case when the
20181         entry point is not a MethodBuilder.
20182
20183         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
20184         field to ReflectionMethod since it is not allways a builder.
20185
20186         * reflection.c (type_get_fully_qualified_name): New helper function to
20187         return the fully qualified name of a type.
20188
20189         * reflection.c (encode_marshal_blob): Always emit the fully qualified
20190         type name for custom marshallers.
20191
20192         * reflection.c (mono_marshal_spec_from_builder): Ditto.
20193
20194         * class.c (mono_class_setup_vtable): If a parent class already 
20195         implements an interface, use the implementing methods from that class.
20196         Fixes #53148.
20197
20198 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20199
20200         * threadpool.c: just return instead of ExitThread to allow for thread
20201         clean up earlier.
20202
20203 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
20204
20205         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
20206         when closing resource modules.
20207
20208         * reflection.c (mono_image_create_pefile): Handle the case when the
20209         entry point is not a MethodBuilder.
20210
20211         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
20212         field to ReflectionMethod since it is not allways a builder.
20213
20214 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
20215
20216         * marshal.c (mono_marshal_get_managed_wrapper): 
20217         mono_marshal_alloc takes native int so CONV_I
20218         the arg for 64bits.
20219
20220 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
20221
20222         * reflection.c (fixup_cattrs): New function to fixup the methoddef
20223         tokens in the cattr table. Fixes #53108.
20224
20225 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20226
20227         * loader.c: don't trim ".dll" before looking up in the config file.
20228         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
20229
20230 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
20231
20232         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
20233         Return the module which contains the resource as well.
20234         (ves_icall_System_Reflection_Module_Close): New icall.
20235
20236         * appdomain.c: Bump corlib version number.
20237
20238         * image.c (mono_image_addref): New public function.
20239
20240         * assembly.c: Call mono_image_addref.
20241
20242         * reflection.c (mono_module_get_object): Increase reference count of 
20243         the image.
20244
20245         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
20246         Fixes #22532.
20247
20248         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
20249         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
20250         proper exceptions on DllImport problems.
20251
20252 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
20253
20254         * class.c, metadata.c: eliminate CSIZE macro.
20255
20256 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
20257
20258         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
20259         * object.h: Added async_callback field in MonoAsyncResult.
20260         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
20261         * verify.c: Added async_callback in MonoAsyncResult layout.
20262
20263 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
20264
20265         * reflection.c (mono_reflection_get_custom_attrs): Add support
20266         for Modules.
20267
20268 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
20269
20270         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
20271         marshalling.
20272         (mono_marshal_method_from_wrapper): Add null pointer check.
20273
20274 2004-01-16  Martin Baulig  <martin@ximian.com>
20275
20276         * debug-mono-symfile.h: Set version number to 36 and reflect
20277         latest symbol writer changes.
20278
20279 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
20280
20281         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
20282         multi-dimensional arrays.
20283         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
20284         (mono_class_from_mono_type): Use bounded_array_class_get.
20285         
20286         * class.c (mono_bounded_array_class_get): New function which takes
20287         a 'bounded' bool argument to distinguish vectors from one dimensional
20288         arrays.
20289
20290         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
20291         bounded_array_class_get if the array has bounds.
20292
20293         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
20294         Search modules loaded using AssemblyBuilder:AddModule as well.
20295
20296 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20297
20298         * appdomain.c: increased corlib version.
20299         * filewatcher.c: removed g_print.
20300         * icall.c:
20301         (get_property_info): only allocate what is actually requested.
20302         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
20303
20304 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20305
20306         * Makefile.am: added filewatcher.[ch]
20307         * filewatcher.[ch]: FileSystemWatcher runtime support.
20308         * icall.c: added new FSW icalls.
20309
20310 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
20311
20312         * string-icalls.c: fix stringbuilder regression as suggested by
20313         Iain McCoy <iain@mccoy.id.au>.
20314
20315 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
20316
20317         * process.c (process_read_stringtable_block): Recognize '007f' as
20318         a language neutral stringtable block.
20319
20320 2004-01-12  Patrik Torstensson
20321
20322         * object.h (MonoStringBuilder) : Changed layout to support our
20323         new stringbuilder class.
20324         * marshal.c: Change marshalling to support the new layout of 
20325         string builder.
20326         * appdomain.c: increased version number because new layout of
20327         string builder.
20328
20329 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
20330
20331         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
20332         assembly name as an string instead of an AssemblyName, since it is
20333         easier to extract info from it.
20334
20335         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
20336         the culture subdirectories too. Fixes #52231.
20337
20338 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20339
20340         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
20341         It takes 2 new parameters with an optional name for the method to look
20342         for and case ignoring info.
20343
20344         * threadpool.c: removed unused variable.
20345
20346 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20347
20348         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
20349         It takes 2 new parameters with an optional name for the property to look
20350         for and case ignoring info.
20351         Fixes bug #52753.
20352
20353 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
20354
20355         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
20356         Fix #52451.
20357
20358 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20359
20360         * appdomain.c:
20361         * assembly.c: escape the uri before passing it to g_filename_from_uri.
20362         Fixes bug #52630.
20363
20364 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
20365
20366         * reflection.c: Add support for more than one unmanaged resource.
20367
20368         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
20369         in field->def_value, as done in all other cases.
20370
20371         * reflection.c (mono_reflection_get_custom_attrs): Add support for
20372         TypeBuilders.
20373
20374         * reflection.c (mono_reflection_create_runtime_class): Remove 
20375         errorneous assignment to klass->element_class, since it is already
20376         done in mono_reflection_setup_internal_class.
20377
20378 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20379
20380         * gc.c: added missing LeaveCriticalSection.
20381         * icall.c: indented a couple of lines.
20382         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
20383         if we call EndInvoke inside a callback. Fixes bug #52601.
20384
20385 2004-01-07  Martin Baulig  <martin@ximian.com>
20386
20387         * mono-debug-debugger.h
20388         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
20389
20390 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
20391
20392         * appdomain.c: Use messages in NotImplementedException.
20393
20394         * exception.c (mono_get_exception_not_implemented): Now this takes
20395         a message argument.
20396
20397         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
20398         exception instead of g_asserting an aborting when something is not
20399         implemented.
20400
20401         Add some inline docs.
20402
20403 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
20404
20405         * reflection.h: Update after changes to object layout.
20406
20407         * reflection.c: Implement saving of unmanaged aka win32 resources.
20408
20409         * appdomain.c: Bump version number.
20410
20411         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
20412         Handle missing domains gracefully.
20413
20414 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
20415
20416         * file-io.c : On Windows, there are much more invalid_path_chars.
20417
20418 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
20419
20420         * class.h, object.c: prepare for GetType () speedup.
20421
20422 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
20423
20424         * profiler.c: workaround for --profile null reference exception on
20425           cygwin. Patch by Patrik Torstensson.
20426
20427 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
20428
20429         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
20430         make work for unaligned access.
20431
20432 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
20433
20434         * class.c: small cleanup (class->fields [i] -> field).
20435         * image.c: check address of metadata is valid.
20436
20437 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
20438
20439         * assembly.h assembly.c (mono_assembly_loaded): New public function to
20440         search the list of loaded assemblies.
20441
20442         * reflection.c (mono_reflection_type_from_name): Use 
20443         mono_assembly_loaded instead of mono_image_loaded.
20444
20445         * reflection.c: Fix warnings.
20446
20447 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
20448
20449         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
20450         is dynamic. This is needed since an assembly can contain both dynamic and
20451         non-dynamic images.
20452
20453         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
20454         assembly->dynamic.
20455
20456         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
20457
20458         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
20459         to store modules loaded using AddModule.
20460
20461         * reflection.c (mono_image_fill_file_table): Generalize this so it works
20462         on Modules.
20463
20464         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
20465
20466         * reflection.c (mono_image_fill_export_table_from_module): New function to
20467         fill out the EXPORTEDTYPES table from a module.
20468
20469         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
20470         into a separate function. Also handle loaded non-dynamic modules.
20471
20472         * reflection.c (mono_image_basic_init): Fix memory allocation.
20473
20474         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20475
20476         * assembly.c (mono_assembly_load_references): Make this public.
20477
20478 2003-12-19  Martin Baulig  <martin@ximian.com>
20479
20480         * class.c (mono_class_initialize_generic): Made this static, take
20481         a `MonoGenericInst *' instead of a `MonoClass *'.
20482         (mono_class_from_generic): Call mono_class_initialize_generic()
20483         unless we're already initialized or being called from
20484         do_mono_metadata_parse_generic_inst().
20485
20486         * class.h (MonoGenericInst): Added `initialized' and
20487         `init_pending' flags.
20488
20489         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
20490         `mono_class_init (gklass)' or mono_class_initialize_generic()
20491         here; set `generic_inst->init_pending' while parsing the
20492         `type_argv'.
20493
20494 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
20495
20496         * locales.c: include string.h for memxxx prototypes
20497
20498 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
20499
20500         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
20501         constructor when accessing literal fields.
20502
20503 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
20504
20505         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20506
20507         * reflection.c (assembly_add_resource_manifest): New function to fill
20508         the MANIFESTRESOURCE table.
20509
20510         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
20511
20512         * reflection.h: Update to changes in class layout.
20513
20514         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
20515         Reenable call to mono_runtime_is_shutting_down ().
20516
20517         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
20518         determine if the runtime is shutting down.
20519
20520 2003-12-16  Jackson Harper <jackson@ximian.com>
20521
20522         * icall.c: comment out call to mono_runtime_is_shutting_down to
20523         fix build.
20524         
20525 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
20526
20527         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
20528         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
20529
20530 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
20531
20532         * reflection.c: move definition of swap_with_size
20533         to before its first call
20534
20535 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
20536
20537         * appdomain.c (mono_runtime_is_shutting_down): New public function.
20538
20539         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
20540         icall.
20541
20542         * object.c: Fix warnings.
20543
20544         * icall.c (ves_icall_Type_Get...): Only consider inherited static
20545         members if FlattenHierarchy is set.
20546
20547         * reflection.c (mono_image_add_decl_security): New function to emit
20548         declarative security.
20549
20550         * reflection.h reflection.c: Add support for declarative security.
20551
20552         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
20553         
20554 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
20555
20556         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
20557         
20558         * appdomain.c verify.c: Moved corlib version checking into its own
20559         function in appdomain.c since it needs to create vtables etc.
20560
20561 2003-12-13  Patrik Torstensson <p@rxc.se>
20562
20563         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
20564         instead of unwrapped server.
20565
20566 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
20567
20568         * verify.c (check_corlib): Fix field index.
20569
20570 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
20571
20572         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
20573         GetGacPath icall.
20574
20575 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
20576
20577         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
20578         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
20579         cope with sizeof(size_t) != sizeof(guint32).
20580
20581 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20582
20583         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
20584         in case of failure.
20585
20586 2003-12-10  Mark Crichton <crichton@gimp.org>
20587
20588         * icall.c: removed the GetNonZeroBytes.  We now handle this case
20589         in managed code.
20590
20591         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
20592
20593 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
20594
20595         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
20596         marked as deleted.
20597
20598 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
20599
20600         * verify.c (check_corlib): Handle the case when the version field is 
20601         initialized by a static constructor.
20602
20603 2003-12-08  Patrik Torstensson  <p@rxc.se>
20604
20605     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
20606
20607 2003-12-08  Martin Baulig  <martin@ximian.com>
20608
20609         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
20610         a MonoReflectionGenericParameter, also take the parameter index
20611         and name as arguments.
20612         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
20613         (ves_icall_MonoGenericParam_initialize): New interncall.
20614         (ves_icall_Type_make_byref_type): New interncall.
20615
20616         * reflection.h (MonoReflectionGenericParam): Derive from
20617         MonoReflectionType, not just from MonoObject.  Added `refobj' and
20618         `index' fields.
20619
20620         * reflection.c (mono_reflection_define_generic_parameter): Create
20621         and return a new MonoReflectionGenericParam; don't initialize the
20622         constraints here.
20623         (mono_reflection_initialize_generic_parameter): New public method;
20624         initializes the constraints and creates the `param->pklass'.
20625
20626 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
20627
20628         * reflection.h reflection.c: Use the new fields 'num_types', 
20629         'num_fields' and 'num_methods' to track the number of types etc.
20630
20631         * verify.c (check_corlib): Check corlib version number.
20632
20633 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
20634
20635         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
20636         function works on all methods.
20637
20638 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
20639
20640         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
20641         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
20642         the custom_type_info flag of the transparent proxy.
20643         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
20644         objects that supports IRemotingTypeInfo.
20645         * object.h: Added custom_type_info field in transparent proxy.
20646
20647 2003-12-06  Martin Baulig  <martin@ximian.com>
20648
20649         * class.c (mono_class_create_from_generic): Removed.
20650         (mono_class_from_generic): Check `ginst->klass' before doing
20651         anything else.  This is important to fully support "recursive"
20652         generic types.
20653
20654         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
20655         empty `generic_inst->klass' before doing anything else.
20656
20657 2003-12-06  Dick Porter  <dick@ximian.com>
20658
20659         * verify.c: 
20660         * object.h:
20661         * icall.c:
20662         * locales.c: Use C structs to access class fields.  Don't do a
20663         conversion between MonoString and UChar because both are
20664         platform-endian UTF-16.  Compare now takes startindex and count
20665         parameters.  Add a char overload for IndexOf.  Speed up the
20666         invariant string IndexOf.
20667
20668 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
20669
20670         * Makefile.am (monosn_LDADD): Fix parallel build.
20671
20672 2003-12-04  Martin Baulig  <martin@ximian.com>
20673
20674         * icall.c
20675         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
20676         (ves_icall_Type_make_array_type): New interncall.       
20677
20678 2003-12-04  Martin Baulig  <martin@ximian.com>
20679
20680         * locales.c: also change it in the !HAVE_ICU case.
20681
20682 2003-12-04  Dick Porter  <dick@ximian.com>
20683
20684         * icall.c:
20685         * locales.c: construct_compareinfo is now in CompareInfo, not
20686         CultureInfo.
20687
20688 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
20689
20690         * image.c (mono_image_load_file_for_image): Cache loaded images in the
20691         image->files array.
20692
20693         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
20694         table as well.
20695
20696         * assembly.c (mono_assembly_load_references): Only load references
20697         once.
20698
20699         * class.c (mono_class_from_name): Avoid linear search of the 
20700         EXPORTEDTYPE table.
20701
20702         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
20703
20704 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
20705
20706         * image.h (MonoImage): Add 'field_cache' field.
20707
20708         * loader.c (mono_field_from_token): Cache field lookups.
20709         
20710         * reflection.c (mono_module_get_object): Fix name property.
20711
20712         * icall.c (ves_icall_get_enum_info): Update after changes to 
20713         mono_metadata_get_constant_index ().
20714
20715         * icall.c: Get rid of get_type_info icall, use a separate icall for
20716         each type property to avoid needless memory allocations. Fixes #51514.
20717
20718         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
20719         to avoid needless binary searches.
20720
20721         * class.c (class_compute_field_layout): Move the initialization of
20722         field->def_value to mono_class_vtable ().
20723
20724         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
20725         non-corlib types.
20726
20727         * object.c (mono_object_allocate): Make it inline.
20728
20729         * object.c (mono_object_allocate_spec): Make it inline.
20730         
20731 2003-12-02  Dick Porter  <dick@ximian.com>
20732
20733         * locales.c (create_NumberFormat): NumberFormatInfo construction.
20734         Patch by Mohammad DAMT (mdamt@cdl2000.com).
20735
20736 2003-12-01  Dick Porter  <dick@ximian.com>
20737
20738         * threads.c: Fix signature and call in CreateMutex and
20739         CreateEvent.
20740
20741 2003-12-01  Dick Porter  <dick@ximian.com>
20742
20743         * icall.c: 
20744         * locales.c: Implement string compares and searching
20745
20746         * object.h: Add extra Thread field
20747
20748 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
20749
20750         * reflection.c (fixup_method): Add support for MonoCMethod.
20751
20752 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
20753
20754         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
20755
20756         * reflection.c (assembly_name_to_aname): Allow extra characters in
20757         assembly names. Fixes #51468.
20758
20759 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
20760
20761         * exception.c (mono_exception_from_name_domain): New helper function.
20762
20763         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
20764         exception object in the correct domain.
20765
20766         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
20767         formatting + make a copy a the input data.
20768
20769         * loader.c (mono_get_method_from_token): Methods which contain
20770         native code do not have entries in the ImplMap.
20771
20772         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
20773         Thanks to Gonzalo for spotting this.
20774         
20775         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
20776         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
20777
20778         * assembly.h (mono_assembly_load_from): Split the second part of 
20779         assembly loading into a new public function.
20780
20781         * exception.h (mono_get_exception_bad_image_format): New function.
20782
20783 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
20784
20785         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
20786         Enumerate all modules inside a dynamic assembly. Fixes #51293.
20787         
20788         * icall.c: Add new icall for creating dynamic methods.
20789
20790         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
20791
20792         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
20793
20794         * reflection.c (mono_reflection_create_dynamic_method): New icall to
20795         create a dynamic method.
20796
20797         * reflection.c (resolve_object): New helper function.
20798
20799         * reflection.c: Generalize ReflectionMethodBuilder and the functions
20800         which manipulate it so they can also work on dynamic methods.
20801
20802         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
20803         creating the MonoReflectionMethodAux structure if it is not needed.
20804         
20805         * reflection.h verify.c: Update after changes to object layout.
20806
20807         * reflection.c (method_builder_encode_signature): Fix compilation on
20808         gcc 2.95.x.
20809
20810 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
20811
20812         * appdomain.h: Added support for context static fields. Added static_data
20813           field to MonoAppContext and renamed thread_static_fields to a more
20814           generic special_static_fields in MonoAppDomain, since it can now contain
20815           context static fields.
20816         * domain.c: Updated hashtable name.
20817         * object.c: Replaced field_is_thread_static() for a more generic
20818           field_is_special_static() which also checks for context static attribute.
20819           In mono_class_vtable(), added support for static context fields.
20820         * threads.c: Changed methods that manage thread static fields to more
20821           generic methods so they can be reused both for thread and context static
20822           data.
20823         * threads.h: Declared some new methods.
20824
20825 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
20826
20827         * reflection.h: Update after changes to the managed types.
20828
20829         * reflection.c (encode_custom_modifiers): New helper function.
20830
20831         * reflection.c (method_encode_signature): Emit custom modifiers.
20832
20833         * reflection.c (field_encode_signature): Emit custom modifiers.
20834
20835 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
20836
20837         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
20838
20839         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
20840         implementation.
20841
20842         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
20843         icall.
20844
20845         * object.c (mono_field_get_value_object): New function.
20846
20847         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
20848         specific.
20849
20850 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
20851
20852         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
20853         return a preallocated out-of-memory exception instance.
20854
20855         * object.c (out_of_memory): Use the new function.
20856
20857         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
20858         flag is before the custom modifiers. Fixes #49802.
20859
20860 2003-11-16  Martin Baulig  <martin@ximian.com>
20861
20862         * class.c (mono_class_is_open_constructed_type): Implemented the
20863         MONO_TYPE_GENERICINST case.
20864
20865 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
20866
20867         * assembly.c (mono_assembly_fill_assembly_name): New function to
20868         fill out the MonoAssemblyName structure.
20869         (mono_assembly_open): Use the new function.
20870
20871         * icall.c (fill_reflection_assembly_name): New helper function.
20872
20873         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
20874         new function.
20875
20876         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
20877
20878 2003-11-15  Martin Baulig  <martin@ximian.com>
20879
20880         * class.c (mono_class_is_open_constructed_type): New public
20881         function; checks whether a type is an open constructed type,
20882         ie. whether it still contains type parameters.
20883         (mono_class_inflate_generic_type): If we're a type parameter and
20884         the inflated type is also a MONO_TYPE_(M)VAR, return the original
20885         type.
20886
20887         * class.h (MonoGenericInst): Added `guint32 is_open'.
20888
20889         * loader.c (method_from_methodspec): Check whether we're an open
20890         or closed constructed type and set `ginst->is_open'.
20891
20892         * reflection.c (mono_reflection_bind_generic_parameters): Check
20893         whether we're an open or closed constructed type and set
20894         `ginst->is_open'.
20895         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
20896         from open constructed types.
20897
20898 2003-11-15  Martin Baulig  <martin@ximian.com>
20899
20900         * reflection.c (mono_reflection_bind_generic_parameters): If we're
20901         a generic instance (instead of a generic type declaration) with
20902         unbound generic parameters, bind them to our actual types.
20903
20904 2003-11-14  Martin Baulig  <martin@ximian.com>
20905
20906         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
20907
20908         * reflection.c (mono_reflection_bind_generic_parameters): If we're
20909         an interface type, populate `res->interfaces' with instantiated
20910         versions of all the interfaces we inherit.
20911
20912 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
20913
20914         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
20915         when MONO_PATH is set but doesn't contain the install dir.
20916
20917 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20918
20919         * icall.c:
20920         (ves_icall_Type_GetInterfaces): don't return an interface twice when
20921         it's also implemented in base classes. Fixes bug #50927.
20922
20923 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
20924
20925         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
20926         if this method is called from a finalizer. Fixes #50913.
20927
20928 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
20929
20930         * threads.c: Implement VolatileRead/VolatileWrite
20931
20932         * icall.c: Add new icalls for VolatileRead/VolatileWrite
20933
20934 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
20935
20936         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
20937         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
20938         2.95.3.
20939
20940         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
20941         from Peter Ross (pro@missioncriticalit.com).
20942         
20943 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
20944
20945         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
20946
20947 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
20948
20949         * assembly.c (mono_assembly_load_references): Disable check because it
20950         triggers on older corlibs which lots of people have.
20951
20952 2003-11-12  Jackson Harper  <jackson@ximian.com>
20953
20954         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
20955         load corlib.dll if mscorlib.dll is not found.
20956         * assembly.h: Remove corlib name define.
20957         * class.c:
20958         * domain.c:
20959         * image.c: Change corlib name to mscorlib.
20960         
20961 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
20962
20963         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
20964
20965 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
20966
20967         * appdomain.h: Added loader_optimization here to sync with the C#
20968         code, and add disallow_binding_redirects field.
20969
20970 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
20971
20972         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
20973
20974         * reflection.c (mono_image_build_metadata): Fix crash on modules
20975         with no types.
20976
20977         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
20978
20979         * icall.c (ves_icall_get_method_info): Return callingConvention as
20980         well.
20981
20982         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
20983         namespaces from the EXPORTEDTYPE table as well.
20984
20985         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
20986         from all modules inside the assembly.
20987         
20988 2003-11-11  Martin Baulig  <martin@ximian.com>
20989
20990         * reflection.c (mono_reflection_bind_generic_parameters): Make
20991         this work for interfaces.
20992
20993 2003-11-11  Martin Baulig  <martin@ximian.com>
20994
20995         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
20996
20997 2003-11-11  Martin Baulig  <martin@ximian.com>
20998
20999         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
21000         "MonoInflatedMethod" and "MonoInflatedCtor".
21001
21002 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
21003
21004         * reflection.c (resolution_scope_from_image): Use the assembly table
21005         from the manifest module, since other modules don't have it.
21006
21007         * debug-helpers.c (mono_type_full_name): New helper function.
21008
21009         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
21010
21011         * image.c (mono_image_load_file_for_image): New public function which
21012         is a replacement for the load_file_for_image in class.c.
21013
21014         * assembly.c (mono_assembly_load_module): A wrapper for the function
21015         above which does assembly association and reference loading too.
21016
21017         * class.c (mono_class_from_name): Call mono_assembly_load_module.
21018
21019 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21020
21021         * appdomain.c: not all of the attributes for the full assembly name
21022         are required and the order doesn't matter. Fixes bug #50787.
21023
21024 2003-11-10  Dick Porter  <dick@ximian.com>
21025
21026         * locales.c: Use platform-endian UTF16
21027
21028 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
21029
21030         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
21031         
21032 2003-11-10  Martin Baulig  <martin@ximian.com>
21033
21034         * metadata.c
21035         (mono_metadata_load_generic_params): Make this actually work.
21036
21037         * reflection.c (mono_reflection_bind_generic_parameters): If our
21038         parent is a generic instance, pass all the `types' to it, no
21039         matter whether it has the same number of type parameters or not.
21040
21041 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
21042
21043         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
21044
21045         * assembly.c (mono_assembly_load_references): Move the image<->assembly
21046         assignment code to this function so it gets called recursively for all
21047         modules.
21048
21049         * image.c (load_modules): Remove the assembly assignment since it is
21050         now done by mono_assembly_load_references.
21051         
21052         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
21053         Add 'module' argument.
21054         (mono_module_get_types): New helper function.
21055         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
21056
21057 2003-11-08  Martin Baulig  <martin@ximian.com>
21058
21059         * class.c (mono_class_inflate_generic_method): Interface method
21060         don't have a header.
21061
21062         * reflection.c (mono_image_get_methodspec_token): Take an
21063         additional `MonoGenericInst *' argument instead of reading it from
21064         the header; this is necessary to support interfaces.
21065         (mono_image_create_token): Pass the `MonoGenericInst *' from the
21066         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
21067         (inflated_method_get_object): Take an additional `MonoGenericInst *'
21068         argument.
21069
21070         * reflection.h (MonoReflectionInflatedMethod): Added
21071         `MonoGenericInst *ginst'.
21072
21073 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
21074
21075         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
21076
21077 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
21078
21079         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
21080
21081 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
21082
21083         * reflection.c 
21084         (reflection_methodbuilder_from_method_builder):
21085         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
21086         initialize a ReflectionMethodBuilder structure.
21087         (mono_image_get_methodbuilder_token):
21088         (mono_image_get_ctorbuilder_token): New functions to emit memberref
21089         tokens which point to types in another module inside the same assembly.
21090
21091         * reflection.c: Use the new helper functions.
21092         
21093         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
21094
21095         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
21096         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
21097
21098         * reflection.c (resolution_scope_from_image): Emit a moduleref if
21099         neccesary.
21100
21101         * reflection.c (mono_image_build_metadata): Emit metadata only for the
21102         current module. Emit the manifest only for the main module.
21103
21104         * reflection.c (mono_image_create_token): Add assertion when a 
21105         memberref needs to be created.
21106
21107         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
21108
21109         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
21110         larger buffer for the custom attribute blob. Fixes #50637.
21111         
21112 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21113
21114         * threadpool.c: notify listener on async processing handles after
21115         invoking the async callback. Thanks to Zoltan.
21116
21117 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
21118
21119         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
21120         avoid code duplication.
21121
21122         * reflection.h (MonoDynamicImage): New type which is currently unused,
21123         but will be used through the ref.emit code in place of 
21124         MonoDynamicAssembly.
21125
21126         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
21127         object layout.
21128
21129         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
21130         a MonoDynamicImage instead of just a MonoImage.
21131         
21132         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
21133         icalls to ModuleBuilder but keep their semantics, so they will work
21134         with moduleb->assemblyb. This will change later.
21135         
21136 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
21137
21138         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
21139         object layout.
21140
21141         * reflection.c (mono_image_build_metadata): Avoid creation of a default
21142         main module, since it is now done by the managed code.
21143
21144 2003-11-03  Martin Baulig  <martin@ximian.com>
21145
21146         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
21147         `ginst->klass' here.
21148         (method_encode_methodspec): Don't use the `ginst->generic_method's
21149         klass if it's a generic instance, use `ginst->klass' in this case.
21150
21151 2003-11-03  Martin Baulig  <martin@ximian.com>
21152
21153         * reflection.c (mono_image_get_generic_method_param_info):
21154         Removed, use mono_image_get_generic_param_info() instead.
21155         (mono_image_get_type_info): Write the GenericParam table before
21156         the Method table.  This is neccessary because in the GenericParam
21157         table, type parameters of the class (ie. '!0' etc.) must come
21158         before the ones from its generic methods (ie. '!!0' etc).
21159
21160 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
21161
21162         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
21163
21164 2003-11-02  Martin Baulig  <martin@ximian.com>
21165
21166         * reflection.c (create_generic_typespec): Take a
21167         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
21168         the generic parameters from it.
21169
21170 2003-11-02  Martin Baulig  <martin@ximian.com>
21171
21172         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
21173         instead of a `MonoClassField *' since we just need the type.
21174         (create_generic_typespec): New static function.  Creates a
21175         TypeSpec token for a generic type declaration.
21176         (mono_image_get_generic_field_token): New static function.
21177         (mono_image_create_token): If we're a FieldBuilder in a generic
21178         type declaration, call mono_image_get_generic_field_token() to get
21179         the token.
21180
21181 2003-11-02  Martin Baulig  <martin@ximian.com>
21182
21183         * reflection.h
21184         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
21185         `MonoReflectionGenericInst *declaring_type' and
21186         `MonoReflectionGenericInst *reflected_type' fields.
21187
21188         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
21189         `MonoReflectionGenericInst *declaring_type' and a
21190         `MonoReflectionGenericInst *reflected_type' argument instead of a
21191         single `MonoReflectionGenericInst *type' one.  Set
21192         `res->declaring_type' and `res->reflected_type' from them.
21193         (mono_reflection_inflate_field): Likewise.      
21194
21195 2003-11-02  Martin Baulig  <martin@ximian.com>
21196
21197         * class.c (mono_class_setup_vtable): Don't store generic methods
21198         in the vtable.  
21199
21200 2003-11-02  Martin Baulig  <martin@ximian.com>
21201
21202         * reflection.h (MonoReflectionGenericInst): Added
21203         `MonoReflectionType *declaring_type'.
21204
21205         * reflection.c (mono_reflection_bind_generic_parameters): Use
21206         `if (tb->parent)' instead of `klass->parent'.
21207
21208 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
21209
21210         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
21211         with an empty ASSEMBLY table.
21212
21213         * reflection.c (mono_image_build_metadata): Avoid using the same loop
21214         variable in the inner and outer loops.
21215
21216 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
21217
21218         * metadata.h (mono_metadata_make_token): Put parentheses around macro
21219         argument.
21220
21221         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
21222         
21223         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
21224         icalls. Instead, do everything in managed code. This is needed since
21225         it is hard to restore the original domain etc. in unmanaged code in the
21226         presence of undeniable exceptions.
21227
21228         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
21229         New icalls to push and pop appdomain refs.
21230
21231 2003-10-31  Martin Baulig  <martin@ximian.com>
21232
21233         * class.c (inflate_generic_type): Renamed to
21234         mono_class_inflate_generic_type() and made it public.
21235
21236         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
21237         New interncall.
21238
21239         * loader.c (mono_field_from_memberref): Also set the retklass for
21240         typespecs.
21241
21242         * fielder.c (mono_image_get_inflated_field_token): New static
21243         method; creates a metadata token for an inflated field.
21244         (mono_image_create_token, fixup_method): Added support for
21245         "MonoInflatedField".
21246         (fieldbuilder_to_mono_class_field): New static function.
21247         (mono_reflection_inflate_field): New public function.
21248
21249         * reflection.h
21250         (MonoReflectionGenericInst): Added `MonoArray *fields'.
21251         (MonoReflectionInflatedField): New typedef.     
21252
21253 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
21254
21255         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
21256         for Solaris and other platforms without s6_addr16
21257
21258 2003-10-30  Martin Baulig  <martin@ximian.com>
21259
21260         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
21261         argument instead of two.
21262         (mono_class_inflate_generic_signature): Likewise.
21263         (inflate_generic_header): Likewise.
21264         (mono_class_inflate_generic_method): Likewise.  In addition, if
21265         `ginst->klass' is set, it becomes the new `method->klass'.
21266
21267         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
21268         field.
21269
21270         * reflection.c (encode_generic_method_sig): Write a 0xa as the
21271         first byte. [FIXME]
21272         (method_encode_methodspec): If we have generic parameters, create
21273         a MethodSpec instead of a MethodRef.
21274         (fixup_method): Added support for "MonoInflatedMethod" and
21275         "MonoInflatedCtor".
21276         (mono_image_create_token): Added support for "MonoInflatedMethod"
21277         and "MonoInflatedCtor".
21278         (inflated_method_get_object): New static function; returns a
21279         managed "System.Reflection.MonoInflatedMethod" object.
21280         (mono_reflection_bind_generic_method_parameters): Return a
21281         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
21282         (mono_reflection_inflate_method_or_ctor): Likewise.
21283         (mono_image_get_generic_method_param_info): Initialize unused
21284         fields to zero.
21285         (mono_image_get_generic_param_info): Likewise.
21286
21287         * reflection.h (MonoReflectionInflatedMethod): New public
21288         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
21289         "S.R.MonoInflatedCtor" classes.
21290
21291         * loader.c (method_from_memberref): If we're a TypeSpec and it
21292         resolves to a generic instance, inflate the method.
21293
21294 2003-10-28  Dick Porter  <dick@ximian.com>
21295
21296         * object.c (mono_runtime_run_main): Convert command-line arguments
21297         into utf8, falling back to the user's locale encoding to do so.
21298
21299 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
21300
21301         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
21302         at this time.
21303
21304         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
21305
21306         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
21307         up icalls at method definition time. Partially fixes #33569.
21308
21309 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
21310
21311         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
21312         marshalling of arrays. Fixes #50116.
21313
21314         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
21315
21316         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
21317         points to a vtable in the dying appdomain.
21318
21319         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
21320         listeners into unmanaged code inside the lock.
21321
21322         * object.c (mono_class_vtable): Turn off typed allocation in non-root
21323         domains and add some comments.
21324
21325 2003-10-25  Martin Baulig  <martin@ximian.com>
21326
21327         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
21328
21329         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
21330
21331         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
21332         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
21333         currently parsing.  Create the generic class and store it in
21334         `generic_inst->klass' before parsing the type arguments.  This is
21335         required to support "recursive" definitions; see mcs/tests/gen-23.cs
21336         for an example.
21337         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
21338         to support recursive typespec entries.
21339
21340         * class.c (mono_class_setup_parent): If our parent is a generic
21341         instance, we may get called before it has its name set.
21342         (mono_class_from_generic): Splitted into
21343         mono_class_create_from_generic() and mono_class_initialize_generic().
21344
21345 2003-10-25  Martin Baulig  <martin@ximian.com>
21346
21347         * icall.c (ves_icall_Type_BindGenericParameters): Return a
21348         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
21349         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
21350         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
21351
21352         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
21353         (create_typespec): Likewise.
21354         (mono_reflection_bind_generic_parameters): Return a
21355         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
21356         (mono_reflection_inflate_method_or_ctor): New public function.
21357
21358         * reflection.h (MonoReflectionGenericInst): New typedef.        
21359
21360 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
21361
21362         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
21363         inside the domain lock. Fixes #49993.
21364         
21365         * object.c (mono_class_vtable): When typed allocation is used, 
21366         allocate vtables in the GC heap instead of in the mempool, since the
21367         vtables contain GC descriptors which are used by the collector even
21368         after the domain owning the mempool is unloaded.
21369
21370         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
21371
21372         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
21373         reflect what it does. Also invalidate mempools instead of freeing
21374         them if a define is set.
21375
21376         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
21377         of the appdomain.
21378         
21379         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
21380         hold the finalizable objects in this domain.
21381
21382         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
21383         appdomain.
21384
21385         * appdomain.c (mono_domain_set): New function to set the current
21386         appdomain, but only if it is not being unloaded.
21387
21388         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
21389         appdomain which is being unloaded.
21390         
21391         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
21392         unloading of the root appdomain.
21393
21394         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
21395         icall to execute a method in another appdomain. Intended as a 
21396         replacement for InternalSetDomain, which can confuse the code 
21397         generation in the JIT.
21398
21399         * appdomain.c (mono_domain_is_unloading): New function to determine
21400         whenever an appdomain is unloading.
21401
21402         * appdomain.c (mono_domain_unload): New function to correctly unload
21403         an appdomain.
21404
21405         * assembly.c (mono_assembly_load_references): Check that an assembly
21406         does not references itself.
21407
21408         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
21409         domain manually, it asks the finalizer thread to do it, then waits for
21410         the result. Also added a timeout.
21411
21412         * icall.c: Register the new icalls.
21413
21414         * threads.h threads.c: Export the mono_gc_stop_world and 
21415         mono_gc_start_world functions.
21416         
21417         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
21418         function to fill out the mempool with 0x2a.
21419
21420 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
21421
21422         * reflection.h (MonoReflectionMethodAux): New structure to store
21423         information which is rarely used, thus is not in the MonoMethod
21424         structure.
21425
21426         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
21427         store the aux info.
21428
21429         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
21430         and marshalling info into the aux structure.
21431
21432         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
21433         from the aux structure.
21434
21435         * loader.c (mono_method_get_param_names): Retrieve the param names from
21436         the aux structure.
21437         
21438 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
21439
21440         * exception.h exception.c: Add AppDomainUnloadedException && fix 
21441         warning.
21442
21443 2003-10-21  Dick Porter  <dick@ximian.com>
21444
21445         * socket-io.c
21446         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
21447         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
21448
21449 2003-10-21  Martin Baulig  <martin@ximian.com>
21450
21451         * reflection.c (mono_reflection_bind_generic_parameters):
21452         `klass->parent' is NULL for interfaces.
21453
21454 2003-10-21  Martin Baulig  <martin@ximian.com>
21455
21456         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
21457
21458 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
21459
21460         * exception.c (mono_exception_from_name_msg): New helper function for
21461         creating exceptions and initializing their message field.
21462
21463         * exception.c: Simplify functions using the new helper.
21464
21465         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
21466         New function.
21467
21468         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
21469         mono_raise_exception, since otherwise gcc doesn't generate the function
21470         epilog for raise_exception, confusing the stack unwinding in the JIT.
21471         Fixes #45043.
21472
21473         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
21474         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
21475         Fixes #49499.
21476
21477 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21478
21479         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
21480         utf8.
21481
21482 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
21483
21484         * icall.c: Removed GetUninitializedObject method because
21485           AllocateUninitializedClassInstance does the same.
21486
21487 2003-10-18  Martin Baulig  <martin@ximian.com>
21488
21489         * class.c (inflate_generic_signature): Renamed to
21490         mono_class_inflate_generic_signature() and made it public.
21491         (my_mono_class_from_generic_parameter): New static function; if we
21492         don't already have the generic parameter's MonoClass, create a
21493         very simple one which is just used internally in the runtime and
21494         not passed back to managed code.
21495
21496         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
21497
21498         * metadata.h (MonoMethodSignature): Moved the
21499         `MonoGenericParam *gen_params' to the MonoMethodHeader.
21500         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
21501
21502         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
21503         ves_icall_MonoMethod_GetGenericArguments(); this is now an
21504         interncall on the MonoMethod class, not on MethodInfo.
21505         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
21506         calling mono_reflection_bind_generic_method_parameters() directly.
21507
21508         * loader.c (mono_method_get_signature): If this is a MethodSpec;
21509         return the already computed `method->signature'.
21510         (method_from_methodspec): New static function to load a method
21511         from a MethodSpec entry.
21512         (mono_get_method_from_token): Call the new method_from_methodspec()
21513         for MethodSpec tokens.  
21514         (mono_get_method_from_token): If we're a generic method, load the
21515         type parameters.
21516
21517         * reflection.c (mono_image_get_memberref_token): Allow
21518         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
21519         table.
21520         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
21521         (mono_image_create_token): First check whether it's a generic
21522         method (so we'd need to create a MethodSpec), then do the other
21523         two alternatives.
21524         (mono_reflection_bind_generic_method_parameters): Return a
21525         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
21526         called directly from the interncall.
21527
21528 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
21529
21530         * reflection.c (load_public_key): Move loading of the public key
21531         into managed code.
21532
21533         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
21534
21535         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
21536         fields.
21537
21538         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
21539         culture, hash_alg and public_key. Fixes #49555.
21540
21541 2003-10-17  Martin Baulig  <martin@ximian.com>
21542
21543         * class.h (MonoGenericInst): Moved this declaration here and added
21544         `MonoMethod *generic_method'.
21545
21546         * icall.c
21547         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
21548         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
21549
21550         * metadata.c (mono_metadata_type_equal): Two types of
21551         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
21552         index; ie. don't compare the address of the `MonoGenericParam'
21553         structure.
21554         (mono_metadata_load_generic_params): Removed the `MonoMethod
21555         *method' argument.
21556
21557         * metadata.h (MonoGenericInst): Moved declaration to class.h.
21558         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
21559
21560         * reflection.c (method_encode_signature): Encode the number of
21561         generic parameters.
21562         (encode_generic_method_sig): New static function.
21563         (method_encode_methodspec): New static function; creates an entry
21564         in the MethodSpec table for a generic method.
21565         (mono_image_get_methodspec_token): New static function.
21566         (mono_image_create_token): Call mono_image_get_methodspec_token()
21567         for generic methods.
21568         (mono_reflection_bind_generic_method_parameters): New public
21569         function.  Instantiates a generic method.
21570
21571 2003-10-16  Martin Baulig  <martin@ximian.com>
21572
21573         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
21574         *gen_params' here from MonoMethodHeader.
21575
21576         * metadata.c (mono_metadata_parse_method_signature): If we have
21577         generic parameters, initialize `method->gen_params' and then set
21578         the correct `type->data.generic_param' in all the parameters.
21579
21580 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
21581
21582         * threads.c (mono_threads_get_default_stacksize): New function to 
21583         return the default stacksize.
21584
21585         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
21586         termination of the finalizer thread, since the previous method had
21587         race conditions. Fixes #49628.
21588
21589         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
21590         as for the other managed threads.
21591
21592 2003-10-16  Martin Baulig  <martin@ximian.com>
21593
21594         * class.c (inflate_generic_signature): Copy `generic_param_count'
21595         and `gen_params'.
21596
21597         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
21598         New interncall.
21599
21600         * metadata.c (mono_metadata_parse_method_signature): Actually set
21601         the `method->generic_param_count' here.
21602         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
21603
21604 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
21605
21606         * object.h: Add a new field to TypedRef to simplify the implementation
21607         of the REFANY opcodes in the JIT.
21608
21609         * icall.c: Make use of the new field.
21610
21611         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
21612         dynamically.
21613
21614 2003-10-15  Martin Baulig  <martin@ximian.com>
21615
21616         * class.c (mono_class_from_gen_param): Renamed to
21617         mono_class_from_generic_parameter() and moved most of the
21618         functionality from mono_reflection_define_generic_parameter()
21619         here; ie. we create a "real" class here.
21620         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
21621         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
21622         previously been called.
21623
21624         * class.h (MonoGenericParam): Moved the declaration of this struct
21625         here from metadata.h and added `MonoMethod *method'.
21626
21627         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
21628         interncall.
21629
21630         * loader.c (mono_get_method_from_token): If we have any generic
21631         parameters, call mono_metadata_load_generic_params() to read them
21632         from the MONO_TABLE_GENERICPAR.
21633
21634         * metadata.c (mono_metadata_load_generic_params): Added
21635         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
21636
21637         * metadata.h (MonoMethodSignature): Replaced
21638         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
21639         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
21640
21641         * reflection.c (mono_reflection_define_generic_parameter): Moved
21642         most of the functionality into the new
21643         mono_class_from_generic_parameter(); set the `method' field if
21644         we're a method parameter.       
21645
21646 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
21647
21648         * marshal.c (emit_struct_conv): if native size is 0
21649         emit no code.
21650
21651 2003-10-14  Martin Baulig  <martin@ximian.com>
21652
21653         * icall.c: The generics API has changed in the spec since it was
21654         added to System.Type; these modifications make it match the spec
21655         again.
21656         (ves_icall_Type_GetGenericParameters): Renamed to
21657         `ves_icall_Type_GetGenericArguments'.
21658         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
21659         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
21660         `ves_icall_MonoType_get_HasGenericArguments'.
21661         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
21662         `ves_icall_MonoType_get_IsGenericParameter'.
21663         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
21664         this is no interncall anymore.
21665         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
21666         `ves_icall_TypeBuilder_get_IsGenericParameter'.
21667
21668 2003-10-14  Martin Baulig  <martin@ximian.com>
21669
21670         * reflection.c (mono_reflection_bind_generic_parameters): Also
21671         inflate generic methods if we're reading the class from IL.
21672
21673 2003-10-13  Martin Baulig  <martin@ximian.com>
21674
21675         * reflection.c (mono_reflection_define_generic_parameter): This
21676         method isn't called directly from the icall anymore; take a
21677         `MonoReflectionAssemblyBuilder *' so we can use this for type and
21678         method generic parameters.
21679         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
21680         (method_builder_encode_signature): Encode generic parameters.
21681         (mono_image_get_method_info): Write generic params to the
21682         MONO_TABLE_GENERICPARAM table.
21683
21684         * reflection.h (MonoReflectionMethodBuilder): Added
21685         `MonoArray *generic_params'.
21686
21687         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
21688
21689         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
21690         wrapper for mono_reflection_define_generic_parameter().
21691         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
21692
21693 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
21694
21695         * marshal.h: Add missing function to fix build.
21696
21697         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
21698         the SetLastError pinvoke attribute.
21699
21700         * marshal.c (mono_marshal_set_last_error): New helper function called
21701         by the generated code.
21702         
21703         * marshal.c (mono_mb_emit_branch): New helper function.
21704
21705         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
21706
21707         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
21708         classes as parameters and return values of delegates. Fixes #29256. 
21709
21710 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
21711
21712         * locales.c: use gint32 in non HAVE_ICU case
21713
21714 2003-10-11  Martin Baulig  <martin@ximian.com>
21715
21716         * mono-debug.c (mono_debug_add_method): Added a workaround for
21717         bug #48591.
21718
21719 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
21720
21721         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
21722         delegates passed to native code must use the STDCALL calling 
21723         convention. Fixes #35987.
21724
21725 2003-10-10  Martin Baulig  <martin@ximian.com>
21726
21727         * class.c (inflate_generic_type): If we're inflating for a generic
21728         type instance (and not for a generic method), return
21729         MONO_TYPE_MVAR unchanged.
21730
21731 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21732
21733         * string-icalls.c: Join ignores null strings in the source array.
21734         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
21735         * threads.c: GetAvailableTheads is slightly more accurate.
21736
21737 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
21738
21739         * threads.h threads.c : add mono_threads_set_default_stacksize
21740         and pass default to CreateThread calls.
21741
21742 2003-10-09  Dick Porter  <dick@ximian.com>
21743
21744         * icall.c:
21745         * locales.h:
21746         * locales.c: Internal calls for constructing CultureInfo and
21747         related objects from libicu (if its available.)
21748
21749 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
21750
21751         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
21752
21753 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21754
21755         * threadpool.c: added an argument to async_invoke_thread that is the
21756         item to process, pass the MonoAsyncResult to the thread start function
21757         when creating a new thread. This way we don't need to acquire any lock
21758         when we're creating a new thread. Readded a semaphore for faster
21759         response times (instead of that Sleep i added).
21760
21761 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
21762
21763         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
21764         get daylight change dates better on Windows, fix handling
21765         of platforms without tm_gmtoff.
21766
21767 2003-10-06  Martin Baulig  <martin@ximian.com>
21768
21769         * class.c (inflate_generic_method): Renamed to
21770         mono_class_inflate_generic_method() and made public.
21771         (mono_class_init): Don't inflate the generic methods here.
21772         (mono_class_from_generic): Added `gboolean inflate_methods'
21773         argument.  Inflate the methods here.
21774
21775         * loader.c (mono_method_get_param_names): Ignore instances of
21776         generic types for the moment.
21777
21778         * reflection.c (fixup_method): Added support for inflated methods.
21779         (mono_image_create_token): Use mono_image_get_methodref_token()
21780         for inflated methods.
21781         (mono_custom_attrs_from_param): Ignore instances of generic types
21782         for the moment.
21783         (mono_reflection_bind_generic_parameters): New public function.
21784         Moved all the functionality from
21785         ves_icall_Type_BindGenericParameters() here and added support for
21786         dynamic types.
21787         (mono_reflection_define_generic_parameter): Initialize
21788         `klass->methods' here.
21789
21790         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
21791         functionality into mono_reflection_define_generic_parameter().
21792         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
21793         TypeBuilder, return that TypeBuilder.
21794
21795 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21796
21797         * appdomain.c: removed mono_delegate_semaphore.
21798
21799         * threadpool.c:
21800         (mono_thread_pool_add): moved hash table creation inside and the thread 
21801         creation outside of the critical region.
21802         (mono_thread_pool_finish): removed obsolete code.
21803         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
21804         continue or exit the thread depending on the queue.
21805
21806 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
21807
21808         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
21809         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
21810         handle more bool marshalling options
21811
21812 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
21813
21814         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
21815         arrays of structs. Also add a more descriptive error message when
21816         a structure member is marshalled as LPArray.
21817
21818 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
21819
21820         * marshal.c (mono_marshal_get_native_wrapper): Add support for
21821         marshalling arrays of complex types. Fixes #29098. Also remove an
21822         usused and incomplete function.
21823
21824 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
21825
21826         * gc.c: report heap_size - free_bytes as total memory allocated
21827         (bug#49362).
21828
21829 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
21830
21831         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
21832         fix timezone handling problems on Windows.
21833         
21834         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
21835         asserts when the year is outside the range handled by ms the functions.
21836
21837         * class.c (setup_interface_offsets): If the class is an interface,
21838         fill out its interface_offsets slot.
21839
21840 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21841
21842         * threadpool.c: mark threadpool threads as background.
21843
21844 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
21845
21846         * decimal.c - define DECINLINE to nothing if not using GCC
21847
21848 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
21849
21850         * assembly.c: More refcount fixes.
21851
21852 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21853
21854         * string-icalls.c: if we're not trimming, return the same string.
21855         When not splitting, don't create a new string.
21856
21857 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21858
21859         * image.c:
21860         (mono_image_open): increment the ref_count inside the critical section.
21861
21862 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
21863
21864         * image.c (mono_image_open): Fix reference counting bug.
21865
21866 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
21867
21868         * marshal.c (mono_marshal_type_size) struct alignment changed for 
21869         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
21870         64bits. Avoid leak in mono_marshal_get_native_wrapper when
21871         mono_lookup_pinvoke_call throws.        
21872
21873 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
21874
21875         * reflection.c (mono_reflection_parse_type): Fix #49114.
21876
21877         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
21878         temporary workaround for cygwin header problem.
21879
21880         * object.c (mono_object_isinst): Synchronize this with the code
21881         generated by the JIT for casts.
21882
21883 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
21884
21885         * reflection.c (encode_type): Fix #38332.
21886
21887 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
21888
21889         * marshal.c (mono_marshal_method_from_wrapper): New function to return
21890         the original method from the wrapper method.
21891
21892 2003-09-25  Martin Baulig  <martin@ximian.com>
21893
21894         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
21895         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
21896         (ves_icall_Type_get_IsGenericInstance): New interncall.
21897
21898 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
21899
21900         * object.c: fix cast warning in big endian code.
21901
21902 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
21903
21904         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
21905         
21906 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21907
21908         * assembly.c: don't call check_env from mono_assembly_load. It's
21909         already done once in mono_assemblies_init and may cause headaches when
21910         multiple threads are loading assemblies.
21911
21912 2003-09-19  Martin Baulig  <martin@ximian.com>
21913
21914         * reflection.c (mono_reflection_define_generic_parameter): Don't
21915         allocate `klass->methods', set `klass->flags' to
21916         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
21917
21918 2003-09-18  Martin Baulig  <martin@ximian.com>
21919
21920         * class.c (mono_class_init): Don't create `class->methods' if it's
21921         already initialized.
21922
21923         * metadata.c (mono_metadata_load_generic_params): Make this
21924         actually work.
21925
21926         * reflection.c (mono_reflection_define_generic_parameter): Set
21927         parent class and interfaces from the constraints.
21928
21929         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
21930         to keep this struct in sync with the declaration in TypeBuilder.cs.
21931
21932 2003-09-17  Martin Baulig  <martin@ximian.com>
21933
21934         * metadata.h (MonoType): Replaced the data's `int type_param'
21935         field with `MonoGenericParam *generic_param'.
21936         (MonoGenericParam): Added `MonoClass *klass'.
21937
21938         * class.c (mono_class_from_gen_param): Removed the
21939         `MonoImage *image' and `int type_num' arguments.
21940
21941         * metadata.c (mono_metadata_parse_generic_param): New static
21942         method; creates a MonoGenericParam which just contains the index.
21943         (do_mono_metadata_parse_type): Call
21944         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
21945         MONO_TYPE_MVAR.
21946
21947         * reflection.c (mono_image_typedef_or_ref): Generic type
21948         parameters may be in the same assembly, but never use a typedef
21949         for them.
21950         (mono_reflection_define_generic_parameter): We're now creating a
21951         "real" class for the type parameter; it's now safe to call
21952         mono_class_from_mono_type() on the class'es type, it'll do the
21953         right thing.
21954
21955 2003-09-16  Martin Baulig  <martin@ximian.com>
21956
21957         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
21958         `symfile->range_entry_size' and `symfile->class_entry_size' here;
21959         the `symfile' data structure must be fully initialized before it
21960         gets added to the table.
21961
21962 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
21963
21964         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
21965
21966         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
21967         class init trampolines.
21968
21969 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
21970
21971         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
21972         to the built-in profiler to turn off time and allocation profiling
21973         respectively.
21974
21975 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
21976
21977         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
21978         g_direct_equal.
21979
21980         * debug-helpers.c (mono_method_full_name): Print the wrapper type
21981         in human readable form.
21982
21983 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
21984
21985         * reflection.c icall.c: Fixed warnings.
21986
21987         * image.c (load_class_names): Use a temporary hash table to hold the
21988         namespaces in order to avoid doing many string comparisons.
21989
21990         * image.h: Fix typo.
21991
21992         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
21993         Pass NULL instead of g_direct_equal to the GHashTable constructor 
21994         since the NULL case is short-circuited inside g_hash_table_lookup, 
21995         leading to better performance.  
21996
21997         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
21998         obtain the first custom attribute for a given index. Depends on the
21999         CustomAttribute table being sorted by the parent field.
22000
22001         * reflection.c (mono_custom_attrs_from_index): Use the new function 
22002         for better performance.
22003
22004 2003-09-07  Martin Baulig  <martin@ximian.com>
22005
22006         * class.c (mono_class_init): If we're a generic instance, inflate
22007         all our methods instead of loading them from the image.
22008         (mono_class_from_generic): Set `class->methods = gklass->methods'.
22009
22010 2003-09-07  Martin Baulig  <martin@ximian.com>
22011
22012         * mono-debug-debugger.c: Added support for constructors.
22013
22014 2003-09-06  Martin Baulig  <martin@ximian.com>
22015
22016         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
22017         New interncall.
22018
22019         * reflection.c (mono_reflection_setup_generic_class): Call
22020         ensure_runtime_vtable() to create the vtable.
22021
22022 2003-09-05  Martin Baulig  <martin@ximian.com>
22023
22024         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
22025         MONO_TYPE_MVAR.
22026
22027 2003-09-04  Martin Baulig  <martin@ximian.com>
22028
22029         * reflection.c (mono_reflection_define_generic_parameter): Generic
22030         parameters start with zero.
22031
22032 2003-09-04  Martin Baulig  <martin@ximian.com>
22033
22034         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
22035
22036         * reflection.h (MonoReflectionGenericParam): New typedef.
22037         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
22038         the generic parameters from the managed TypeBuilder.
22039
22040         * reflection.c (mono_reflection_define_generic_parameter): New function.
22041         (mono_reflection_create_runtime_class): Encode generic parameters.
22042         (mono_reflection_setup_generic_class): New function; this is
22043         called after adding adding all generic params to the TypeBuilder.
22044         (encode_type): Added MONO_TYPE_VAR.
22045
22046 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
22047
22048         * class.h class.c (mono_class_needs_cctor_run): Moved this method
22049         here from the JIT.
22050
22051         * assembly.h assembly.c: Moved the AOT loading code into an assembly
22052         load hook.
22053
22054 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
22055
22056         * reflection.h reflection.c class.h class.c: Delete duplicate 
22057         definition of mono_type_get_name () from reflection.c and export the
22058         one in class.c.
22059
22060         * class.c: Class loading fixes from Bernie Solomon 
22061         (bernard@ugsolutions.com).
22062
22063         * reflection.c: Endianness fixes from Bernie Solomon 
22064         (bernard@ugsolutions.com).
22065         
22066 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
22067
22068         * assembly.h assembly.c: Define a file format version for AOT
22069         libraries.
22070         
22071         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
22072
22073         * appdomain.h (MonoJitInfo): New field to determine whenever the
22074         code is domain neutral.
22075         
22076 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
22077
22078         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
22079
22080 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
22081
22082         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
22083         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
22084         Avoid caching the result since strings must be domain specific. Fixes
22085         #48050.
22086
22087 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
22088
22089         * marshal.c (mono_marshal_init): Make this callable multiple times
22090         since it is hard to find a correct place to call it.
22091
22092         * object.c (mono_runtime_class_init): Execute static constructors in
22093         the correct appdomain.
22094
22095         * image.c (build_guid_table): Handle the case when multiple images have
22096         the same GUID.
22097
22098 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22099
22100         * icall.c: added a couple of icalls for System.Web.
22101
22102 2003-08-28  Martin Baulig  <martin@ximian.com>
22103
22104         * icall.c (ves_icall_Type_BindGenericParameters): Use
22105         `klass->generic_inst' instead of `&klass->byval_arg' in the
22106         mono_type_get_object() call.  The returned type must be
22107         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
22108
22109 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
22110
22111         * NOTES: New file.
22112
22113         * object.c (mono_class_proxy_vtable): Make it thread safe.
22114
22115         * pedump.c: Fix warning.
22116
22117         * object.c appdomain.h: Get rid of metadata_section. 
22118         It is no longer needed and it was causing deadlocks with domain->lock.
22119
22120         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
22121
22122 2003-08-26  Martin Baulig  <martin@ximian.com>
22123
22124         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
22125
22126 2003-08-26  Martin Baulig  <martin@ximian.com>
22127
22128         * pedump.c (main): Call mono_metadata_init(),
22129         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
22130         and mono_loader_init().
22131
22132 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
22133
22134         * loader.h: Add missing include to fix build.
22135
22136         * image.h: mono_image_load_references is no more.
22137
22138         * assembly.c: Reworked assembly loading to make it really thread safe.
22139         After these changes, the assembly returned by mono_assembly_open is
22140         fully initialized, i.e. all its references assemblies are loaded.
22141
22142         * assembly.c (mono_image_load_references): Renamed to 
22143         mono_assembly_load_references, and made private, since clients no
22144         longer need to call it.
22145
22146         * class.c: Removed calls to mono_assembly_load_references, since it was
22147         a source of deadlocks.
22148
22149         * loader.h loader.c class.h class.c: Protect data structures using a 
22150         new lock, the loader lock.
22151
22152         * class.c (mono_class_setup_vtable): Create temporary hash tables and
22153         GPtrArrays only when needed.
22154
22155         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
22156         into empty structures by mcs. Fixes pinvoke7.cs.
22157         
22158         * domain.c (mono_init): Call a new initialization function.
22159
22160         * appdomain.c (mono_runtime_init): Call the new initializer function
22161         of the marshal module.
22162
22163         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
22164         inserted into empty structures by mcs. Fixes pinvoke7.cs.
22165
22166         * marshal.h marshal.c: Added locks around the wrapper caches to make
22167         this module thread safe.
22168
22169         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
22170         this argument. Fixes pinvoke1.exe.
22171
22172 2003-08-25  Lluis Sanchez <lluis@ximian.com>
22173
22174         * object.h: Added call_type field to MonoMethodMessage and the corresponding
22175         enumeration of values. Removed fields to store remote call output values in
22176         MonoAsyncResult. Not needed any more.
22177         * object.c: Initialize call_type and async_result fields in mono_message_init.
22178         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
22179         dispatching the message.
22180         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
22181         async call to finish. To do it use a message with EndInvoke call type.
22182
22183 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
22184
22185         * loader.h loader.c (mono_method_hash_marhal_info): New function which
22186         determines whenever a method has marshalling info.
22187
22188 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22189
22190         * assembly.c: fix the build on windows.
22191
22192 2003-08-22 Lluis Sanchez <lluis@ximian.com>
22193
22194         * object.cs: Fixed bug #47785.
22195
22196 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
22197
22198         * string-icalls.c (StringReplace): If their are no occurances of
22199         the old string found return a reference to the supplied
22200         string. This saves some memory and matches MS behavoir.
22201         
22202 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22203
22204         * socket-io.c: fixed compilation for systems that define AF_INET6
22205         and don't define SOL_IP/SOL_IPV6.
22206
22207 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
22208
22209         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
22210         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
22211
22212         * rawbuffer.c rawbuffer.h: Make this module thread safe.
22213
22214         * domain.c: Make this module thread safe.
22215
22216         * domain.c (mono_init): Call new initialization function.
22217
22218         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
22219         reference types too. Fixes #38812.
22220
22221         * image.c (mono_image_init): Fixed warnings.
22222
22223         * class.c (mono_class_from_typeref): Handle assembly load failure
22224         correctly.
22225
22226         * appdomain.c (add_assemblies_to_domain): Handle the case when
22227         the references of an assembly are not yet loaded.
22228
22229         * metadata.c image.c assembly.c: Moved initialization of global
22230         variables to a separate function called at startup since lazy 
22231         initialization of these variables is not thread safe.
22232         
22233         * image.c assembly.c: Made this module thread safe by adding locks in 
22234         the appropriate places.
22235
22236         * domain.c (mono_init): Call the new initialization functions of the
22237         three modules.
22238
22239 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
22240
22241         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
22242           make a direct call. It is proxy's work to make the call asynchronous.
22243           mono_delegate_end_invoke(): If the targe is a proxy, just collect
22244           the return values.
22245         * object.cs: mono_method_call_message_new(): read AsyncResult and
22246           state object from parameters list, if this info is requested.
22247         * object.h: Added fields to store remote call output values in
22248           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
22249
22250 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
22251
22252         * object.h: add needed fields to MonoThread.
22253         * threads.c, threads.h: allow registering a function to cleanup data
22254         allocated per thread by the JIT.
22255
22256 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22257
22258         * loader.h: portability fix by Bernie Solomon
22259         * <bernard@ugsolutions.com>.
22260
22261 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
22262
22263         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
22264         return a MonoArray. This simplifies the code and also ensures that
22265         the cache allways contains an object reference as a value.
22266
22267         * icall.c (ves_icall_get_parameter_info): Simplified using the new
22268         function.
22269
22270 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22271
22272         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
22273         fixes a problem with byte ordering when getting the address family for
22274         a socket.
22275
22276 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
22277
22278         * .cvsignore: Added monosn.
22279
22280         * reflection.h reflection.c loader.c: Added support for parameter
22281         marshalling to dynamically created types. Fixes #47295.
22282
22283 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
22284
22285         * rand.c: remove useless warnings.
22286
22287 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
22288
22289         * class.c: implemented ldtoken for methods and fieldrefs.
22290
22291 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22292
22293         * threadpool.c: when mono_async_invoke was called, no one took care of
22294         monitoring the queue. So if the method invoked took some time and we
22295         got new async invoke requests after 500 ms (the thread created waited
22296         that long in WaitForSingleObject), the new async invoke was not called
22297         until the previous one finished.
22298
22299         This is fixed now. Thanks to Totte for helping with it.
22300
22301 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22302
22303         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
22304
22305 2003-08-11  Martin Baulig  <martin@ximian.com>
22306
22307         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
22308
22309 2003-08-06  Martin Baulig  <martin@ximian.com>
22310
22311         * mono-debug-debugger.c: Added support for static fields,
22312         properties and methods.
22313
22314 2003-08-06  Martin Baulig  <martin@ximian.com>
22315
22316         * mono-debug-debugger.c: Don't store the MonoString's vtable to
22317         make this work for applications with multiple application domains.
22318
22319 2003-08-04  Martin Baulig  <martin@ximian.com>
22320
22321         * mono-debug-debugger.c: Completely reworked the type support; the
22322         most important thing is that we're now just using one single
22323         `MonoType' instance per type.
22324
22325 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
22326
22327         * mono-endian.h, mono-endian.c, icall.c: Added icall
22328         ves_icall_System_Double_AssertEndianity to assert double word endianity
22329         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
22330
22331 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
22332
22333         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
22334         support, icalls and fixes.
22335
22336 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
22337
22338         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
22339         classes that are a punctuation character in .NET is not the same a
22340         g_unichar_ispunct.
22341
22342 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22343
22344         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
22345
22346 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
22347
22348         * icall.c: Add new MemCopy internalcall.
22349         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
22350         Simplified code; It is not necessary to handle all the cases here,
22351         as the C# code takes care of it.  Only handle the case of the name
22352         resource embedded into the assembly.
22353
22354         Changed signature to return the data pointer and the size of the
22355         data. 
22356
22357 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
22358
22359         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
22360         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
22361
22362 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
22363
22364         * socket-io.c: ignore EINTR error in select.
22365
22366 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
22367
22368         * class.h, class.c: removed unused subclasses field in MonoClass.
22369
22370 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
22371
22372         * icall.c: improve fix of get_base_definition(). If the parent class
22373           doesn't have the mehod, look at the parent of the parent.
22374         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
22375           to check if a parameter is an in or out parameter
22376           (PARAM_ATTRIBUTE_IN is not set by default).
22377           mono_method_return_message_restore(): Use mono_class_value_size to
22378           get the size of a value type. mono_type_stack_size (parameterType)
22379           does not return the correct value if parameterType is byRef.
22380           mono_load_remote_field(), mono_load_remote_field_new(),
22381           mono_store_remote_field(), mono_store_remote_field_new():
22382           raise exception if the remote call returns an exception.
22383
22384 2003-07-28  Martin Baulig  <martin@ximian.com>
22385
22386         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
22387         method.  This is a wrapper around mono_runtime_invoke() which
22388         boxes the instance object if neccessary.
22389
22390 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
22391
22392         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
22393         metadata.h, row-indexes.h, verify.c: first cut of generics support.
22394
22395 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
22396
22397         * icall.c: disable mcs bug workaround.
22398
22399 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
22400
22401         * object.c (mono_runtime_class_init): Take the metadata_section
22402         mutex before obtaining the domain mutex.
22403
22404         * appdomain.h: Added definition of metadata_section mutex here. 
22405
22406         * object.c: define metadata_mutex here.
22407
22408 2003-07-24  Ravi Pratap  <ravi@ximian.com>
22409
22410         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
22411         fixed.
22412
22413 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
22414
22415         * reflection.c: Fix bug #46669
22416
22417 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22418
22419         * exception.c:
22420         * exception.h:
22421         * icall.c:
22422         * object.h: fill in the type name for TypeLoadException.
22423
22424 2003-07-23  Ravi Pratap  <ravi@ximian.com>
22425
22426         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
22427         relationship between TypeBuilders while compiling corlib) and bug
22428         45993 (Array types returned from the runtime while compiling
22429         corlib were from the loaded corlib).
22430
22431 2003-07-22  Martin Baulig  <martin@ximian.com>
22432
22433         * mono-debug-debugger.c: Reworked the type support a bit more;
22434         distinguish between types and classes.
22435
22436 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
22437
22438         * icall.c: add IsArrayImpl icall.
22439
22440 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
22441
22442         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
22443         initializing real_size only once. Also fix bug #46602.
22444
22445 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
22446
22447         * object.c: Renamed mono_metadata_section to metadata_section.
22448
22449 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
22450
22451         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
22452           empty array if the type is an array. Fixed.
22453           ves_icall_MonoMethod_get_base_definition: if the base method
22454           is abstract, get the MethodInfo from the list of methods of
22455           the class.
22456         * reflection.c: ParameterInfo.PositionImpl should be zero-based
22457           and it was 1-based. Fixed in mono_param_get_objects.
22458
22459 2003-07-20  Martin Baulig  <martin@ximian.com>
22460
22461         * mono-debug.h: Set version number to 31.
22462         (mono_debug_init): Added `MonoDomain *' argument.
22463
22464         * mono-debug-debugger.c: Reworked the type support; explicitly
22465         tell the debugger about builtin types; pass the `klass' address to
22466         the debugger.
22467
22468 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
22469
22470         * image.c: Allow new metadata tables to be loaded without a
22471         warning. Also update the warning message to give the new constant value.
22472                 
22473 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
22474
22475         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
22476         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
22477         array type representation changes.
22478
22479 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
22480
22481         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
22482         on Environment.Exit () call.
22483
22484 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
22485
22486         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
22487         requires a matching corlib.
22488
22489 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
22490
22491         * Changelog: My editor decided to add a CR to each line. Sorry about that.
22492           Committed again without the CRs.
22493         
22494 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
22495
22496         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
22497           getting it from the "this" socket instance. Did not work
22498           if the socket is a subclass of Socket.
22499           Also fixed bug #35371.
22500
22501 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
22502
22503         * metadata.c: fixed size for TypedByRef.
22504         * loader.c: when searching for a method, consider the vararg amrker.
22505         * unicode.c, decimal.c: constify some arrays.
22506
22507 2003-07-15  Dick Porter  <dick@ximian.com>
22508
22509         * socket-io.c: Fixed compilation for gcc < 3.2.
22510
22511         Fixed compilation for machines that don't have AF_INET6 (thanks to
22512         Bernie Solomon <bernard@ugsolutions.com> for that part.)
22513
22514         Fixed compile warnings.
22515         
22516         Fixed formatting and line endings.
22517
22518 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
22519
22520         * socket-io.h:
22521         * socket-io.c: Added IPv6 support.
22522
22523 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
22524
22525         * class.c (mono_class_is_assignable_from): New function to implement
22526         the is_assignable_from logic. Used by mono_object_isinst, 
22527         Type::IsAssignableFrom () and the interpreter.
22528
22529         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
22530         Object, even interfaces.
22531         
22532         * object.c (mono_object_isinst): Implement in terms of 
22533         is_assignable_from.
22534
22535         * icall.c (ves_icall_type_is_assignable_from): New icall.
22536
22537 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
22538
22539         * domain.c (foreach_domain): fix compiler warning.
22540
22541 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
22542
22543         * image.c (load_metadata_ptrs): use g_strndup because strndup is
22544         not available on all plattforms
22545
22546 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
22547
22548         * image.h image.c: Store the metadata version string in MonoImage.
22549         * icall.c: New icall to retrieve the image version.
22550         * reflection.c (create_dynamic_image): Fill in the image version field
22551         * reflection.c (build_compressed_metadata): Use the image version
22552         from the image structure.
22553
22554 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22555
22556         * appdomain.c: modified comment.
22557         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
22558         That will be its last iteration when mono_gc_cleanup is called from
22559         mono_runtime_cleanup and before the domain is unloaded.
22560
22561         Fixes bug #45962.
22562
22563 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
22564
22565         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
22566         attributes.
22567
22568 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
22569
22570         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
22571         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
22572         Bernie Solomon <bernard@ugsolutions.com>.
22573
22574 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
22575
22576         * object.c, object.h: provide mono_object_new_fast() for faster
22577         allocation in some special cases.
22578
22579 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
22580
22581         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
22582         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
22583
22584 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
22585
22586         * threadpool.c: fix leaks.
22587
22588 2003-07-01  Dick Porter  <dick@ximian.com>
22589
22590         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
22591         using MonoGHashTables.  Fixes threadpool bug posted to list.
22592
22593 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
22594
22595         * image.h, image.c: added support to load an assembly from a byte array.
22596         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
22597         assembly bundle support.
22598
22599 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
22600
22601         * threadpool.c (mono_thread_pool_add): keep a reference to the
22602         AsyncResult to prevent GC
22603
22604 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
22605
22606         * class.c: leak fix.
22607
22608 2003-06-25  Dick Porter  <dick@ximian.com>
22609
22610         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
22611         for the async object, the WaitHandle object will close the handle.
22612         Fixes bug 45321.
22613
22614 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
22615
22616         * class.c: in mono_array_class_get (), lookup from the hash with the
22617         same type we insert: this works around a bug in
22618         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
22619         lluis. The real fix will have to wait for after the release.
22620
22621 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
22622
22623         * icall.c: fix memory leak when getting type members.
22624
22625 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
22626
22627         * reflection.c: added more pubtoken special cases.
22628
22629 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
22630
22631         * class.c: handle field offset correctly when class size
22632         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
22633
22634 2003-06-20  Martin Baulig  <martin@ximian.com>
22635
22636         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
22637         *image' field.
22638
22639 2003-06-20  Martin Baulig  <martin@ximian.com>
22640
22641         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
22642
22643 2003-06-20  Martin Baulig  <martin@ximian.com>
22644
22645         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
22646         just distinguish between variables in registers and variables at
22647         an offset relative to a register.
22648
22649 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22650
22651         * icall.c: #ifdef out latest changes until mcs is fixed.
22652
22653 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
22654
22655         * icall.c: return members in metadata order.
22656
22657 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
22658
22659         * icall.c: avoid infinite loop in GetTimeZoneData.
22660
22661 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
22662
22663         * icall.c: added Marshal.Prelink/All icalls.
22664
22665 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
22666
22667         * object.c, object.h: fix warnings and do some overflow checking
22668         when creating arrays.
22669
22670 2003-06-17  Dick Porter  <dick@ximian.com>
22671
22672         * file-io.h:
22673         * file-io.c: File attributes need to be tweaked slightly when
22674         passed from the managed to the w32 world.
22675
22676 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
22677         * profiler.h profiler-private.h profiler.c: Rework last patch
22678         based on suggestion by Paolo.
22679         
22680 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
22681
22682         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
22683         instruction level coverage data collection.
22684         * profiler.h profiler.c (: Added new callback function which can be
22685         used by the profiler to limit which functions should have coverage
22686         instrumentation.
22687         * profiler.c (mono_profiler_load): Call g_module_build_path to
22688         generate the file name of the profiler library.
22689
22690 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
22691
22692         * profiler.c, profiler.h, profiler-private.h: added basic block 
22693         coverage profiling API.
22694
22695 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
22696
22697         * reflection.c (mono_reflection_create_runtime_class): Add support
22698         for events in dynamically generated code.
22699
22700         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
22701         not allocated.
22702
22703 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
22704
22705         * icall.c: when getting timezone info, return reasonable values if we
22706         can't get the actual data.
22707
22708 2003-06-14  Dick Porter  <dick@ximian.com>
22709
22710         * threads.c (start_wrapper): Remove the reference to the thread
22711         object in the TLS data, so the thread object can be finalized.
22712         This won't be reached if the thread threw an uncaught exception,
22713         so those thread handles will stay referenced :-( (This is due to
22714         missing support for scanning thread-specific data in the Boehm GC
22715         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
22716
22717 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
22718
22719         * reflection.c: ensure streams and tables are first allocated with
22720         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
22721
22722 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
22723
22724         * icall.c: fixed GetElementType for byrefs (bug# 44792).
22725
22726 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
22727
22728         * reflection.c (mono_reflection_create_runtime_class): Add support for
22729         properties to dynamically created classes.
22730         * reflection.c: Fix a few places where non-MonoObjects were inserted
22731         into the tokens hashtable.
22732
22733 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
22734
22735         * object.c: some support to handle out of memory exceptions.
22736
22737 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
22738
22739         * marshal.c (mono_marshal_get_native_wrapper): support reference
22740         return types
22741
22742 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
22743
22744         * object.h, object.c: more portability stuff from Bernie Solomon.
22745         Unexport mono_object_allocate(). Added mono_object_unbox ().
22746         Set exitcode when an unhandled exception is thrown.
22747
22748 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
22749
22750         * marshal.c (mono_marshal_get_native_wrapper): use custom
22751         marshaler for return types.
22752
22753 2003-06-10  Dick Porter  <dick@ximian.com>
22754
22755         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
22756         ip_mreq is available
22757
22758 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
22759
22760         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
22761         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
22762         by Bernie Solomon <bernard@ugsolutions.com>.
22763
22764 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
22765
22766         * gc.c (mono_gc_init): Avoid error message on shutdown when
22767         GC_DONT_GC=1 is used.
22768
22769         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
22770         New icall to return the GUID of a module.
22771
22772 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
22773
22774         * class.c: ensure instance size always includes the parent's size
22775         even whem class size is set explicitly (fixes bug#44294).
22776
22777 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
22778
22779         * profiler.h, profiler.c: made the simple profiler thread-safe,
22780         get more accurate timing info. Allow the loading of an
22781         externally-developed profiler module.
22782
22783 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
22784
22785         * marshal.c (mono_marshal_get_native_wrapper): improved
22786         class/byref arguments.
22787         (mono_marshal_get_native_wrapper): better string marshaling support.
22788
22789 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
22790
22791         * class.c: ensure .pack and .size are handled correctly and
22792         simplified layout of static fields.
22793
22794 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
22795
22796         * appdomain.c
22797         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
22798
22799         * loader.c (mono_lookup_pinvoke_call): look for modules in the
22800         current directory (fix bug 44008)
22801
22802 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
22803
22804         * marshal.c (mono_marshal_get_native_wrapper): started support for
22805         custom marshalers.
22806         (mono_delegate_to_ftnptr): consider marshalling specifications
22807
22808 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
22809
22810         * reflection.c, reflection.h: emit custom marshal info.
22811
22812 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22813
22814         * object.c: free the GError.
22815         * icall.c: added CloseEvent_internal.
22816         * threads.[ch]:
22817         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
22818         call.
22819
22820 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
22821
22822         * loader.c (mono_method_get_signature): Add support for dynamic
22823         assemblies.
22824
22825 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
22826
22827         * reflection.c: fixed bug #43905.
22828
22829 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
22830
22831         * class.c, domain.c, icall.c, metadata.h, object.h: support for
22832         handling TypedReference and ArgIterator.
22833         * loader.c, loader.h: added function to get signature at call site.
22834
22835 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
22836
22837         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
22838         data readonly. Buglets and warning fixes. Some MethodSpec support.
22839
22840 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
22841
22842         * class.h, class.c, object.c: remove relative numbering support.
22843
22844 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
22845
22846         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
22847         free the string, until we get a chance to fix Gtk#
22848
22849 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22850
22851         * marshal.c: revert last patch.
22852
22853 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
22854
22855         * icall.c: updates for new mono_class_vtable() not calling
22856         the type constructor anymore.
22857
22858 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
22859
22860         * object.h, object.c: separate vtable creation from type
22861         initialization. Make running the .cctor thread safe.
22862
22863 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
22864
22865         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
22866
22867 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
22868
22869         * loader.c (mono_get_method): consider calling convention
22870
22871 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
22872
22873         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
22874         to return the invisible global type for a module.
22875
22876         * reflection.c (mono_image_build_metadata): Emit global fields too.
22877
22878 2003-05-20  Peter Williams  <peterw@ximian.com>
22879
22880         * loader.c (mono_lookup_internal_call): Add a few newlines.
22881
22882 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
22883
22884         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
22885         literal strings.
22886
22887         * appdomain.c (set_domain_search_path): Recalculate search path when
22888         AppDomainSetup.PrivateBinPath changes.
22889
22890         * object.c (mono_class_compute_gc_descriptor): It turns out some
22891         parts of the class libs (like System.Thread) holds pointers to
22892         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
22893         to treat native int a pointer type here.
22894         
22895 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
22896
22897         * appdomain.h, domain.c: add hashtable for jump target resolution.
22898
22899 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
22900
22901         * reflection.h reflection.c icall.c: Added new icalls 
22902         GetManifestResourceInfoInternal, GetModulesInternal and support
22903         infrastructure.
22904
22905 2003-05-16  Dick Porter  <dick@ximian.com>
22906
22907         * icall.c:
22908         * file-io.h:
22909         * file-io.c: Implement System.IO.MonoIO::GetTempPath
22910
22911 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
22912
22913         * object.c: mono_store_remote_field: little fix to previous patch.
22914
22915 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
22916
22917         * class.c: add constructors to array classes.
22918         * icall.c: special case array construction for InternalInvoke (),
22919
22920 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
22921
22922         * class.h class.c reflection.c object.c: Added support for field
22923         defaults in dynamically generated classes.
22924
22925 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
22926
22927         * reflection.c: properly encode charset for ddlimport.
22928
22929 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
22930
22931         * threads.c: allow compiling without GC.
22932
22933 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
22934
22935         * appdomain.h, object.c, object.h, threads.c, threads.h: added
22936         handling of thread static data.
22937
22938 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22939
22940         * reflection.h, reflection.c: added mono_custom_attrs_free ().
22941
22942 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
22943
22944         * class.c (mono_array_class_get): always set the serializable flags
22945         (mono_array_class_get): always set the SEALED attribute for array types
22946
22947 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
22948
22949         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
22950         attributes (fix for bug 42021).
22951
22952 2003-05-12  Dick Porter  <dick@ximian.com>
22953
22954         * gc.c: Don't run finalizers when the finalizer thread is
22955         finishing up, because the default domain has already been
22956         destroyed.
22957
22958 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
22959
22960         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
22961         value is null, we should throw an exception.   This is slightly
22962         different than the other conventions used for the constructor.
22963
22964 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22965
22966         * socket-io.c: fixed windows build.
22967
22968 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22969
22970         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
22971
22972 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
22973
22974         * object.c (mono_string_new_wrapper): Compatibility fix for MS
22975         compilers.
22976
22977 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
22978
22979         * class.c (mono_class_layout_fields): Add experimental GC aware
22980         auto layout facility. Requires class library changes to work correctly.
22981
22982         (mono_class_setup_vtable): Avoid overriding explicit interface
22983         method implementations. Fixes iface3.exe test.
22984
22985         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
22986         object reference.
22987         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
22988         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
22989
22990         * metadata.h: Add new type classification macro which determines
22991         whenever the type holds an object reference.
22992
22993 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
22994
22995         * marshal.c (mono_marshal_get_native_wrapper): cleanups
22996
22997 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
22998
22999         * gc.c (finalizer_thread): Work around a GC bug.
23000
23001 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
23002
23003         * marshal.c (emit_struct_conv): allow unions
23004
23005         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
23006
23007 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
23008
23009         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
23010
23011 2003-05-06  Martin Baulig  <martin@ximian.com>
23012
23013         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
23014
23015 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23016
23017         * socket-io.c:
23018         (Select_internal): allow NULLs, don't create arrays if not needed.
23019         Coupled with Socket.cs changes.
23020
23021         * threadpool.c:
23022         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
23023         register a finalizer for it that will close the semaphore handle. This
23024         fixes the leak and make Lupus' test run with > 4080 loops.
23025
23026 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
23027
23028         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
23029         Jerome Laban (bug #42287)
23030
23031 2003-05-02  Martin Baulig  <martin@ximian.com>
23032
23033         * debug-mono-symfile.h
23034         (MonoSymbolFile): Moved declaration into mono-debug.h.
23035         (MonoDebugMethodJitInfo): Likewise.
23036         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
23037         argument.
23038         (_mono_debug_address_from_il_offset): Take a
23039         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
23040
23041         * mono-debug.h
23042         (MonoDebugDomainData): New struct.
23043         (mono_debug_get_domain_data): New function.
23044         (mono_debug_add_method): Take an additional `MonoDomain *'
23045         argument.
23046         (mono_debug_source_location_from_address): Likewise.
23047         (mono_debug_il_offset_from_address): Likewise.
23048         (mono_debug_address_from_il_offset): Likewise.
23049
23050 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
23051
23052         * reflection.c: one more check for null type in custom attrs.
23053
23054 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23055
23056         * reflection.c: avoid warning (comparison is always false due to limited
23057         range of data type).
23058
23059 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23060
23061         * icall.c: throw an exception in Type.GetField if the argument 'name'
23062         is NULL.
23063
23064 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
23065
23066         * reflection.c: fixed handling of enums in named arguments to custom
23067         attributes (bug #42123).
23068
23069 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
23070
23071         * reflection.c: use the right array element type and handle
23072         a null for a Type argument, too.
23073
23074 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
23075
23076         * reflection.c: handle arrays as arguments to custom attributes.
23077
23078 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
23079
23080         * reflection.c: handle a string value in a custom attr
23081         ctor that takes an object.
23082
23083 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
23084
23085         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
23086         (fix bug #42063)
23087
23088 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
23089
23090         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
23091
23092 2003-04-27  Martin Baulig  <martin@ximian.com>
23093
23094         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
23095         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
23096         MONO_DEBUGGER_EVENT_BREAKPOINT.
23097         (mono_breakpoint_trampoline_code): Removed.
23098         (mono_debugger_event_handler): The last argument is now a
23099         `guint32'.
23100         (mono_debugger_insert_breakpoint_full): Removed the
23101         `use_trampoline' argument.
23102         (mono_debugger_method_has_breakpoint): Likewise.
23103         (mono_debugger_trampoline_breakpoint_callback): Renamed to
23104         mono_debugger_breakpoint_callback(); take the method and
23105         breakpoint number as arguments.
23106
23107 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
23108
23109         * metadata.c: fix off by one when loading parameters attributes.
23110
23111 2003-04-24  Martin Baulig  <martin@ximian.com>
23112
23113         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
23114
23115 2003-04-24  Martin Baulig  <martin@ximian.com>
23116
23117         * mono-debug-debugger.c: Moved all code which interacts with the
23118         Mono Debugger here.
23119
23120         * debug-mono-symfile.c: This code now just deals with the symbol
23121         file itself, the debugger code is now in mono-debug-debugger.c.
23122
23123 2003-04-23  Martin Baulig  <martin@ximian.com>
23124
23125         * mono-debug.c (mono_debug_source_location_from_il_offset):
23126         New method; like mono_debug_source_location_from_address(), but
23127         takes an IL offset instead of a machine address.
23128
23129 2003-04-23  Martin Baulig  <martin@ximian.com>
23130
23131         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
23132         `line' field; this is now computed by the debugger.
23133
23134 2003-04-23  Martin Baulig  <martin@ximian.com>
23135
23136         * mono-debug.[ch]: New files.  This is the new debugging interface.
23137
23138         * mono-debug-debugger.[ch]: New files.  Moved all code which
23139         interacts with the Mono Debugger here.
23140
23141 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
23142
23143         * domain.c (mono_init): initialize mono_defaults.monitor_class
23144
23145 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
23146
23147         * reflection.c (method_encode_code): Add a spicy exception to help
23148         future compiler authors.
23149
23150 2003-04-21  Martin Baulig  <martin@ximian.com>
23151
23152         * icall.c
23153         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
23154         Make this work with relative pathnames; g_filename_to_uri() needs
23155         an absolute filename.
23156
23157 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
23158
23159         * icall.c: Track name changes in Object and ValueType.
23160
23161 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
23162
23163         * metadata.c (mono_type_stack_size): size should be a multiple of
23164         sizeof (gpointer)
23165
23166 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23167
23168         * gc.c:
23169         (internal_domain_finalize): moved into mono_domain_finalize. No need
23170         to create another thread because the finalizers will be run in the
23171         finalizer thread.
23172         
23173         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
23174         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
23175         to be run (MS does this too).
23176
23177 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
23178
23179         * object.c (mono_class_compute_gc_descriptor): Update comment.
23180
23181         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
23182
23183         * image.h: Add synchronized wrapper cache.
23184
23185         * image.c (do_mono_image_open): Initialize cache.
23186
23187         * reflection.c (create_dynamic_mono_image): Initialize cache.
23188
23189 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23190
23191         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
23192         ves_icall_System_Buffer_ByteLengthInternal.
23193
23194 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
23195
23196         * reflection.c: setup klass->nested_in earlier. Allow
23197         a dash in the assembly name.
23198
23199 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
23200
23201         * metadata.c (mono_type_to_unmanaged): dont access
23202         type->data.klass for MONO_TYPE_OBJECT
23203         (mono_type_to_unmanaged): consider System.Delegate class
23204
23205 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
23206
23207         * class.c: just setup supertypes in the proper place instead of
23208         initializing the full element class for arrays.
23209
23210 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
23211
23212         * class.c: ensure the element class of arrays is initialized.
23213         Setup the supertype info for array classes, too.
23214
23215 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
23216
23217         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
23218
23219 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23220
23221         * Makefile.am: re-added -m option when running cygpath. This way,
23222         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
23223         separator.
23224         * mono-config.c: same codepath for locating mono config file for WIN32
23225         and the rest.
23226         * assembly.c: if mono_assembly_setrootdir is called, don't override
23227         the value set.
23228
23229 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23230
23231         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
23232         MONO_ASSEMBLIES variable.
23233
23234 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
23235
23236         * icall.c: added Assembly::GetNamespaces() icall.
23237
23238 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23239
23240         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
23241
23242 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
23243
23244         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
23245         * object.c: fixed bug in the construction of vtable for proxies
23246
23247 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
23248
23249         * object.c (mono_array_new): Mark mono_array_new as an icall.
23250
23251 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23252
23253         * class.c: fixed test for public method when overriding interfaces.
23254         Closes bug #40970.
23255
23256 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
23257
23258         * appdomain.h, domain.c: added mono_domain_foreach() to
23259         be able to access the currently loaded appdomains.
23260         * object.c: make string interning work across sppdomains.
23261         Mark some functions for use as icalls.
23262
23263 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
23264
23265         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
23266
23267         * reflection.h reflection.c: Allocate long living data using 
23268         GC_MALLOC_ATOMIC so the collector does not need to scan it.
23269
23270         * reflection.c: Double the allocation size in streams instead of
23271         increasing it, to prevent unneccesary copying on large assemblies.
23272         
23273         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
23274         creation if the assembly does not have the Run flag set.
23275
23276 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
23277
23278         * class.h: avoid the C++ keywords in header files (Jerome Laban
23279         spotted and fixed this).
23280
23281 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23282
23283         * object.c:
23284         (mono_unhandled_exception): fill in the arguments for the
23285         UnhandledException event. Only trigger that event for the default
23286         domain (as MS does).
23287
23288 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
23289
23290         * object.c: Improve typed allocation stuff based on suggestions from
23291         Paolo. Also turn it on if the GC library supports it.
23292
23293 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
23294
23295         * object.c object.h class.h: Added experimental typed allocation
23296         facility using the interfaces in gc_gcj.h.
23297
23298         * os/gc_wrapper.h: Added new include files.
23299         
23300 2003-04-03  Martin Baulig  <martin@ximian.com>
23301
23302         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
23303         which is not yet enabled by default.
23304
23305         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
23306         functions.
23307         (mono_gc_lock, mono_gc_unlock): New static functions.
23308
23309         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
23310         functions; stop/start the world for the garbage collector.  This
23311         is using the windows API; we need to complete the SuspendThread()/
23312         ResumeThread() implementation in the io-layer to make this work on Unix.
23313         (mono_gc_push_all_stacks): New public function; tells the garbage
23314         collector about the stack pointers from all managed threads.
23315
23316 2003-04-03  Martin Baulig  <martin@ximian.com>
23317
23318         * object.h (MonoThread): Added `gpointer stack_ptr'.
23319
23320         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
23321
23322 2003-04-03  Martin Baulig  <martin@ximian.com>
23323
23324         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
23325
23326 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
23327
23328         * reflection.c (typebuilder_setup_fields): Initialize field.first and
23329         field.last.
23330
23331 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
23332
23333         * loader.c (mono_lookup_internal_call): Report the corlib that is
23334         out of sync.
23335
23336 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
23337
23338         * icall.c (ves_icall_type_GetTypeCode): fixed check for
23339         System.DBNull (it's class not valuetype).
23340
23341 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
23342
23343         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
23344         if the array method was already assigned a token (fixes bug#40646).
23345
23346 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
23347
23348         * reflection.c (mono_reflection_get_type): Attempt type resolve even
23349         if no assembly is given.
23350
23351 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
23352
23353         * metadata.h: Added the new tables.
23354
23355         * row-indexes.h: Added definitions for new tables.
23356
23357         * metadata.c: Add schemas for new tables, and add support for
23358         computing the sizes of them.
23359
23360         * class.c: Update for handling the new type cases.
23361
23362 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
23363
23364         * metadata.h (MONO_TYPE_IS_VOID): new macro
23365
23366 2003-03-31  Martin Baulig  <martin@ximian.com>
23367
23368         * threads.h (MonoThreadCallbacks): Added `thread_created'.
23369
23370         * threads.c (mono_thread_new_init): Call `thread_created' in the
23371         mono_thread_callbacks.
23372
23373 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
23374
23375         * loader.h: added marshalbyrefobject_class to mono_defaults
23376         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
23377         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
23378           generation of output parameters.
23379           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
23380         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
23381           contextbound and the target object belongs to the context of the caller.
23382         * object.h: added context and unwrapped_server variables in MonoRealProxy.
23383         * object.c: Implemented support for interfaces and abstract classes
23384           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
23385           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
23386
23387 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
23388
23389         * class.h class.c (mono_class_is_subclass_of): New function.
23390         
23391         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
23392         routines for most common case (calls from ArrayList::ToArray).
23393
23394         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
23395         routine so programs which call Environment::Exit() can be profiled.
23396
23397         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
23398         Added MONO_ARCH_SAVE_REGS.
23399
23400         * icall.c (ves_icall_type_is_subtype_of): Use new function.
23401
23402 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
23403
23404         * blob.h: Add a couple of new MonoType types definitions.
23405
23406         * tabledefs.h: Add a couple of new call convs.
23407
23408 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
23409
23410         * reflection.h (MonoReflectionDynamicAssembly): track changes in
23411         the layout of the class.
23412
23413         * reflection.c (alloc_table): double the size on overflow to avoid
23414         unnecessary copying.
23415
23416         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
23417         avoid filling out metadata tables and blobs. Also set mb->ilgen to
23418         null so it can be garbage collected.
23419         
23420 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
23421
23422         * reflection.c (mono_reflection_get_type): Return the resolved type
23423         only if it is in the assembly we searched.
23424
23425         * reflection.c (ensure_runtime_vtable): Initialize method slots.
23426
23427         * class.c (mono_class_setup_vtable): Set the slot of the overriding
23428         method.
23429
23430 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23431
23432         * appdomain.c:
23433         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
23434         the right one is 'file:///blah', but MS allows it.
23435         * assembly.c:
23436         (mono_assembly_open): allow 'file://blah'
23437
23438         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
23439
23440 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
23441
23442         * socket-io.c: fixes bug #40310.
23443
23444 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
23445
23446         * reflection.c (mono_reflection_parse_type): handle deeply nested
23447         types correctly.
23448
23449         * reflection.c (mono_image_create_token): Use unique token values
23450         since they will be put into a hash table.
23451
23452         * class.c (mono_class_setup_vtable): If a method occurs in more than
23453         one place in the vtable, and it gets overriden, then change the
23454         other occurances too.
23455
23456         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
23457         object as return type.
23458
23459 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
23460
23461         * icall.c: Deleted "ToString" implementation for double and float
23462         because they are full implemented in managed code.
23463
23464 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23465
23466         * reflection.c, reflection.h: implemented and exported functions
23467         to retrieve info about custom attributes.
23468
23469 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23470
23471         * appdomain.c: moved Uri handling to assembly.c
23472         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
23473         work when using a file Uri in *nix and windows.
23474
23475         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
23476         GetReferencedAssemblies.
23477
23478 2003-03-18  Dick Porter  <dick@ximian.com>
23479
23480         * icall.c: Rename a couple of internal calls
23481
23482         * threads.c: Set the thread state to Stopped when a thread exits.
23483         Fixes bug 39377.
23484
23485 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
23486
23487         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
23488         New icall.
23489
23490         * object.c (mono_class_vtable): fix warning.
23491
23492 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
23493
23494         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
23495
23496         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
23497         memory.
23498         (method_encode_clauses): Create exception info structures in the right
23499         order.
23500         (mono_reflection_setup_internal_class): Initialize supertypes field.
23501
23502         * class.c object.c: Handle interfaces which implement other interfaces 
23503         correctly.
23504
23505         * class.h class.c: Move the supertypes array initialization code into 
23506         a separate function so it can be used for dynamic types too. Also call
23507         it earlier, in mono_class_init(), since it can be used before the
23508         type is initialized.
23509
23510 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23511
23512         * Makefile.am:
23513         * assembly.c:
23514         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
23515
23516         * appdomain.c:
23517         * appdomain.h:
23518         * marshal.c:
23519         * object.c: remove warnings.
23520
23521 2003-03-13  Martin Baulig  <martin@ximian.com>
23522
23523         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
23524         (MonoDebugLexicalBlockEntry): New types.
23525
23526         * debug-mono-symfile.c
23527         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
23528
23529 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23530
23531         * process.c: ret can be any non-zero value accroding to MS doc.
23532
23533 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
23534
23535         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
23536         fixing a warning for a miss-used prototype, would have cause
23537         random memory corruption.
23538
23539 2003-03-07  Martin Baulig  <martin@ximian.com>
23540
23541         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
23542         getting really annoying ....
23543
23544 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
23545
23546         * reflection.c (fixup_method): added support for array methods.
23547
23548 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
23549
23550         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
23551         (pointed out by Michael Adams).
23552
23553 2003-03-04  Dick Porter  <dick@ximian.com>
23554
23555         * icall.c: Temporarily reverted the Double and Single ToString()
23556         change, because it broke nunit.
23557
23558 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
23559
23560         * object.h, threads.h: make include files compatible with C++
23561         (patch by Jerome Laban <jlaban@wanadoo.fr>).
23562
23563 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
23564
23565         * icall.c: Erased ToString helper functions for Double and Single.
23566         Now, that implementations ar all in managed code (Double and Single
23567         Formatters).
23568
23569 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
23570
23571         * appdomain.c: Added method for initializing the default context of
23572         a domain. Added internal call for getting the default context.
23573         * appdomain.h: Added context variable in MonoDomain struct.
23574         * domain.c: mono_domain_set also sets the default context of the domain
23575         * icall.c: Mapped internal method InternalGetDefaultContext.
23576         * object.c: mono_object_get_virtual_method returns always a remoting
23577         wrapper if the object is a transparent proxy.
23578         mono_runtime_invoke_array: when creating an object by calling the
23579         constructor, if the created object is a proxy, then the constructor should
23580         be called using the a remoting wrapper.
23581
23582 2003-03-03  Dick Porter  <dick@ximian.com>
23583
23584         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
23585         variable so it compiles on solaris.  Problem spotted by
23586         Christopher Taylor <ct@cs.clemson.edu>
23587
23588 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23589
23590         * appdomain.c:
23591         (get_info_from_assembly_name): don't leak value.
23592
23593         * icall.c:
23594         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
23595         result.
23596
23597 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
23598
23599         * assembly.c: export mono_image_load_references ().
23600         * class.c: handle function pointers. mono_class_from_name() now
23601         supports nested type names directly.
23602
23603 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
23604
23605         * reflection.h reflection.c: Encode already created dynamic methods 
23606         and fields correctly as a DEF instead of a REF.
23607
23608         * reflection.c: Get rid of the force_ref argument to 
23609         mono_image_typedef_or_ref since it was wrong in the first place.
23610
23611         * string-icalls.c: add error checking to string constructors according
23612         to the MSDN docs.
23613
23614         * reflection.c: Emit types in the order their TypeBuilders were 
23615         created. Previously, a new table index was assigned to each type before
23616         the tables were emitted. This was wrong because the signature blob
23617         might already refer to a type by its original table index.
23618
23619 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
23620
23621         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
23622         change.
23623         
23624 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23625
23626         * Makefile.am: make assemblies dir have \ instead of / on windows.
23627
23628 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
23629
23630         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
23631         iterate over the NESTEDCLASS table using a linear search since the
23632         table is not guaranteed to be sorted by the secondary key.
23633
23634         * class.c (mono_class_create_from_typedef): fixed up call to
23635         mono_metadata_nesting_typedef.
23636         
23637 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
23638
23639         * marshal.c (mono_string_to_byvalstr): clear the memory as
23640         suggested by Jerome Laban <jlaban@wanadoo.fr>
23641
23642 2003-02-26  Dick Porter  <dick@ximian.com>
23643
23644         * process.c: Cope with padding in .rsrc blocks
23645
23646 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
23647
23648         * metadata.h: reverted the filter_len change, it breaks reflection
23649         
23650 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
23651
23652         * metadata.h: added a new field to store the filter_len
23653         
23654
23655 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23656
23657         * reflection.c: handle custom attributes for types and members
23658         created with Reflection.Emit (bug#38422).
23659
23660 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
23661
23662         * reflection.c: define RTSpecialName automatically for constructors for
23663         compatibility with MS.NET.
23664
23665         * reflection.c (mono_reflection_create_runtime_class): initialize
23666         nested_in field of dynamically created classes.
23667
23668 2003-02-22  Martin Baulig  <martin@ximian.com>
23669
23670         * debug-mono-symfile.h: Incremented version number.
23671
23672 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
23673
23674         * object.h icall.c process.c: fix warnings.
23675
23676 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
23677
23678         * appdomain.h appdomain.c:
23679         (mono_domain_try_type_resolve): split the 
23680         name_or_tb argument into a name and a tb argument.
23681         (mono_domain_has_type_resolve): new function to check whenever the
23682         application has registered a TypeResolve event handler.
23683         
23684         * icall.c reflection.h reflection.c: move the type resolve logic into
23685         mono_reflection_get_type () so it will be invoked when 
23686         Assembly::GetType () is called.
23687
23688         * reflection.c:
23689         (mono_reflection_get_type): renamed to get_type_internal.
23690         (mono_reflection_get_type): fixed type name generation so it works 
23691         for nested types too.
23692         (mono_reflection_get_type): call has_type_resolve () to avoid the 
23693         costly type name generation if there is no resolve event handler.
23694
23695 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23696
23697         * class.c, image.c: load exported types from file references.
23698
23699 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
23700
23701         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
23702           used to cache the managed methods used to create proxies and make 
23703           remote invocation of methods.
23704         * class.h: Added in MonoVTable a flag to indicate that a class needs 
23705           to be remotely created.
23706         * object.c: Modified the method mono_class_vtable(). It now initializes 
23707           the remote flag of the vtable. Modified mono_object_new_specific(), 
23708           so now it checks the remote flag.
23709         * icall.c: Added a couple of internal methods, one for enabling instance 
23710           creation interception for a type, and one for creating objects bypassing
23711           the remote check.
23712
23713 2003-02-18  Martin Baulig  <martin@ximian.com>
23714
23715         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
23716         New interncall to get a method's metadata token.
23717
23718         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
23719         New interncall for the debugger.
23720
23721 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
23722
23723         * class.c (mono_class_setup_vtable): allocate supertype array
23724
23725 2003-02-18  Martin Baulig  <martin@ximian.com>
23726
23727         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
23728
23729 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23730
23731         * reflection.c:
23732         (assembly_name_to_aname): jump over unknown properties (i've found
23733         something like: 'type, assembly, version=xxx, custom=null, public...',
23734         so now will ignore custom=null and still get the rest of the values).
23735
23736 2003-02-17  Dick Porter  <dick@ximian.com>
23737
23738         * threads.c: Have Thread.Start() wait for a semaphore to signal
23739         that the thread has set up all its local data.  This fixes bug
23740         34323, where Abort() raced the new thread's TLS data.
23741
23742         Also removes the handle_store() call from start_wrapper, because
23743         threads are now always created suspended and there is no longer a
23744         race between the parent and child threads to store the info.
23745
23746 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
23747
23748         * image.c: explain the #- heap issue in a message, hopefully
23749         avoiding FAQs on mono-list.
23750
23751 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23752
23753         * icall.c:
23754         (GetEntryAssembly): if the domain has not invoked
23755         AppDomain.ExecuteAssembly yet, return the assembly of the default
23756         AppDomain.
23757
23758 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
23759
23760         * class.c (mono_ldtoken): make it work in dynamic assemblies.
23761
23762 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23763
23764         * metadata.c, reflection.c: simple speedup to type hash
23765         and equals code.
23766
23767 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
23768
23769         * image.c, image.h, class.c, assembly.c: move module loading
23770         to MonoImage. When loading metadata, consider alignemnet from
23771         the start of metadata, not from the metadata address in memory.
23772
23773 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
23774
23775         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
23776         AssemblyBuilder objects. Factored out custom attribute creation into
23777         a separate function.
23778         (create_custom_attr): new function to create custom attributes.
23779
23780 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
23781
23782         * Makefile.am: Got tired of typing the full pathname to pedump.
23783         Until there is another option, am installing this.
23784
23785 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
23786
23787         * class.c (class_compute_field_layout): always set field->parent 
23788         (mono_ldtoken): use mono_defaults.fieldhandle_class;
23789
23790 2003-02-11  Dick Porter  <dick@ximian.com>
23791
23792         * threads-types.h:
23793         * monitor.c: Rewrote Monitor, making lock much faster and
23794         Pulse/Wait work as specified.  Also uses much fewer handles, and only
23795         creates them as needed.
23796
23797         * exception.c: Added SynchronizationLockException
23798
23799         * threads.c: Deleted old Monitor implementation.  The new one is
23800         in a new file.
23801
23802 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
23803
23804         * class.c: handled TypedReference type code. Set the correct size for
23805         class data. Setup interface_offsets for interface classes, too.
23806
23807 2003-02-09  Martin Baulig  <martin@ximian.com>
23808
23809         * debug-mono-symfile.h: Reflect latest symbol writer changes.
23810
23811 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
23812
23813         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
23814         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
23815         * object.c: fixed mono_object_get_virtual_method () for interfaces.
23816         * verify.c: check for code that runs after the end of the method.
23817
23818 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
23819
23820         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
23821         "System.Math::Round2".
23822         * sysmath.h: Added Floor, Round and Round2 definitions.
23823         * sysmath.c: Modified certain functions that were not 100% compliant
23824         with MS.NET (math precision) and added the implementation of Floor,
23825         Round and Round2.
23826
23827 2003-02-07  Martin Baulig  <martin@ximian.com>
23828
23829         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
23830
23831 2003-02-07  Martin Baulig  <martin@ximian.com>
23832
23833         * debug-mono-symfile.c: Reflected latest symwriter changes.
23834         (mono_debug_create_mono_symbol_file): Removed.
23835         (mono_debug_open_mono_symbol_file): Take an argument which
23836         specifies whether to create a dynamic symbol file.
23837
23838 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
23839
23840         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
23841
23842 2003-02-05  Martin Baulig  <martin@ximian.com>
23843
23844         * reflection.c (mono_image_build_metadata): Make this public,
23845         protect it against being called multiple times, don't create
23846         resources and don't build the compressed metadata here.
23847         (mono_image_create_pefile): Do this here.
23848
23849         * icall.c
23850         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
23851
23852 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23853
23854         * socket-io.c: fixed bug #36322.
23855
23856 2003-02-06  Piers Haken <piersh@friskit.com>
23857
23858         * appdomain.[ch]:
23859         * class.h:
23860         * debug-mono-symfile.c:
23861         * icall.c:
23862         * loader.c:
23863         * mono-config.c:
23864         * monosn.c:
23865         * reflection.c:
23866         * socket-io.c: warning cleanups
23867
23868 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
23869
23870         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
23871         function. works like remoting invoke, but does a check for the Proxy first.
23872
23873 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
23874
23875         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
23876
23877 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
23878
23879         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
23880         array of pointers.
23881         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
23882         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
23883
23884         * object.c (mono_store_remote_field_new): used by the new jit
23885         instead of mono_store_remote_field
23886         (mono_load_remote_field_new): used by the new jit
23887         instead of mono_load_remote_field
23888
23889 2003-02-05  Patrik Torstensson
23890
23891         * appdomain.c: changed unload to take the domain id instead
23892         of domain
23893         
23894         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
23895
23896
23897 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23898
23899         * appdomain.c: don't look for assemblies in ApplicationBase if
23900         PrivateBinPathProbe is set.
23901
23902 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23903
23904         * object.c: make the first argument in main_args contain the absolute
23905         path to the assembly. Fixes bug #37511.
23906
23907 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23908
23909         * icall.c: get correct UTC offset for countries not using daylight
23910         time saving. Fixes bug #30030.
23911
23912 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23913
23914         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
23915         and 1 are the family).
23916
23917 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
23918
23919         * icall.c (ves_icall_InternalExecute): removed wrong assertion
23920
23921         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
23922
23923 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
23924
23925         * reflection.c: added support for SignatureHelper tokens, which is
23926         needed by the Calli opcode.
23927
23928         * reflection.h: track changes to SignatureHelper class.
23929
23930         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
23931
23932 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23933
23934         * appdomain.c: fixed loading assemblies from PrivateBinPath.
23935
23936 2003-02-03  Patrik Torstensson
23937         * appdomain.[c|h], domain.c : 
23938          - Added support for getting a domain via domain id
23939          - Support for setting and getting domain from System.AppDomain 
23940            (used in cross appdomain channel)
23941          - Added support for get/set for a MonoAppContext on a thread 
23942            (Context class in System.Runtime.Remoting.Contexts),
23943          - Removed hack in Get/SetData and ExecuteAssembly.
23944         
23945         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
23946         the managed world to get control when a proxy is created.
23947
23948         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
23949         
23950 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
23951
23952         * icall.c
23953         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
23954         Populate the codebase field as well.
23955
23956 2003-02-02  Martin Baulig  <martin@ximian.com>
23957
23958         * debug-mono-symfile.c
23959         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
23960         (mono_debug_symfile_add_method): Allow interncalls.
23961
23962 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23963
23964         * icall.c: throw parse exception if strtod fails or the string is empty.
23965
23966 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
23967
23968         * marshal.c: handle object type separately from defined
23969         class types.
23970
23971 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
23972
23973         * marshal.c: handle NATIVE_LPSTR for strings when it's
23974         explicitly specified.
23975
23976 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
23977
23978         * reflection.c, reflection.h, icall.c: setup the reflection
23979         handle cache for ModuleBuilders and AssemblyBuilders.
23980
23981 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
23982
23983         * reflection.c (reflection_methodbuilder_to_mono_method): set
23984         pinvoke flag
23985
23986 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23987
23988         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
23989
23990 2003-01-29  Dick Porter  <dick@ximian.com>
23991
23992         * threads.c: No need for the fake_thread kludge now that Thread
23993         doesn't run a class constructor
23994         
23995 2003-01-29  Dick Porter  <dick@ximian.com>
23996
23997         * threads.c: Use g_direct_hash instead of the rather bogus
23998         g_int_hash
23999
24000 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
24001
24002         * marshal.c (mono_marshal_get_native_wrapper): add check for null
24003         (fix pinvoke12.exe)
24004         (mono_marshal_get_struct_to_ptr): generate valid IL code
24005         (mono_marshal_get_ptr_to_struct): generate valid IL code
24006         (*): correctly set sig->pinvoke, we need to memdup the signature
24007         to do that
24008
24009 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
24010
24011         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
24012         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
24013
24014 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
24015
24016         * profiler.c: provide more callers information.
24017
24018 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
24019
24020         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
24021
24022         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
24023
24024         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
24025
24026 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24027
24028         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
24029         exception instead of going into an infinite loop on dates which it 
24030         can't yet handle.
24031
24032         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
24033         out-of-range exception if needed.
24034
24035         * class.c (mono_class_setup_vtable): allow a virtual method to provide
24036         an implementation for an interface method and to override an inherited
24037         method at the same time. 
24038         Imagine a scenario when a virtual method is used to override a
24039         virtual abstract method in a parent class, and this same method 
24040         provides an implementation for an method inherited from an interface. 
24041         In this case, the interface resolution code will set im->slot, which 
24042         means that the virtual method override pass will skip this method 
24043         which means a pointer to the abstract method inherited from the parent
24044         will remain in the vtable of this non-abstract class.
24045
24046         * class.c: (mono_class_setup_vtable): continue search for a real 
24047         method if only an abstract method is found.     
24048
24049 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
24050
24051         * reflection.c: add size to encoding for ByValStr and ByValArray
24052         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
24053
24054 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24055
24056         * class.c (mono_class_setup_vtable): pass the override info as an
24057         argument.
24058
24059         * class.c (mono_class_setup_vtable): set the slot of overriding methods
24060         correctly.
24061         
24062         * reflection.c (ensure_runtime_vtable); add support for method 
24063         overrides.
24064         
24065 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24066
24067         * reflection.c (resolution_scope_from_image): Hack to work to work with
24068         dynamic assemblies.
24069
24070         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
24071         added a 'force_ref' argument to force this function to allways return 
24072         a TypeRef. This is needed by mono_image_get_memberref_token ().
24073         
24074 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24075
24076         * reflection.c (mono_image_get_type_info): interfaces really don't have
24077         a parent.
24078
24079         * reflection.c (mono_image_basic_init): fill out missing fields of
24080         image structure.
24081
24082         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
24083         dynamic assemblies. This is required so dynamic assemblies show up in
24084         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
24085         Type::GetType() etc. This is consistent with MS behaviour.
24086
24087         * image.c image.h reflection.c: add newly created classes to the name 
24088         cache so mono_class_get () will find them.      
24089
24090 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24091
24092         First part of changes to get IKVM.NET running under mono.
24093         
24094         * appdomain.h, appdomain.c: added new function 
24095         mono_domain_try_type_resolve() which will emit TypeResolve events. 
24096         This function will call AppDomain::DoTypeResolve to do the actual work.
24097
24098         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
24099         moved existing code dealing with dynamic tokens to a new function 
24100         called mono_reflection_lookup_dynamic_token (). This function will 
24101         raise TypeResolve events when appropriate. Since reflection.c is not 
24102         part of libmetadata, a new hook function called 
24103         mono_lookup_dynamic_token() is added to class.c which will call this.
24104
24105         * assembly.h assembly.c: make the invoke_load_hook function public,
24106         so it can be called for dynamic assemblies.
24107
24108         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
24109
24110         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
24111         type isn't found.
24112
24113         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
24114         MonoGHashTable, since it contains pointers to objects which the GC 
24115         needs to track.
24116
24117         * assembly.c (search_loaded): remove unused variable.
24118         
24119 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
24120
24121         * object.c: fixed issue exposed by gcc-generated IL programs
24122         that use RVA data for pointers.
24123
24124 2003-01-25  Martin Baulig  <martin@ximian.com>
24125
24126         * threads.c (start_wrapper): Moved the initialization of
24127         `start_func' above the mono_new_thread_init() call to which we
24128         pass it as argument.
24129
24130 2003-01-24  Martin Baulig  <martin@ximian.com>
24131
24132         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
24133         the MonoThread pointer.
24134
24135 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
24136
24137         * icall.c: Rename `PowImpl' to Pow.
24138
24139 2003-01-23  Dick Porter  <dick@ximian.com>
24140
24141         * threads.c (start_wrapper): Create a Thread object if needed, so
24142         the Main() thread can do the class initialisation in a subthread
24143         that has been set up to allow managed code execution.
24144
24145         Pass the thread ID instead of the MonoThread pointer to the thread
24146         start and attach callbacks.  This change is required, because the
24147         jit thread start callback must be called _before_ the Thread
24148         object can be created.
24149         
24150         (mono_thread_init): Removed much object creation code that is no
24151         longer needed.  No managed code is called from here now.
24152
24153         * object.c (mono_runtime_exec_managed_code): Create a subthread
24154         for Main, and call back to the runtime to use it.
24155         Set the exit code when Main exits.
24156
24157         * gc.c: Make sure domain finalisation happens in a subthread.
24158         Re-enable threaded GC, fixing bug 31333 (again).
24159
24160         * environment.c: System.Environment internall calls (so far just
24161         ExitCode is here, the others are still in icall.c)
24162
24163         * appdomain.c (mono_runtime_cleanup): All threads running managed
24164         code should have finished before mono_runtime_cleanup() is
24165         reached, so no need to clean up threads.
24166
24167 2003-01-22  Martin Baulig  <martin@ximian.com>
24168
24169         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
24170         `gpointer func' arguments.      
24171         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
24172         but added `MonoThread *thread' argument.
24173         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
24174
24175         * threads.c (mono_new_thread_init): Added `gpointer func' argument
24176         and pass it to the mono_thread_start_cb callback.
24177         (mono_install_thread_callbacks): New public function to install a
24178         set of callbacks which are set by the debugger.
24179         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
24180
24181 2003-01-22  Martin Baulig  <martin@ximian.com>
24182
24183         * Makefile.am: Install debug-mono-symfile.h.
24184
24185 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
24186
24187         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
24188
24189 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
24190
24191         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
24192         * class.c (mono_ptr_class_get): correctly set access levels of pointers
24193         (mono_array_class_get): correctly set access levels of arrays
24194
24195 2003-01-20      Patrik Torstensson
24196         * image.h (MonoAssemblyName): changed major, minor, build, revision
24197         from signed to unsigned.
24198
24199 2003-01-20  sean kasun <skasun@azstarnet.com>
24200
24201         * reflection.c (load_cattr_value): Now this handles
24202         MONO_TYPE_SZARRAY.  Fixes bug #35629
24203
24204 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
24205
24206         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
24207         integer value
24208
24209 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24210
24211         * decimal.c: fixed bug #26056.
24212
24213 2003-01-17  Martin Baulig  <martin@ximian.com>
24214
24215         * gc.c: Raise an ExecutionEngineException instead of using g_error().
24216
24217 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24218
24219         * exception.[ch]:
24220         (mono_get_exception_type_initialization): new function.
24221
24222         * object.c: throw a TypeInitializationException when an exception is
24223         thrown invoking the class constructor.
24224
24225 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24226
24227         * reflection.c: fixed attribute reading.
24228
24229 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24230
24231         * icall.c:
24232         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
24233         provided, look for the type in the calling assembly and then in
24234         mscorlib; if the assembly name is provided, only try that one.
24235
24236 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
24237
24238         * object.c: register the vtable before there is a chance it's
24239         queried again recursively.
24240
24241 2003-01-13  Duncan Mak  <duncan@ximian.com>
24242
24243         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
24244         gc-internal.h. 
24245         
24246 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
24247
24248         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
24249
24250 2003-01-11  Martin Baulig  <martin@ximian.com>
24251
24252         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
24253         this to 20 for the release.
24254
24255 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
24256
24257         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
24258
24259         * loader.c (mono_method_get_marshal_info): bug fix
24260
24261         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
24262         structures with explicit layout
24263
24264 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
24265
24266         * profiler.c: made the output more readable (and sorted). 
24267         Added caller information for the allocation profiler.
24268
24269 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
24270
24271         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
24272
24273 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24274
24275         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
24276         to get value types.
24277         
24278 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
24279
24280         * object.c, profiler.h, profiler.c, profiler-private.h:
24281         Added object allocation profiler.
24282
24283 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
24284
24285         * reflection.h, reflection.c: handle global methods.
24286         Compress blob entries.
24287
24288 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
24289
24290         * marshal.c: fix compilation.
24291
24292 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
24293
24294         * loader.c (mono_method_get_marshal_info): impl.
24295
24296         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
24297
24298 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24299
24300         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
24301         for reference types.
24302
24303 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
24304
24305         * loader.c: fixed off by one error in loaded parameter names.
24306
24307 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
24308
24309         * marshal.c (mono_marshal_get_icall_wrapper): like
24310         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
24311         instead of a MonoMethod.
24312
24313 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24314
24315         * decimal.c: fixed bug #36537.
24316
24317 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
24318
24319         * marshal.c: throw a missing method exception if a
24320         P/Invoke method is not found.
24321
24322 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
24323
24324         * icall.c: allow a null this for constructors.
24325
24326 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
24327
24328         * icall.c: raise the proper exceptions if the arguments to the
24329         internal Invoke are incorrect.
24330
24331 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
24332
24333         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
24334
24335 2003-01-03  Martin Baulig  <martin@ximian.com>
24336
24337         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
24338
24339 2002-12-31  Martin Baulig  <martin@ximian.com>
24340
24341         * debug-mono-symfile.c: Completely rewrote the type section.
24342         Instead of using individual malloc()ed fields, we use one big
24343         continuous memory area and offsets into this area.
24344         See the comments in the source code for details.
24345
24346 2002-12-30  Martin Baulig  <martin@ximian.com>
24347
24348         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
24349
24350 2002-12-30  Martin Baulig  <martin@ximian.com>
24351
24352         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
24353         line number table in this data blob instead of using an external
24354         pointer.
24355
24356 2002-12-28  Martin Baulig  <martin@ximian.com>
24357
24358         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
24359
24360 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
24361
24362         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
24363         as a boxed return type.
24364
24365 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
24366
24367         * appdomain.c
24368         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
24369         g_build_filename to properly get separators on the filename created.
24370
24371         * object.h: Small change, introduce MonoMarshalByRefObject to
24372         track the layout of that structure in the C# universe as we make
24373         changes there.
24374
24375 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
24376
24377         * object.c: removed assert to allow static fields on interfaces.
24378         * loader.c: a TypeSpec may be used for any type, not just arrays.
24379
24380 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
24381
24382         * class.c, class.h: added mono_class_array_element_size ().
24383         Ignore static methods in interfaces.
24384
24385 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24386
24387         * threads.c: fixed the build under cygwin.
24388
24389 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
24390
24391         * reflection.c: handle nullref constants. Allocate keys for
24392         reflection handles with the GC.
24393
24394 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
24395
24396         * threads.c, threads.h: added mono_thread_get_abort_signal()
24397         to get a suitable signal for thread abort.
24398
24399 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
24400
24401         * metadata.c: fix handling of ExportedType table.
24402
24403 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24404
24405         * icall.c: added WriteWindowsDebugString internal call.
24406
24407 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24408
24409         * reflection.h: added fields to match C# implementation.
24410
24411 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24412
24413         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
24414
24415 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
24416
24417         * gc.h, gc-internal.h: Rename header for GC internal calls to
24418         gc-internal.h from gc.h as to not clash with Boehm GC having its
24419         header installed as <gc.h> in outside include paths.
24420         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
24421         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
24422
24423 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24424
24425         * icall.c: assign minor, build and revision in FillName.
24426
24427 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
24428
24429         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
24430         Added support for running code generated by Reflection.Emit.
24431
24432 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24433
24434         * appdomain.c: check for NULL argument in LoadFrom.
24435
24436 2002-12-10  Dick Porter  <dick@ximian.com>
24437
24438         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
24439
24440 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24441
24442         * appdomain.c: fix buglet when building exe file name.  Handle full
24443         assembly name (needed after latest changes to AssemblyName).
24444         * image.c:
24445         (mono_image_close): free some hashtables.
24446
24447 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
24448
24449         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
24450         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
24451         on some systems (redhat 7.3) 
24452
24453 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24454
24455         * threads.c: delete the critical section of a sync block,
24456         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
24457
24458 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
24459
24460         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
24461
24462 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24463
24464         * appdomain.[ch]: handle the assembly preload event to try loading the
24465         assemblies using the paths we have in the current domain.
24466
24467         * assembly.[ch]: created an assembly preload hook that is called to try
24468         loading the assembly by other means that the ones provided here.
24469
24470         * domain.c: initialize the domain search path.
24471
24472         From now on, assemblies (TODO: except corlib and System) are loaded
24473         according to these rules when using mono_assembly_load ():
24474
24475                 1. It tries to load the assembly from the ApplicationBase
24476                 of the current domain appending .dll and .exe (TODO: have to
24477                 try loading from name/name.dll and name/name.exe).
24478
24479                 2. It tries the search path specified in PrivateBinPath for the
24480                 current domain (if any).
24481
24482                 3. Previous behavior.
24483
24484 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
24485
24486         * icall.c: implemented GetInterfaceMap() related icall.
24487         * domain.c, loader.h: load MethodInfo in mono_defaults.
24488
24489 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
24490
24491         * gc.c: disable the finalizer thread for now, untill all the issues
24492         with it are resolved.
24493
24494 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
24495
24496         * string-icalls.c: handle embedded nulls in string ctor when the
24497         length is specified.
24498
24499 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
24500
24501         * class.c: look for explicit interface implementation in parent
24502         classes, too.
24503
24504 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
24505
24506         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
24507
24508 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
24509
24510         * gc.c: protect handles with a critical section.
24511
24512 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24513
24514         * icall.c:
24515         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
24516         parameters. If no assembly specified, try getting the type from all
24517         the assemblies in the current domain, else, load the assembly and get
24518         the type from it.
24519
24520 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24521
24522         * marshal.c: applied patch from Aleksey Demakov that fixes
24523         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
24524
24525 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24526
24527         * icall.c: fixed get_location.
24528
24529 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
24530
24531         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
24532         declarations to make it work with older gcc. 
24533
24534         * loader.c (mono_get_method): set signature->pinvoke for native calls
24535
24536 2002-11-20  Dick Porter  <dick@ximian.com>
24537
24538         * threads.c (mono_thread_init): Set the main thread's handle
24539
24540 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
24541
24542         * gc.c: allow compilation without GC support. Changed to match the
24543         mono coding style.
24544
24545 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
24546
24547         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
24548
24549 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
24550
24551         * reflection.c: set a public key token on the core assemblies.
24552
24553 2002-11-18  Dick Porter  <dick@ximian.com>
24554
24555         * threads.c: Split out some thread initialisation so that other
24556         files can set the start callback function.
24557
24558         * gc.c: Run finalisers in a separate thread, to avoid stack
24559         overflow.  Fixes bug 31333.
24560
24561         * appdomain.c: Set up GC finalisation thread.
24562
24563         * reflection.c: 
24564         * object.c: 
24565         * domain.c: Use gc.h macros for GC_malloc
24566         
24567 2002-11-15  Dick Porter  <dick@ximian.com>
24568
24569         * threadpool.c: 
24570         * threads.c:
24571         * appdomain.c: Removed mono_runtime_init_with_attach(),
24572         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
24573         merging the extra parameter with the existing function.  Removed
24574         unneeded code in mono_thread_attach().
24575
24576 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
24577
24578         * image.c (mono_image_loaded_by_guid): a method to get loaded
24579         images by guid. 
24580         (load_metadata_ptrs): we store the guid as string.
24581
24582 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
24583
24584         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
24585
24586         * metadata.c (mono_guid_to_string): imported method form Zoltan
24587         Varga (slightly modified)
24588
24589         * assembly.c (mono_assembly_open): load precompiled code
24590
24591         * loader.h (MonoMethod): we store the method token for use in the
24592         aot compiler. 
24593
24594 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24595
24596         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
24597         the hook function called when an assembly is loaded.
24598         
24599         * domain.c: Modified file.
24600         (mono_domain_assembly_load): removed hash table insertion of assemblies.
24601
24602         Fixes bug #33196.
24603
24604 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
24605
24606         * reflection.c: Map PEFileKind to the value expected by the WinNT
24607         image loader. 
24608
24609 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24610
24611         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
24612         Read until the buffer is filled completely.
24613
24614 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24615
24616         * icall.c: implemented MonoType.InternalGetEvent ().
24617
24618 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24619
24620         * appdomain.c: implemented InitAppDomainSetup. Delayed
24621         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
24622         the entry_assembly.
24623
24624         * assembly.c: base_dir is now an absolute path ending with
24625         G_DIR_SEPARATOR.
24626
24627         * icall.c: modified get_location according to the above changes.
24628
24629         * object.c: init AppDomain.SetupInformation for the default domain after
24630         we have the entry assembly.
24631
24632         * domain.c: when unloading a domain, setup = NULL.
24633
24634 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
24635
24636         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
24637
24638 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
24639
24640         * object.h, object.c: introduced mono_object_get_virtual_method ()
24641         to lookup the method invoked on an object when a callvirt is done on
24642         a method.
24643         * icall.c: make MethodInfo::Invoke() always do a virtual call.
24644
24645 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24646
24647         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
24648         current domain when loaded an assembly and failed to load it.
24649
24650         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
24651
24652 2002-10-31  Dick Porter  <dick@ximian.com>
24653
24654         * icall.c: 
24655         * file-io.h: 
24656         * file-io.c: Return the error status in a parameter, as the
24657         GetLastError() value has long since been blown away if we try and
24658         look it up in a subsequent internal call invocation.  Delete the
24659         GetLastError() internal call, because it's useless.
24660
24661 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
24662
24663         * class.[ch]: added cast_class to fix bug 29517
24664
24665 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
24666
24667         * marshal.c: create valid IL code in the filter clause:
24668         the new JIT is less forgiving:-)
24669
24670 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24671
24672         * icall.c: removed get_property internal call.
24673
24674 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
24675
24676         * appdomain.h domain.c: Added an ID to appdomains.
24677         
24678         * threads.c threads.h icall.c: Implement icall
24679         Thread:GetDomainID(), and remove unused icall 
24680         CurrentThreadDomain_internal.
24681
24682 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24683
24684         * icall.c: Don't recurse through the base types in GetConstructor.
24685         Fixes bug #32063. 
24686
24687 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
24688
24689         * mempool.h, mempool.c: added mono_mempool_empty() and
24690         mono_mempool_stats().
24691
24692 2002-10-23  Dick Porter  <dick@ximian.com>
24693
24694         * file-io.c: 
24695         * file-io.h: 
24696         * icall.c: Added MonoIO.GetFileType internal call
24697
24698 2002-10-17  Dick Porter  <dick@ximian.com>
24699
24700         * appdomain.c (mono_runtime_cleanup): Don't signal the async
24701         delegate semaphore before waiting for all threads to finish,
24702         because new threads can also call async delegates.  Fixes bug
24703         32004.
24704
24705         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
24706         of 3 seconds, in case another async job is queued.  (This part is
24707         needed because the bug fix reintroduced the 3s exit lag.)  This
24708         makes the mono_runtime_shutdown flag superfluous.
24709
24710 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
24711
24712         * reflection.c: include ehader size in method section headers.
24713         Really check for suplicated modules entries.
24714
24715 2002-10-17  Martin Baulig  <martin@gnome.org>
24716
24717         * debug-mono-symfile.c: Added back support for locals.
24718
24719 2002-10-14  Martin Baulig  <martin@gnome.org>
24720
24721         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
24722         MONO_TYPE_VOID.
24723
24724 2002-10-14  Martin Baulig  <martin@gnome.org>
24725
24726         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
24727         mono_class_get() instead of looking in the class cache. 
24728
24729 2002-10-13  Martin Baulig  <martin@gnome.org>
24730
24731         * debug-mono-symfile.c: Set version number to 28, include the
24732         signature in method names.
24733
24734 2002-10-13  Martin Baulig  <martin@gnome.org>
24735
24736         * debug-mono-symfile.h: Set version number to 27.
24737
24738 2002-10-11  Martin Baulig  <martin@gnome.org>
24739
24740         * gc.c: Don't register/unregister NULL pointers as disappearing links.
24741
24742 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
24743
24744         * metadata.c, metadata.h: added helper function to allocate signatures.
24745
24746 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24747
24748         * icall.c: added internal call to get the location of machine.config.
24749
24750 2002-10-08  Martin Baulig  <martin@gnome.org>
24751
24752         * debug-mono-symfile.c: Ignore classes with a pending init for the
24753         moment.
24754
24755 2002-10-03  Dick Porter  <dick@ximian.com>
24756
24757         * threads.c: Freebsd pthread_t is a pointer
24758
24759 2002-10-03  Dick Porter  <dick@ximian.com>
24760
24761         * socket-io.c: Implemented GetHostName_internal
24762
24763 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24764
24765         * mono-config.c:
24766         (mono_config_parse_file): don't leak the text.
24767
24768 2002-10-02  Martin Baulig  <martin@gnome.org>
24769
24770         * debug-mono-symfile.c: Added support for methods.
24771
24772 2002-10-01  Martin Baulig  <martin@gnome.org>
24773
24774         * debug-mono-symfile.c: Don't emit methods and line numbers for
24775         the dynamic symbol file, just write the type table.  We can easily
24776         have an external helper program which creates a symbol file for an
24777         IL file.        
24778
24779 2002-10-01  Dick Porter  <dick@ximian.com>
24780
24781         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
24782         Only add the handle to the cleanup array when we're about to
24783         launch the thread.  Bug 31425 deadlocked when the test was run on
24784         mono under w32.
24785
24786 2002-10-01  Martin Baulig  <martin@gnome.org>
24787
24788         * debug-mono-symfile.c: Added support for properties.
24789
24790 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
24791
24792         * reflection.c: unaligned store fix from Mark Crichton
24793         <crichton@gimp.org>.
24794
24795 2002-09-27  Martin Baulig  <martin@gnome.org>
24796
24797         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
24798         New interncall.
24799
24800 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24801
24802         * assembly.h, assembly.c: use a sane API to hook into the assembly
24803         loading process instead of a useless special-purpouse hack
24804         (ngen needs a hook, too, for example).
24805
24806 2002-09-27  Dick Porter  <dick@ximian.com>
24807
24808         * threads.c (mono_thread_init): Call GetCurrentProcess() so
24809         io-layer can set up some process handle info.  Not needed on w32,
24810         but doesn't hurt either.
24811
24812         * process.c: Pass the program name in the second parameter to
24813         CreateProcess, so the path is searched.  Include the working
24814         directory. Implemented process name, process enumeration, and some
24815         process detail internal calls.
24816         
24817         * icall.c: Added internal calls for process lookup, and some
24818         process details
24819
24820 2002-09-26  Martin Baulig  <martin@gnome.org>
24821
24822         * assembly.c (mono_install_open_assembly_hook): New global
24823         function to install a function to be invoked each time a new
24824         assembly is loaded.
24825         (mono_assembly_open): Run this callback function if set.
24826
24827         * debug-mono-symfile.c: Put back line numbers for the dynamic
24828         symbol file and also record the .il file as source file.  This
24829         allows us to install the temporary symbol file as `file.dbg' just
24830         like a compiler-generated one.
24831
24832 2002-09-26  Nick Zigarovich <nick@chemlab.org>
24833
24834         * Corrected typo in gc.c (BOHEM vs BOEHM).
24835
24836 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24837
24838         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
24839         GetProperties. Also avoid calling g_slist_length in GetProperties and
24840         GetMethods.
24841
24842 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24843
24844         * reflection.c: avoid unaligned stores (bug spotted by
24845         Mark Crichton  <crichton@gimp.org>).
24846
24847 2002-09-25  Martin Baulig  <martin@gnome.org>
24848
24849         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
24850         instead of guint64 for addresses and added prologue/epilogue info.
24851
24852 2002-09-25  Martin Baulig  <martin@gnome.org>
24853
24854         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
24855         store line number info.  For the dynamic symbol file, we only need
24856         to provide the JIT generated dynamic line number info for the dynamic
24857         symbol file.
24858
24859 2002-09-25  Martin Baulig  <martin@gnome.org>
24860
24861         * debug-mono-symfile.h: Incremented version number.
24862
24863 2002-09-24  Martin Baulig  <martin@gnome.org>
24864
24865         * class.c (mono_debugger_class_init_func): New global function
24866         pointer variable.
24867         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
24868         call it.
24869
24870         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
24871         function.  This is called via the mono_debugger_class_init_func
24872         hook to add all types to the dynamic type table.
24873         (ves_icall_MonoDebugger_GetType): New interncall to get a class
24874         from its metadata token.
24875
24876         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
24877         New interncall for the debugger.
24878
24879 2002-09-24  Nick Drochak <ndrochak@gol.com>
24880
24881         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
24882         before using it in case it is null.
24883         
24884 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
24885
24886         * metadata.c: allow custom modifiers in local var signatures
24887         (bug spotted by Zoltan Varga).
24888
24889 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
24890
24891         * class.c: deal with the <Module> class that may have a NULL vtable.
24892         Eliminate warnings.
24893
24894 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
24895
24896         * image.c, image.h: more strong name helpers.
24897         * monosn.c: more work: convert pem keys to cryptoapi format.
24898
24899 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
24900
24901         * string-icalls.c: speedup IndexOf.
24902
24903 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
24904
24905         * icall.c: updates from Zoltan.2.Varga@nokia.com.
24906
24907 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
24908
24909         * icall.c: cleanup: use mono_object_domain ().
24910
24911 2002-09-23  Martin Baulig  <martin@gnome.org>
24912
24913         * debug-mono-symfile.c: Improved type support.
24914
24915 2002-09-22  Martin Baulig  <martin@gnome.org>
24916
24917         * debug-mono-symfile.c: Added support for reference types and strings.
24918
24919 2002-09-22  Martin Baulig  <martin@gnome.org>
24920
24921         * debug-mono-symfile.c: Started to work on the type table.
24922
24923 2002-09-21  Martin Baulig  <martin@gnome.org>
24924
24925         * debug-mono-symfile.c: Largely reworked the symbol table format.
24926         The symbol table is now incrementally updated each time a new
24927         method is added.  We're now also using our own magic and version
24928         so that you don't need to recompile all your classes if the
24929         dynamic table changes.
24930         (mono_debug_update_mono_symbol_file): Removed.
24931         (mono_debug_symfile_add_method): New function to add a method.
24932
24933 2002-09-21  Martin Baulig  <martin@gnome.org>
24934
24935         * icall.c
24936         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
24937         New interncall.
24938
24939         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
24940         New interncall to get a method from its metadata token.
24941
24942 2002-09-21  Martin Baulig  <martin@gnome.org>
24943
24944         * debug-mono-symfile.c: Create type table.
24945
24946 2002-09-20  Martin Baulig  <martin@gnome.org>
24947
24948         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
24949
24950 2002-09-20  Martin Baulig  <martin@gnome.org>
24951
24952         * debug-mono-symfile.c: Provide information about params and locals.
24953
24954 2002-09-20  Martin Baulig  <martin@gnome.org>
24955
24956         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
24957         New interncall.
24958
24959         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
24960         interncall to get a method from its metadata token.
24961
24962 2002-09-20  Martin Baulig  <martin@gnome.org>
24963
24964         * debug-mono-symfile.c: Added a few checks for method->header
24965         being non-NULL.  This should never happen, but for the moment
24966         let's use a g_warning() rather than a g_assert().
24967
24968 2002-09-19  Mark Crichton  <crichton@gimp.org>
24969
24970         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
24971         even if support for it isn't present.  Added an #ifdef to fix this.
24972
24973         * socket-io.c: Added checks back for Solaris support.
24974
24975 2002-09-19  Martin Baulig  <martin@gnome.org>
24976
24977         * debug-mono-symfile.c (read_string, write_string): Reflect latest
24978         changes in the symbol file format.
24979
24980 2002-09-18  Martin Baulig  <martin@gnome.org>
24981
24982         * debug-mono-symfile.c: Set version number to 21.
24983
24984 2002-09-18  Dick Porter  <dick@ximian.com>
24985
24986         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
24987         on netbsd.  Fixes bug 30051.
24988
24989 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24990
24991         * reflection.c:
24992         (set_version_from_string): little fix.
24993
24994 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
24995
24996         * monosn.c, Makefile.am: added strong name utility.
24997         * reflection.h, reflection.c: implemented delayed signing,
24998         locale, version and hash id assembly attributes.
24999
25000 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25001
25002         * loader.c, metadata.c: load param attributes in signatures.
25003
25004 2002-09-16  Martin Baulig  <martin@gnome.org>
25005
25006         * debug-mono-symfile.c: Added string table with all method names.
25007
25008 2002-09-14  Martin Baulig  <martin@gnome.org>
25009
25010         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
25011         fast method lookup.
25012
25013 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
25014
25015         * reflection.c: record the public key token of referenced assemblies.
25016
25017 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25018
25019         * image.c, image.h: added functions to get the strong name and the
25020         public key of an assembly.
25021         * pedump.c: use them.
25022
25023 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
25024
25025         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
25026
25027 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
25028
25029         * marshal.c (mono_marshal_get_managed_wrapper): Added
25030         MONO_TYPE_BOOLEAN 
25031
25032 2002-09-11  Martin Baulig  <martin@gnome.org>
25033
25034         * gc.c: Call GC_unregister_disappearing_link() on all links when
25035         finalizing them, this is necessary to aviod a crash in boehm's
25036         finalize handler.
25037
25038 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
25039
25040         * gc.c: handle GetTarget for finalized objects spotted and fixed by
25041         nick@chemlab.org.
25042
25043 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
25044
25045         * icall.c: implemented MonoType::Module.
25046         * reflection.c, reflection.h: mono_module_get_object () from
25047         Tomi Pakarinen <tomi.pakarinen@welho.com>.
25048
25049 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
25050
25051         * icall.c: ignore overridden methods in GetMethods ().
25052         Fix for FieldInfo::SetValue().
25053         * object.c: handle float/double in runtime invoke.
25054
25055 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
25056
25057         * object.c: allow a constructor to be called again on an object.
25058
25059 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
25060
25061         * class.h, class.c: move field layout code to it's own function and
25062         export it. Get an interface id earlier. Move fields in MonoClass
25063         so they are more cache friendly and align the bitfields.
25064         * loader.c: temporary handle get_param_names() for a runtime method.
25065         * reflection.c, reflection.h: more code to handle runtime creation of
25066         types.
25067
25068 2002-09-09  Martin Baulig  <martin@gnome.org>
25069
25070         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
25071         signature with the pinvoke field being set for the actual call.
25072
25073 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25074
25075         * icall.c: removed some unused icalls. Start of map of glib charsets
25076         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
25077
25078 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
25079
25080         * debug-helpers.c: break infinite loop (found and fixed by
25081         Holger Arnold <harnold@gmx.de>).
25082
25083 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
25084
25085         * icall.c: target may be null in create_delegate.
25086
25087 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
25088
25089         * marshal.c: handle a boolean return type.
25090
25091 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
25092
25093         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
25094
25095 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
25096
25097         * gc.c: fix weakreferences.
25098
25099 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25100
25101         * icall.c: added icall to get default codepage.
25102
25103 2002-09-03  Dick Porter  <dick@ximian.com>
25104
25105         * threads.h: 
25106         * threads.c: Use MonoThread instead of MonoObject where
25107         apropriate.
25108
25109         Store running thread objects in a hash table, so that we have all
25110         the info to hand when waiting for them to finish
25111         (means we don't need OpenThread() any more, so mingw builds should
25112         be fully functional again.)
25113
25114         * verify.c:
25115         * object.h: Added thread ID to MonoThread
25116
25117 2002-09-03  Martin Baulig  <martin@gnome.org>
25118
25119         * icall.c (System.Reflection.Assembly::get_location): New interncall.
25120
25121 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25122
25123         * icall.c: fixed leak in get_temp_path. Thanks lupus.
25124
25125 2002-09-03  Martin Baulig  <martin@gnome.org>
25126
25127         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
25128         argument to store the end address of the disassembled instruction.
25129
25130         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
25131         here from debug-symfile.h.
25132         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
25133         JIT into this struct.
25134         (MonoSymbolFile): Added `char *image_file' field.
25135         (MonoDebugGetMethodFunc): Removed.
25136         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
25137         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
25138         (mono_debug_find_method): New method.
25139
25140         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
25141         create a full symbol file.
25142         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
25143         and static symbol files.
25144         (mono_debug_find_method): The symbol file keeps an internal method hash,
25145         call this to get a MonoDebugMethodInfo from a MonoMethod.
25146
25147         * debug-symfile.[ch]: Removed.
25148
25149 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
25150
25151         * image.c (do_mono_image_open): Remove linker version check.
25152
25153 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
25154
25155         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
25156         wrappers for instance methods.
25157         
25158 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25159
25160         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
25161
25162 2002-08-28  Dick Porter  <dick@ximian.com>
25163
25164         * Makefile.am: Export HOST_CC for w32 builds
25165
25166 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
25167
25168         * file-io.c process.c: MonoString are null terminated, no
25169         need for mono_string_to_utf16() anymore.
25170
25171 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
25172
25173         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
25174
25175 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
25176
25177         * icall.c, reflection.h: speedup System.MonoType.
25178
25179 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
25180
25181         * reflection.c: allow null as the value of a string argument in
25182         custom attributes constructors.
25183
25184 2002-08-27  Martin Baulig  <martin@gnome.org>
25185
25186         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
25187         `trampoline_address' field.
25188
25189 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
25190
25191         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
25192         check (fixes bug #29486) 
25193
25194 2002-08-27  Martin Baulig  <martin@gnome.org>
25195
25196         * debug-mono-symfile.c: Changed the file format in a way that allows us
25197         open it read-only and to use a specially malloced area for all the
25198         dynamic data.  We can now also generate a symbol file on-the-fly if we're
25199         debugging IL code and there is no MCS generated symbol file for it.
25200
25201 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
25202
25203         * object.c: added a define for a good string and array
25204         creation speedup (not enabled by default because we need to deal with
25205         the synch stuff).
25206
25207 2002-08-26  Martin Baulig  <martin@gnome.org>
25208
25209         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
25210         function to create a dynamic symbol file.  This is used by the
25211         debugger to create a symbol file for IL code on-the-fly.
25212
25213 2002-08-26  Martin Baulig  <martin@gnome.org>
25214
25215         * loader.c (mono_lookup_pinvoke_call): Include the error message
25216         from g_module_error() in the error message.
25217
25218 2002-08-24  Martin Baulig  <martin@gnome.org>
25219
25220         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
25221         function to update the symbol file.  The symbol file is mmap()ed
25222         writable, but private.  This allows us to install the symbol file
25223         together with the assembly.
25224
25225 2002-08-24  Martin Baulig  <martin@gnome.org>
25226
25227         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
25228         but they can read the new symbol file format which mcs is now creating.
25229
25230         * debug-symfile.c (mono_debug_find_source_location): Moved to
25231         debug-mono-symfile.c; this is now operating on the new symbol file.
25232
25233 2002-08-23  Martin Baulig  <martin@gnome.org>
25234
25235         * debug-helpers.c (mono_method_desc_from_method): New function to get
25236         a MonoMethodDesc from a MonoMethod.
25237
25238 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
25239
25240         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
25241         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
25242
25243 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
25244
25245         * string-icalls.[ch]: make helper methods static.
25246
25247 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25248
25249         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
25250         types to it and to SetValueInternal.
25251
25252         * object.c: Moved handle_enum label to its proper place. This was the
25253         f... bug! ;-)
25254
25255         This time i compiled mcs and gtk-sharp and they both work.
25256
25257 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25258
25259         * icall.c: reverted partially my previous patch until 
25260         object.c:set_value handles enums correcly.
25261
25262 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25263
25264         * icall.c:
25265         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
25266         (ves_icall_System_Environment_get_MachineName): removed warning when
25267         compiling under cygwin.
25268
25269 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
25270
25271         * object.c: fixed field_get_value() for reference types.
25272
25273 2002-08-22  Dick Porter  <dick@ximian.com>
25274
25275         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
25276         Don't free a buffer while it's still needed.  Patch from Jonathan
25277         Liger <Jonathan.liger@wanadoo.fr>
25278
25279 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
25280
25281         * icall.c (ves_icall_System_Environment_get_Platform): Add new
25282         internal call.
25283
25284 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
25285
25286         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
25287         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
25288
25289         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
25290         we call unmanaged code which throws exceptions.
25291
25292 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
25293
25294         * appdomain.h: added per-domain entry_assembly.
25295         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
25296         arguments.
25297         * icall.c: Assembly::GetEntryAssembly icall.
25298         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
25299         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
25300
25301 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
25302
25303         * appdomain.h, gc.c: added mono_domain_finalize ().
25304
25305 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25306
25307         * object.c:
25308         (mono_print_unhandled_exception): changed g_warning by g_printerr
25309         because g_log has a 1024 characters limit (yeah, i got a big stack
25310         trace). Don't print exception name, that should be in ToString 
25311         returned string.
25312
25313 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25314
25315         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
25316         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
25317
25318 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25319
25320         * object.c:
25321         (mono_print_unhandled_exception): after previous commit, i realized
25322         that MS calls ToString on the exception. I changed this function to
25323         do that. This way we get stack_trace for free.
25324
25325 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25326
25327         * object.c:
25328         (mono_print_unhandled_exception): invoke Message property instead of
25329         getting 'message' field from Exception. Don't allocate memory for
25330         'trace' and 'message' if not needed.
25331
25332 2002-08-18  Dick Porter  <dick@ximian.com>
25333
25334         * unicode.c: Fix asserts to match Encoder.cs checks
25335
25336 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25337
25338         * marshal.c: fix unaligned store issue and a few wrong
25339         opcode argument types.
25340
25341 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25342
25343         * icall.c: added GetUninitializedObjectInternal internal call.
25344
25345 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
25346
25347         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
25348         to the right domain.
25349
25350 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
25351
25352         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
25353
25354         * class.c (class_compute_field_layout): set blittable to false for Strings
25355
25356         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
25357
25358 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
25359
25360         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
25361         first chunk of code to create types at runtime. Code to
25362         handle ReflectedType/DeclaringType. Make reflection handles
25363         domain specific.
25364
25365 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
25366
25367         * class.c: set correct name in arrays.
25368
25369 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
25370
25371         * appdomain.c (mono_domain_transfer_object): make it work with
25372         valuetypes. bug fixes.
25373
25374 2002-08-12  Dick Porter  <dick@ximian.com>
25375
25376         * object.h: Rename some parameters to avoid c++ keywords (Patch
25377         from Joseph Wenninger <kde@jowenn.at>)
25378
25379 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
25380
25381         * icall.c: added icall to implement Assembly.GetFile*.
25382
25383 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
25384
25385         * reflection.h, reflection.c: code to embed managed resources.
25386
25387 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
25388
25389         * class.c: move all the type size stuff into
25390         class_compute_field_layout().
25391
25392 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
25393
25394         * class.c: ensure enums have always the correct instance size.
25395         * unicode.c: remove wrong assert.
25396
25397 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
25398
25399         * assembly.c: fix mem corruption issue.
25400         * image.h, image.c: added mono_image_get_resource () to access
25401         managed resources.
25402         * icall.c: implemented Assembly.EntryPoint property and some
25403         Managed Resources related internalcalls.
25404
25405
25406 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25407
25408         * image.c, image.h: impemented mono_image_get_entry_point ().
25409         * appdomain.c: use mono_image_get_entry_point.
25410
25411 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
25412
25413         * reflection.c: support the object type argument when loading
25414         custom attributes.
25415
25416 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
25417
25418         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
25419         String as return type.
25420
25421 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
25422
25423         * reflection.c: fix encoding of named args for custom attrs to match
25424         the ms implementation. Read them back when instantiating custom
25425         attributes.
25426
25427 2002-08-02  Radek Doulik  <rodo@ximian.com>
25428
25429         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
25430         by Dietmar as quick fix
25431         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
25432         16 as stack size, used on more places as quick fix before Dietmar
25433         will fix it properly
25434
25435 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
25436
25437         * object.h, object.c: added accessors for fields and properties.
25438
25439 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
25440
25441         * class.c, class.h: made mono_class_get_field_from_name ()
25442         loop on parent types.
25443         Added mono_class_get_property_from_name ().
25444
25445 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
25446
25447         * class.c, class.h: move the code to setup the type vtable in its own
25448         function so that it can be reused also for types created at runtime.
25449         Eliminate the "class" identifier from the header file.
25450         * reflection.c: setup the vtable for enums so that we can create
25451         objects for use in SetConstant ().
25452
25453 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
25454
25455         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
25456         instead of the delegate itself as this pointer (bug #28383)
25457
25458 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
25459
25460         * marshal.c (mono_marshal_get_managed_wrapper): added return type
25461         conversions.
25462
25463 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
25464
25465         * loader.c: don't set the pinvoke bit on icalls.
25466
25467 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
25468
25469         * debug-helpers.c (mono_method_full_name): only print a number to
25470         indicate wrapper type (so that the output is more readable in traces).
25471
25472 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
25473
25474         * class.c (mono_class_init): include method override patch from Paolo
25475
25476 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
25477
25478         * icall.c: fixed GetTypeCode().
25479
25480 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
25481
25482         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
25483         use real delegate invoke function to make it work with multicast
25484         delegates (fix bug# 28291).
25485
25486 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
25487
25488         * object.c: load constant strings.
25489
25490 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
25491
25492         * reflection.c: no magic numbers.
25493         * tabledefs.h: security action enum.
25494
25495 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
25496
25497         * assembly.c: fix possible memory corruption.
25498
25499 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
25500
25501         * reflection.h, reflection.c: added support for linking resources.
25502         * verify.c: check we have an updated corlib.
25503
25504 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
25505
25506         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
25507         string arrays.
25508         (mono_marshal_string_array): null terminate unmanaged string arrays.
25509         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
25510
25511 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
25512
25513         * icall.c: Type.GetType () can now return also types from the
25514         calling assembly.
25515
25516 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
25517
25518         * loader.h, loader.c: stack walking support.
25519         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
25520         GetCallingAssembly.
25521
25522 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
25523
25524         * marshal.c: added optimisations for blittable types 
25525
25526         * class.c (mono_array_class_get): do not set blittable attribute on arrays
25527         (mono_class_setup_mono_type): set blittable attribute for single
25528         and double.
25529
25530         * marshal.c (mono_string_utf8_to_builder): impl.
25531         (mono_string_builder_to_utf8): impl.
25532         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
25533
25534 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
25535
25536         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
25537         (mono_marshal_get_managed_wrapper): impl. byref types
25538
25539 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25540
25541         * icall.c:
25542         (search_method): don't display debug message. 
25543
25544 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
25545
25546         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
25547
25548 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
25549
25550         * appdomain.c: set the missing filename when throwing exception.
25551
25552 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
25553
25554         * metadata.c (mono_type_size): code cleanup
25555         (mono_type_stack_size): removed some test code
25556
25557 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
25558
25559         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
25560         mono_get_exception_file_not_found now.
25561
25562         * exception.c (mono_exception_from_name_two_strings): New version
25563         that will call a constructor with two string arguments. 
25564         (mono_get_exception_file_not_found): New helper routine, used to
25565         report file-not-found errors.
25566
25567 2002-07-20  Dick Porter  <dick@ximian.com>
25568
25569         * process.h:
25570         * process.c: Pass file handles to CreateProcess
25571         
25572         * icall.c:
25573         * file-io.h:
25574         * file-io.c: Implemented CreatePipe
25575
25576 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
25577
25578         * metadata.c (mono_get_param_info): set alignment for value types
25579
25580 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
25581
25582         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
25583         Constify mono_domain_assembly_open().
25584         * loader.c: handle null namespace in icalls.
25585
25586 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
25587
25588         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
25589         (emit_str_to_ptr_conv): marshal object as structs
25590
25591         * metadata.c (mono_type_to_unmanaged): marshal object as structs
25592
25593         * marshal.c (mono_marshal_get_runtime_invoke): support value types
25594
25595 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
25596
25597         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
25598         (mono_marshal_get_native_wrapper): we an now return value types
25599
25600 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
25601
25602         * verify.c: more checks implemented.
25603
25604 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
25605
25606         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
25607         (fix bug #27695)
25608         (mono_marshal_get_native_wrapper): allow byref arguments
25609         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
25610         impl. PtrToStringXXX methods
25611         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
25612         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
25613         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
25614         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
25615         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
25616
25617 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25618
25619         * reflection.c: fix buglet in parsing an assembly name.
25620
25621 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
25622
25623         * marshal.c (emit_ptr_to_str_conv): first impl.
25624
25625 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
25626
25627         * object.c, class.h: cache the vtable in the class as suggested by
25628         vargaz@freemail.hu (Zoltan Varga).
25629
25630 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25631
25632         * class.h, loader.c: added mono_field_from_token().
25633         * verify.c: first cut of type checking code.
25634
25635 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
25636
25637         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
25638
25639 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
25640
25641         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
25642         (fix bug #27782)
25643         (mono_marshal_get_remoting_invoke): impl.
25644         (mono_delegate_begin_invoke): impl.
25645         (mono_mb_emit_save_args): impl.
25646         (mono_delegate_end_invoke): impl.
25647         (mono_marshal_get_delegate_begin_invoke):
25648         (mono_marshal_get_delegate_end_invoke):
25649         (mono_marshal_get_delegate_invoke): generate a special name for
25650         those methods (including the signature) and associate them whith
25651         the delegate class. 
25652
25653 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
25654
25655         * reflection.[ch]: 
25656         (mono_reflection_type_from_name): now it has a MonoImage parameter
25657         which is used as the default image to search the type in. If the image
25658         is NULL or getting the type from it fails, it defaults to corlib.
25659
25660         * icall.c: changed 1 call to mono_reflection_type_from_name to match
25661         new parameter.
25662
25663 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25664
25665         * reflection.c: update the parameter table index.
25666
25667 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
25668
25669         * domain.c: don't include the mark byte in the string hash.
25670
25671 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
25672
25673         * icall.cs: icall for Type.GetTypeCode ().
25674         * verify: a couple of fixes and disabled local initialization checks.
25675
25676 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
25677
25678         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
25679
25680         * debug-helpers.c (mono_method_full_name): print the type of the
25681         runtime wrapper
25682
25683         * metadata.c (mono_signature_hash): a hash function for signatures
25684         (mono_signature_hash): better hash algorithm
25685
25686         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
25687
25688         * debug-helpers.c (mono_method_full_name): this can now generate
25689         method names with signatures
25690
25691         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
25692         method dont have this pointers.
25693
25694 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
25695
25696         * reflection.c: fixup typebuilder tokens.
25697         * image.c: fix buglet.
25698         * marshal.h: remove whitespace.
25699         * metadata.h, metadata.c: reinstate code that was removed.
25700         * verify.c: handle catch directives and fix another couple of bugs.
25701
25702 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
25703
25704         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
25705         (mono_marshal_get_native_wrapper): make it comp. with the old code
25706         (mono_marshal_get_native_wrapper): support boolean
25707         (mono_marshal_get_managed_wrapper): support more types
25708
25709 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
25710
25711         * class.c (class_compute_field_layout): compute class->blittable attribute.
25712
25713 2002-07-09  Dick Porter  <dick@ximian.com>
25714
25715         * threads.c: Make the thread cleaning up cope with threads that
25716         call ExitThread()
25717
25718 2002-07-08  Radek Doulik  <rodo@ximian.com>
25719
25720         * reflection.c (method_encode_code): use non-translated values to
25721         compute finally_start, this fixes exception handling on ppc, yay!
25722
25723         * decimal.h (struct signscale): fix endianess
25724
25725 2002-07-07  Radek Doulik  <rodo@ximian.com>
25726
25727         * reflection.c: swap box_val and not val
25728
25729 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
25730
25731         * reflection.c, reflection.h: handle full assembly info in type name.
25732         Handle Type arguments when loading custom attributes.
25733         * icall.c: updated to use new mono_reflection_type_from_name () method.
25734
25735 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25736
25737         * loader.c:
25738         (method_from_memberref): also print assembly name when method not found.
25739
25740 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25741
25742         * icall.c:
25743         (ves_icall_TypeGetProperties): fixed bug #27473. 
25744
25745 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25746
25747         * reflection.c: display image name and token when cannot find the
25748         .ctor for an attribute.
25749
25750 2002-07-05  Martin Baulig  <martin@gnome.org>
25751
25752         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
25753
25754 2002-07-04  Dick Porter  <dick@ximian.com>
25755
25756         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
25757         compile on mingw.  This will cause mingw builds to not wait for
25758         subthreads to terminate after the main thread does.  I've lodged a
25759         bug with the mingw developers for them to wrap OpenThread().
25760
25761 2002-07-03  Dick Porter  <dick@ximian.com>
25762
25763         * threads.c: Store thread IDs instead of handles, because
25764         GetCurrentThread() returns a pseudohandle and therefore stores
25765         useless values.  mono_thread_cleanup() continues checking the
25766         array of threads until it is empty, to cope with subthreads
25767         spawning new threads after the main thread has finished.
25768
25769         * profiler.h:
25770         * profiler.c:
25771         * profiler-private.h: Pass the thread ID to thread profiler
25772         functions, instead of a handle
25773
25774 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
25775
25776         * verify.c: fixes to make it more usable.
25777         * pedump.c: added --verify code to verify IL code in an assembly.
25778
25779 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
25780
25781         * reflection.c: turn errors into warnings to allow compiling corlib.
25782
25783 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
25784
25785         * reflection.c: add special cases to compile corlib.
25786
25787 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25788
25789         * reflection.c: handle properties with only a set method.
25790
25791 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
25792
25793         * opcodes.h: add enum with opcodes in opval order.
25794
25795 2002-07-01  Dick Porter  <dick@ximian.com>
25796         
25797         * object.h:
25798         * object.c (mono_runtime_run_main): Removed unneeded argument
25799
25800 2002-06-28  Martin Baulig  <martin@gnome.org>
25801
25802         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
25803
25804 2002-06-27  Dick Porter  <dick@ximian.com>
25805
25806         * threads.c: Store the handle in both the parent thread and in the
25807         subthread, to minimise the time between starting a new thread and
25808         storing its ID.
25809
25810 2002-06-26  Dick Porter  <dick@ximian.com>
25811
25812         * appdomain.c (mono_runtime_cleanup): Close the socket library
25813         after all the threads have finished, not before
25814
25815 2002-06-26  Martin Baulig  <martin@gnome.org>
25816
25817         * debug-symfile.c (mono_debug_find_source_location): Added
25818         `guint32 *line_number' argument.  If it's not NULL, store the line number
25819         there and return the file name without the line number.
25820
25821 2002-06-25  Dick Porter  <dick@ximian.com>
25822
25823         * icall.c:
25824         * process.h:
25825         * process.c: Process forking and other support functions
25826
25827 2002-06-25  Dick Porter  <dick@ximian.com>
25828
25829         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
25830         things dont happen when the image is closed.
25831         (mono_image_lookup_resource): Walk the resource section looking
25832         for a particular entry
25833
25834         * cil-coff.h: PE resource section decoding
25835
25836 2002-06-25  Dick Porter  <dick@ximian.com>
25837         
25838         * assembly.h:
25839         * assembly.c: 
25840         (mono_assembly_foreach): Accessor functions to walk the list of
25841         loaded assemblies
25842         (mono_assembly_set_main):
25843         (mono_assembly_get_main): Process methods need to know which
25844         assembly is the "main" one
25845
25846         * object.c (mono_runtime_run_main): Record the main assembly
25847
25848         * debug-helpers.c: Fix typo
25849
25850 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
25851
25852         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
25853         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
25854
25855 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
25856
25857         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
25858
25859 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
25860
25861         * image.c (do_mono_image_open): Initialize reference count,
25862         otherwise we leak the MonoImage.
25863
25864 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25865
25866         * reflection.c: small tweak to handle self-hosting.
25867
25868 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
25869
25870         * reflection.c: fix type name parse code.
25871
25872 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
25873
25874         * reflection.c: break out of the loop.
25875         * image.c: special case corlib.
25876
25877 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
25878
25879         * reflection.c: add all the custom attrs at the end to ensure the
25880         ctors have been properly initialized when the attributes are defined
25881         in the current assembly.
25882
25883 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25884
25885         * reflection.c: handle correctly multiple-nested types.
25886
25887 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
25888
25889         * row-indexes.h: fix typos.
25890         * reflection.c: adjust for typos and fix method_def_or_ref
25891         encoding in MethodImpl table.
25892
25893 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
25894
25895         * reflection.c: fix entry point patching (thanks Serge!).
25896
25897 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
25898
25899         * verify.c: add check for System.Exception
25900
25901 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
25902
25903         * image.c, class.c: minifix for code just c&p'ed.
25904         * reflection.c: warning fix.
25905         * object.h, loader.h, domain.c: load also StringBuilder.
25906
25907 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25908
25909         * marshal.h, marshal.c: some support code to handle complex marshaling.
25910
25911 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
25912
25913         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
25914         Better signatures with vtable error dump.
25915
25916 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
25917
25918         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
25919
25920 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
25921
25922         * icall.c (ves_icall_Type_GetField): impl.
25923
25924 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
25925
25926         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
25927         to retrieve a marshal description blob for a field or param.
25928
25929 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25930
25931         * reflection.h, reflection.c: change order of nested type emission
25932         to avoid table corruption. The NestedTypes table is sorted.
25933         * icall.c: change order of GetConstructor results to workaround mcs bug.
25934
25935 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
25936
25937         * reflection.h, reflection.c: handle field and param marshal
25938         information.
25939
25940 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25941
25942         * icall.c, marshal.c marshal.h: more Marshal class implementation.
25943
25944 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25945
25946         * reflection.c: fix call convention.
25947
25948 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25949
25950         * reflection.h, reflection.c: mono_image_get_memberref_token()
25951         takes a type instead of a class, now. Added
25952         mono_image_get_array_token() to create tokens for the special
25953         multi-dim array methods.
25954
25955 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
25956
25957         * assembly.c: handle modules (no assembly table). Split
25958         loading references in its own function.
25959         * class.c: handle moduleref resolution scope.
25960         * image.c, image.h: cache module name in image.
25961
25962 2002-06-07  Martin Baulig  <martin@gnome.org>
25963
25964         * reflection.c (mono_image_get_type_info): Only add a class layout entry
25965         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
25966
25967 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
25968
25969         * icall.c: more signature fixes that used uint instead of int.
25970
25971 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
25972
25973         * reflection.c: fixed signature of field refs.
25974
25975 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
25976
25977         * class.c, reflection.c: handle typerefs of nested types
25978         (both on read and when writing files).
25979
25980 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25981
25982         * icall.c: fix method signatures that tried to workaround the previous
25983         typo, d'oh!
25984
25985 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
25986
25987         * debug-helpers.c: fix typo.
25988
25989 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
25990
25991         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
25992         rewrote the PE/COFF writing code (our programs are understood by the
25993         ms runtime, now).
25994
25995 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25996
25997         * gc.c, gc.h, icall.c: weakreference support.
25998
25999 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26000
26001         * Makefile.am, mono-config.c: use $(sysconfdir).
26002
26003 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26004
26005         * icall.c: changed default precision of Double.ToString() to 15.
26006         Fixed memory leak. Unified with Single.ToString.
26007
26008 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
26009
26010         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
26011
26012 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
26013
26014         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
26015         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
26016         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
26017         and myself.
26018
26019 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26020
26021         * debug-symfile.c, sysmath.c: yet more compilation fixes.
26022
26023 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26024
26025         * reflection.c, socket-io.c: more compilation fixes.
26026
26027 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26028
26029         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
26030         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
26031         unicode.c: warning and compiler compatibility fixes.
26032
26033 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26034
26035         * class.h, metadata.c: fixed warnings/compilation errors.
26036
26037 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
26038
26039         * Makefile.am, mono-config.c, mono-config.h: configuration file
26040         support routines.
26041         * loader.c, loader.h: make Dll mapping configurable at runtime in the
26042         config file. Export methods to insert and lookup mappings.
26043
26044 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
26045
26046         * reflection.c: handle types and boxed objects in custom attr
26047         constructors.
26048
26049 2002-05-30  Martin Baulig  <martin@gnome.org>
26050
26051         * debug-symfile.c
26052         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
26053
26054 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
26055
26056         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
26057         to lookup the implmap row for a P/Invoke method.
26058         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
26059         P/Invoke method from the runtime on an as needed basis.
26060
26061 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
26062
26063         * metadata.c (mono_metadata_parse_signature): impl.
26064
26065 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26066
26067         * class.c: handle .pack directive.
26068
26069 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26070
26071         * object.c: initialize static fields with RVA data.
26072
26073 2002-05-25  Martin Baulig  <martin@gnome.org>
26074
26075         * debug-symfile.c
26076         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
26077
26078 2002-05-24  Martin Baulig  <martin@gnome.org>
26079
26080         * debug-symfile.c
26081         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
26082         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
26083         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
26084
26085 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26086
26087         * object.c: special case string ctros in invoke.
26088         * gc.c: silly whitespace changes.
26089
26090 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
26091
26092         * threadpool.[ch]: impl. a threadpool that can
26093         be used by mint and mono.
26094
26095 2002-05-22  Martin Baulig  <martin@gnome.org>
26096
26097         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
26098         The first argument is now a `MonoReflectionModuleBuilder *', the return
26099         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
26100         `methods' field to get the method builder.  The `token' argument is the
26101         unfixed token.
26102
26103         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
26104         invalid characters instead of g_assert_not_reached()ing.  This seems
26105         to be the behaviour of mscorlib.
26106
26107 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
26108
26109         * object.c (mono_runtime_invoke_array): applied patch from Rachel
26110         Hestilow to fix bug #25104
26111
26112 2002-05-21  Martin Baulig  <martin@gnome.org>
26113
26114         * debug-symfile.c (mono_debug_find_source_location): New function.
26115         Looks up an IL offset in the line number table and returns the source
26116         location as a string.
26117
26118 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26119
26120         * icall.c:
26121         (mono_double_ToStringImpl): changed %f by %g until we have something
26122         better.
26123
26124 2002-05-21  Nick Drochak  <ndrochak@gol.com>
26125
26126         * icall.c : Use different name for Math.Pow's icall.  Needed to check
26127         parameters first in C#.
26128
26129 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26130
26131         * icall.c, reflection.h: added icall to get info about an event.
26132
26133 2002-05-20  Radek Doulik  <rodo@ximian.com>
26134
26135         * object.c (mono_value_box): don't use memcpy for boxing on BIG
26136         endian
26137         (mono_value_box): don't use memcpy for small sizes on
26138         architectures with unaligned access
26139
26140 2002-05-20  Martin Baulig  <martin@gnome.org>
26141
26142         * reflection.c (mono_reflection_setup_internal_class): Don't crash
26143         if `tb->parent == NULL'.
26144         (mono_reflection_create_internal_class): New function.  This is
26145         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
26146         for enum types.
26147
26148         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
26149         New interncall.
26150
26151 2002-05-19  Martin Baulig  <martin@gnome.org>
26152
26153         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
26154         argument to get the length, don't default to the array length.
26155
26156 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
26157
26158         * assembly.c (mono_assembly_setrootdir): New function used to
26159         override the MONO_ASSEMBLIES directory.
26160
26161 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26162
26163         * icall.c: ValueType_GetHashCode() initialize local var.
26164
26165 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26166
26167         * reflection.c: sort custom attributes table.
26168
26169 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
26170
26171         * reflection.c: support named args in custom attributes (write support).
26172
26173 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26174
26175         * reflection.c: fix finally position calculation.
26176
26177 2002-05-15  Radek Doulik  <rodo@ximian.com>
26178
26179         * reflection.c: fixed endianess at many places
26180
26181         * icall.c (ves_icall_InitializeArray): comment out debug msg
26182
26183 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
26184
26185         * object.c (mono_unhandled_exception): new function to handle
26186         unhandled exceptions.
26187         (mono_unhandled_exception): call the UnhandledException event.
26188         (mono_runtime_delegate_invoke): impl.
26189
26190 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
26191
26192         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
26193         returns the RVA, not the direct pointer to the data. Handle the case
26194         when the class size is fixed.
26195
26196 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
26197
26198         * reflection.c: fix some endianess issues.
26199
26200 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
26201
26202         * object.c (mono_runtime_invoke): is now able to catch exceptions.
26203
26204         * threads.c (mono_thread_init): added a callback which is invoked
26205         at thread start.
26206
26207 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
26208         
26209         * icall.c: make GetHashCode return non-negative values.
26210
26211 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
26212
26213         * object.c, icall.c, gc.c: revert to address-based hashcode.
26214
26215 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
26216
26217         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
26218
26219 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
26220
26221         * icall.c, class.c: special case <Module>.
26222
26223 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
26224
26225         * icall.c: fix bug in GetNow().
26226
26227 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
26228
26229         * object.c (mono_runtime_class_init): make sure that we call all
26230         static class constructors.
26231
26232 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
26233
26234         * reflection.c: sort methodsemantics table.
26235
26236 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26237
26238         * reflection.h, reflection.c: honour init locals setting.
26239
26240 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
26241
26242         * icall.c: copied Double ToStringImpl for Single ToStringImpl
26243
26244 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
26245
26246         * reflection.c: support ContructorBuilders in attribute blob creation.
26247
26248 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26249
26250         * reflection.c: some changes to build a binary that can be run
26251         directly in windows.
26252
26253 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
26254
26255         * loader.c: print a big message when an icall can't be found.
26256
26257 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26258
26259         * string-icalls.c: fix bug 24248.
26260
26261 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
26262
26263         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
26264         icall.c, reflection.h: separate assembly loading by pathname and by
26265         assembly name. Use the MONO_PATH env var to search for assemblies.
26266
26267 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
26268
26269         * assembly.c, image.h: add some support for assemblies
26270         with multiple modules.
26271         * class.c, class.h: export mono_class_from_typeref().
26272         * loader.c: remove duplicated code and use mono_class_from_typeref(),
26273         instead.
26274
26275 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
26276
26277         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
26278         documentation says (the ECMA one is correct).
26279
26280 2002-05-02  Dick Porter  <dick@ximian.com>
26281
26282         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
26283         Don't name the synchronisation mutex.
26284
26285 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
26286
26287         * rand.c
26288         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
26289         Make the prototypes match.
26290         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
26291         Same.
26292
26293         * icall.c
26294         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
26295         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
26296         all systems have tm.tm_zone, so use strftime() with %Z to print
26297         the timezone abreviation into a temp string.
26298
26299         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
26300         rather than mono_array_addr() on a MonoString on Big Endian
26301         machines.
26302
26303 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
26304
26305         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
26306         fix bug 24041
26307
26308 2002-04-30  Dick Porter  <dick@ximian.com>
26309
26310         * socket-io.c: Cope with SOCKET being an integer rather than a
26311         pointer now.
26312
26313         * threads.c: Added Thread_free_internal, to deal with thread
26314         handle cleanup.  Moved calls to handle_store() and handle_remove()
26315         to start_wrapper(), so each can only be called once.  Allocate
26316         synchronisation blocks with GC_malloc(), and use GC finalisation
26317         to close the handles.
26318
26319         * icall.c: added System.Threading.Thread::Thread_free_internal
26320
26321 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26322
26323         * icall.c: support Environment.Exit, CommandLineArgs().
26324
26325 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26326
26327         * object.c, object.h: added mono_runtime_run_main () and
26328         mono_runtime_get_main_args () for use in System.Environment.
26329
26330 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
26331
26332         * gc.c: fix thinko, enable actual finalization since the jit is now
26333         fixed.
26334
26335 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26336
26337         * gc.c, object.c: take into account that an object may be offset wrt the address
26338         returned by GC_malloc().
26339
26340 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
26341
26342         * image.c: handle files without entries in the assembly table (modules).
26343
26344 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
26345
26346         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
26347         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
26348         allowed to be null when it's System.Object class setup.
26349
26350 2002-04-27  Martin Baulig  <martin@gnome.org>
26351
26352         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
26353         if `tb->parent == NULL' rather than crashing.
26354
26355 2002-04-28  Nick Drochak  <ndrochak@gol.com>
26356
26357         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
26358         calling acos() where asin() should have been called.
26359
26360 2002-04-26  Martin Baulig  <martin@gnome.org>
26361
26362         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
26363         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
26364         there's a subdirectory called `System', but we don't want to read that
26365         subdirectory as an assembly.
26366
26367 2002-04-25  Martin Baulig  <martin@gnome.org>
26368
26369         * debug-symfile.c: Reflect latest MonoString changes.
26370
26371 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
26372
26373         * rand.c, rand.h: instance method icalls need to have an explicit
26374         this pointer as first argument in the C implementation.
26375
26376 2002-04-25  Nick Drochak <ndrochak@gol.com>
26377
26378         * icall.c: Fix typo in map for GetNonZeroBytes
26379
26380 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
26381
26382         * string-icalls.c : String does now passes unit tests without any 
26383         errors, the following changes has been made:
26384         
26385         Implemented replace methods.
26386         Renaming of methods to (try) follow the standard.
26387         Fixed compare ordinal
26388         Made all memory allocated directly to function instead of via icall function.
26389         Small performance fix in is_in_array function
26390                         
26391  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
26392
26393         c (mono_string_Internal_ctor_charp_int_int):
26394         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
26395         sindex < 0, throw ArgumentOutOfRangeException instead of
26396         ArgumentNullException.
26397
26398         Added new check for length == 0, however
26399         I need to make it return String.Empty from the C code.
26400         
26401         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
26402         that calculate the length for us here.
26403         
26404         (mono_string_Internal_ctor_sbytep_int_int): Replaced
26405         mono_string_new_utf16 with mono_string_new, since value is utf8.
26406
26407 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26408
26409         * object.c: register the object for finalization if needed.
26410         Allocate one more char in the string for the terminating 0 char.
26411
26412 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26413
26414         * class.c, class.h, image.c: check if a type implemenst a destructor.
26415         Use the proper key for array class lookups.
26416         * icall.c: register the icalls in the System.GC class.
26417         * gc.c, gc.h: GC-related functions and icalls.
26418
26419 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26420
26421         * icall.c:
26422         * socket-io.c:
26423         * unicode.c: free some strings gotten from mono_string_to_utf8 and
26424         changed a couple of free () by g_free ().
26425
26426         * decimal.c: one-liner in the comments for decimal2string ().
26427
26428 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
26429
26430         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
26431
26432 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
26433
26434         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
26435         * object.c (mono_runtime_invoke_array) : handle null in params
26436
26437 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
26438
26439         * string-icalls.c: fixed bug in split (one off bug)
26440
26441 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
26442
26443         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
26444         * icalls.c: added String::Equals as internal method
26445
26446 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
26447
26448         * threads.c: fixed bug in the double interlocked functions
26449
26450 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
26451
26452         * threads.c: implemented all of the new interlocked icalls.
26453         * string-icalls.c: fix a bug in insert.
26454         * icalls.c: added the icalls for interlocked, removed old string functions.
26455         
26456 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
26457
26458         * loader.c: fix off-by-one error when reading argument names.
26459
26460 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26461
26462         * profiler.c: win32 counter implementation (untested).
26463         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
26464         (the latter needs testing and more complete impl. from win32 folks).
26465
26466 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
26467
26468         * object.c: mono_array_new_full workaround mono_array_class_get
26469         problem.
26470
26471 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
26472
26473         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
26474         * object.h (mono_string_chars): Changed casting type.
26475
26476 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
26477
26478         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
26479                            method signatures to use gunichar2 instead of gint16.
26480
26481 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
26482
26483         * object.h, object.c: domain-specific versions of mono_object_new and
26484         mono_array_new.
26485
26486 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
26487
26488         * object.c: changed String layout
26489
26490         * string-icalls.c (mono_string_Internal_ctor_chara): added
26491         internal string constructors.
26492
26493 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
26494
26495         * threads.c: pass 'this' to the thread start routine.
26496
26497 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26498
26499         * string-icalls.c: fix IndexOf and LastIndexOf. Now
26500         InternalCompareStr don't call twice mono_string_cmp_char for the last
26501         character. Improved performance in mono_string_cmp_char.
26502
26503 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
26504
26505         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
26506         code into its own library: libmonoruntime.
26507
26508 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
26509
26510         * object.h, object.c: changed array format so that szarrays do not
26511         require a bounds structure.
26512         * icall.c, appdomain.c: support for new szarray format.
26513
26514 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
26515
26516         * metadata.c: compare also the retuns type when comparing signatures:
26517         we didn't do this as an optimization since really overloaded methods
26518         must differ also in the arguments, but this doesn't work with
26519         low-level IL code (or when using explicit conversion operators: see
26520         bug#23498 for an example).
26521
26522 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
26523
26524         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
26525
26526 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
26527
26528         * icall.c: make MonoType::GetElementType its own icall.
26529
26530 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
26531
26532         * icall.c: remove MonoMethod_get_Name().
26533         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
26534         object.
26535
26536 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
26537
26538         * string-icalls.c: optimized a few methods.
26539
26540 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
26541
26542         * icall.c: added all new string internal calls
26543         * string-icalls.c: added, new string internal call implementation.
26544         * object.c: added mono_string_new_size for allocating a string a size
26545
26546 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
26547
26548         * object.c (mono_object_isinst): use the same code as in the
26549         optimized x86 version.
26550
26551 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26552
26553         * profiler.c: TSC-based timer code (faster and more accurate).
26554         Not hooked up in configure, yet (set USE_X86TSC to 1).
26555
26556 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
26557
26558         * profiler.c, profiler.h: track time spent compiling methods.
26559         * threads.c: track thread creation/destruction.
26560
26561 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
26562
26563         * profiler.c, profiler.h, profiler-private.h: profiling interface
26564         and sample implementation. Moved here so that it can be used also by
26565         the jit.
26566
26567 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26568
26569         * reflection.c, reflection.h: keep types and other handles separate in
26570         the hash tables for referred tokens. Add guid for modules.
26571
26572 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
26573
26574         * assembly.c: fix bugs found with valgrind.
26575         * metadata.h, metadata.c: added mono_metadata_guid_heap().
26576
26577 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
26578
26579         * threads: added icall support for getting current domain for
26580                    the thread.
26581  
26582 2002-04-13  Martin Baulig  <martin@gnome.org>
26583
26584         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
26585         (MonoDebugVarInfo): Added `index' field for register based addresses.
26586         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
26587         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
26588         `MonoDebugVarInfo *params' and `guint32 this_offset' with
26589         `MonoDebugVarInfo *this_var'.
26590
26591         * debug-symfile.c (relocate_variable): New static function to write
26592         a location description for a local variable or method parameter.
26593
26594 2002-04-12  Martin Baulig  <martin@gnome.org>
26595
26596         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
26597         stack offset and begin/end scope address of a local variable.
26598         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
26599         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
26600         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
26601
26602         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
26603         Added new relocation types for start/end scope of a local variable.
26604
26605 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26606
26607         * object.h: add mono_object_domain() macro.
26608         * reflection.c: handle typespecs.
26609         * icall.c: MonoMethod::get_Name() implementation.
26610
26611 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26612
26613         * icall.c: String::GetHashCode() icall implementation.
26614
26615 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26616
26617         * icall.c: String::IndexOfAny icall.
26618         * object.c, object.h: make array->max_length more useful.
26619         Intrduced mono_object_class() and mono_string_length() macros.
26620
26621 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26622
26623         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
26624         instead of g_unichar_isdigit.
26625
26626 2002-04-11  Nick Drochak  <ndrochak@gol.com>
26627
26628         * icall.c: Implement a simple Double.ToString().
26629
26630 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
26631
26632         * appdomain.h: only io-layer.h is supposed to be included.
26633         * icall.c: explicitly import environ. Fix warning.
26634
26635 2002-04-10  Nick Drochak  <ndrochak@gol.com>
26636
26637         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
26638                 return true even if it's not Daylight Savings time.
26639                 Only return false for the case where the function isn't
26640                 implemented for a plaform (read Windows).
26641
26642 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26643
26644         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
26645         data with a mutex.
26646
26647 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
26648
26649         * mempool.c (mono_mempool_alloc): only use g_malloc when
26650         absolutely necessary.
26651
26652 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
26653
26654         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
26655
26656         * class.c (mono_class_vtable): use domain mempool to allocate vtable
26657         (mono_class_proxy_vtable): use domain mempool
26658
26659 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
26660
26661         * appdomain.h, appdomain.c: split initialization that requires the
26662         execution engine support into mono_runtime_init().
26663
26664 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
26665
26666         * class.c (mono_class_init): don't include vtable inside MonoClass
26667         to save some memory, gather some statistics.
26668         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
26669
26670 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26671
26672         * icall.c: internalcall implementation for ValueType.Equals().
26673
26674 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
26675
26676         * object.c (mono_message_init): moved 
26677         (mono_runtime_exec_main): new arch. independent impl.
26678         (mono_runtime_invoke_array): new method - like
26679         mono_runtime_invoke, but you can pass an array of objects.
26680         (mono_remoting_invoke): new arch. independent impl.
26681         (mono_message_invoke): new arch. independent impl.
26682         (mono_runtime_class_init): new arch. independent impl.
26683         (mono_runtime_object_init): new arch. independent impl.
26684
26685 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26686
26687         * metadata.c, object.c, reflection.c: documented the exported
26688         functions.
26689
26690 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
26691
26692         * icall.c: simpler code to pass the assembly builder data to corlib.
26693         Implement GetNestedTypes() internalcall.
26694
26695 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26696
26697         * class.c: warn if a type can't be loaded.
26698
26699 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
26700
26701         * image.h: typedef MonoImageOpenStatus
26702         * types.h: removed unused file
26703         
26704 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
26705
26706         * icall.c: Enum_ToObject accepts enum value arguments.
26707
26708 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26709
26710         * class.c: move initialization of properties, events and nested
26711         classes, so that they happen for interfaces, too.
26712
26713 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26714
26715         * icall.c: cleanup some ugly casts in Array_SetValue*.
26716
26717 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26718
26719         * icall.c: the values array fro enums is of the correct type, now.
26720         Implement (correctly) getFullName instead of assQualifiedName for
26721         MonoType.
26722         * reflection.h, reflection.c: added mono_type_get_name ().
26723
26724 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26725
26726         * assembly.c, image.h: for each MonoImage, record from wich assembly
26727         it was loaded.
26728         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
26729         Make Type.Assembly work.
26730
26731 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
26732
26733         * debug-symfile.h: use char* instead of gpointer to avoid
26734         unnecessary casts.
26735
26736         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
26737
26738         * icall.c (ves_icall_InternalExecute): impl. FielSetter
26739         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
26740
26741 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
26742
26743         * icall.c (mono_message_init): impl. (code cleanup)
26744         (ves_icall_InternalExecute): impl. FieldGetter
26745
26746         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
26747         defined we call all (non-static)methods through the vtable. 
26748
26749 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
26750
26751         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
26752         finalizer even though the memory is still referenced (and the chunk of
26753         memory is not freed).
26754
26755 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
26756
26757         * assembly.c: fix brokeness.
26758
26759 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
26760
26761         * class.c: kill some warnings. Check explicit interface method
26762         implementation also without considering the namespace.
26763         Load also literal strings in static class data.
26764
26765 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
26766
26767         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
26768         (default_assembly_name_resolver): Make the resolver take the
26769         "base" directory where the assembly was originally defined, so we
26770         can load DLLs that are in the same directory as the assembly that
26771         is being referenced.
26772
26773 2002-03-28  Dick Porter  <dick@ximian.com>
26774
26775         * file-io.h: 
26776         * file-io.c:
26777         * socket-io.c: 
26778         * unicode.h: 
26779         * unicode.c: Warning cleanups
26780
26781 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
26782
26783         * object.h, reflection.h: use the correct type instead of MonoObject.
26784
26785 2002-03-28  Martin Baulig  <martin@gnome.org>
26786
26787         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
26788         (mono_debug_update_symbol_file): Initialize classes if necessary.
26789
26790 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
26791
26792         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
26793         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
26794
26795 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
26796
26797         * assembly.h: fix function prototype.
26798         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
26799         * mono-endian.h: use const cast.
26800
26801 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
26802
26803         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
26804
26805 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
26806
26807         * loader.c: don't assert when a typeref can't be loaded, give
26808         a chance to the runtime to trow an exception instead.
26809         * loader.h: fix warning.
26810
26811 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
26812
26813         * class.c (mono_class_proxy_vtable): added proxy support
26814
26815 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
26816
26817         * icall.c: removed last of PAL calls, added System.Environment
26818         * file-io.h, file-io.c: MonoIO implementation
26819         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
26820
26821 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
26822
26823         * appdomain.c: do not use the byte marker in ldstr table lookup.
26824         * debug-helpers.c: allow two ':' to separate class and method name.
26825         * object.c: allocate arrays bounds with the GC, too.
26826         * verify: add a few more checks.
26827
26828 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
26829
26830         * reflection.c: output also literal strings. Allocate parameter data
26831         with GC_malloc() (thanks, Martin, for catching this!).
26832
26833 2002-03-26  Martin Baulig  <martin@gnome.org>
26834
26835         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
26836         include the `this' offset in the `param_offsets'.
26837
26838 2002-03-25  Martin Baulig  <martin@gnome.org>
26839
26840         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
26841         mono_debug_get_class() function to get the classes. Added new
26842         relocation types for arrays and strings.
26843         (mono_debug_get_class): New static function to search in all
26844         referenced assemblies for a metadata token.
26845
26846         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
26847
26848 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
26849
26850         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
26851         hold gc-allocated objects. Make the string heap a stream like the
26852         others. Removed duplicated code when writing stream info.
26853         Added asserts to catch possible buffer overflows. Set the sorted map
26854         for tables that need sorting. Added some documentation.
26855
26856 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
26857
26858         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
26859         for interned strings and vtables.
26860
26861 2002-03-24  Martin Baulig  <martin@gnome.org>
26862
26863         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
26864         it in the array since it was created with g_slist_prepend().
26865
26866 2002-03-24  Martin Baulig  <martin@gnome.org>
26867
26868         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
26869         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
26870         (mono_debug_method_from_token): Renamed to
26871         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
26872         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
26873
26874         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
26875         relocation types.
26876
26877         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
26878
26879 2002-03-24  Martin Baulig  <martin@gnome.org>
26880
26881         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
26882         (mono_debug_method_from_token): New func.
26883
26884         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
26885         New interncall, calls mono_debug_local_type_from_signature().
26886         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
26887         calls mono_debug_method_from_token().
26888
26889 2002-03-23  Martin Baulig  <martin@gnome.org>
26890
26891         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
26892         specifies the number of bytes to be converted, not the array size.
26893         Return the number of chars, not the number of bytes.
26894         (ves_icall_iconv_get_chars): The `byteCount' argument
26895         specifies the number of bytes to be converted, not the array size.
26896
26897 2002-03-23  Martin Baulig  <martin@gnome.org>
26898
26899         * reflection.h (MonoReflectionSigHelper): New type.
26900
26901         * reflection.c (mono_reflection_sighelper_get_signature_local),
26902         (mono_reflection_sighelper_get_signature_local): New functions.
26903
26904         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
26905         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
26906         interncalls.
26907
26908 2002-03-23  Martin Baulig  <martin@gnome.org>
26909
26910         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
26911         is_writeable is set.
26912         (mono_raw_buffer_update): New function to write the modified map
26913         back to disk.
26914
26915         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
26916
26917         * debug-symfile.c (mono_debug_update_symbol_file): Call
26918         mono_raw_buffer_update() when done writing.
26919
26920 2002-03-23  Martin Baulig  <martin@gnome.org>
26921
26922         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
26923
26924         * debug-symfile.c: Added support for arguments and local variables.
26925
26926 2002-03-23  Dick Porter  <dick@ximian.com>
26927
26928         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
26929         protected by ifdefs, hence breaking the w32 build.
26930
26931 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
26932
26933         * object.c: implement is_interned() the right way.
26934
26935 2002-03-21  Martin Baulig  <martin@gnome.org>
26936
26937         * debug-symfile.[ch]: New files to handle debugging information
26938         files. There's also support to dynamically update these symbol
26939         files to include machine dependent information.
26940
26941 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
26942
26943         * threads.c (mono_thread_create): new function to create thread
26944         from C
26945
26946 2002-03-20  Martin Baulig  <martin@gnome.org>
26947
26948         * icall.c (ves_icall_InternalInvoke): Create a new object if the
26949         method is a constructor.
26950         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
26951         points to ves_icall_InternalInvoke().
26952
26953 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
26954
26955         * file-io.c: Flush shouldn't throw exceptions.
26956
26957 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
26958
26959         * file-io.c: FileStream flush support; FileSetLength now
26960         restores file pointer.
26961
26962 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
26963
26964         * class.c: set image for pointer classes.
26965
26966 2002/03/19  Nick Drochak <ndrochak@gol.com>
26967
26968         * sysmath.c: Forgot one.
26969
26970 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
26971
26972         * sysmath.c: Avoid redefining existing names.
26973
26974 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
26975
26976         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
26977         handled by runtime as icall rather than dllimport from libm.so
26978         * file-io.c, file-io.h: fixed handle argument type.
26979
26980 2002-03-18  Dick Porter  <dick@ximian.com>
26981
26982         * reflection.c (mono_image_get_type_info): rename interface to
26983         iface, because of "#define interface struct" on windows.
26984
26985 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
26986
26987         * class.c, class.h: rename and export mono_ptr_class_get().
26988         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
26989         * reflection.c, reflection.h, icall.c: better/saner type name
26990         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
26991         method signatures.
26992
26993 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
26994
26995         * class.c (mono_class_init): removed hardcoded GHC_SLOT
26996
26997         * icall.c (ves_icall_InternalInvoke): impl.
26998
26999 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
27000
27001         * reflection.c: output the interface map table, too.
27002
27003 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
27004
27005         * class.c (class_compute_field_layout): separate computation of 
27006         static field layout
27007
27008 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
27009
27010         * icall.c: added System.Buffer support.
27011         * file-io.c: moved file icalls from PAL to FileStream.
27012
27013 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
27014
27015         * icall.c (ves_icall_System_Object_GetHashCode): impl.
27016
27017 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
27018
27019         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
27020
27021 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
27022
27023         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
27024
27025 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27026
27027         * debug-helpers.{c,h}: moved here from monograph some useful functions
27028         to locate a method by name/signature in a class or image. Included
27029         also a small and flexible IL disassembler.
27030
27031 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
27032
27033         * reflection.c: fixup tokens in methods with small header size, too.
27034
27035 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
27036
27037         * object.c (mono_string_to_utf8): remove assert(!error), instead
27038         print a warning. 
27039
27040 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
27041
27042         * icall.c: update to the new mono_Array_class_get interface.
27043
27044 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
27045
27046         * appdomain.c, object.c: Boehm-GC enable.
27047         * icall.c: make get_data_chunk() support split data requests.
27048         Ensure a class is initialized in more cases. Return only the first
27049         property found in GetProperties() or the compiler gets confused. 
27050         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
27051         * reflection.h, reflection.c: add fixup mechanism for field and method
27052         tokens. Initialize assembly->typeref in a single place. Output
27053         properties after events. Support custom attributes for events, too.
27054         Typo fix for paramter custom attrs.
27055
27056 2002-03-07  Martin Baulig  <martin@gnome.org>
27057
27058         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
27059
27060 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
27061
27062         * class.c (mono_array_class_get): fix. for multi. dim. arrays
27063
27064 2002-03-06  Martin Baulig  <martin@gnome.org>
27065
27066         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
27067         non-zero lower bounds. See testcases #F10-#F13.
27068
27069 2002-03-05  Martin Baulig  <martin@gnome.org>
27070
27071         * exception.c (mono_get_exception_argument_out_of_range): New exception.
27072
27073         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
27074         ves_icall_System_Array_GetValue(), only calculate the absolute array position
27075         here.
27076         (ves_icall_System_Array_SetValue): Likewise.
27077         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
27078         as argument and does the actual work. This function is used when copying a
27079         multi-dimensional array.
27080         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
27081         now do all the widening conversions of value types.
27082         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
27083
27084 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
27085
27086         * class.c: remove some magic numbers and use the smbolic names,
27087         instead. Added init_events() to load event info at class init time.
27088         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
27089         and mono_metadata_methods_from_event().
27090         * reflection.h, reflection.c: added support for writing out the evnets
27091         related information.
27092
27093 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
27094
27095         * reflection.h, icall.c: use a different method (GetInterfaces)
27096         to gather interface info and add isbyref, isprimitive and
27097         ispointer to the ves_icall_get_type_info() return value.
27098
27099 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
27100
27101         * class.h: stared adding support for events.
27102         * icall.c: split find_members implementation. Added debug icall to get
27103         the address of an object.
27104         * reflection.c: handle TypeBuilders in mono_type_get_object().
27105
27106 2002-03-01  Martin Baulig  <martin@gnome.org>
27107
27108         * icall.c (ves_icall_System_Array_GetLength): This must throw an
27109         ArgumentOutOfRangeException(), not an ArgumentException().
27110         (ves_icall_System_Array_GetLowerBound): Likewise.
27111         (ves_icall_System_Array_GetValue): Improved argument checking.
27112         (ves_icall_System_Array_SetValue): Improved argument checking.
27113
27114 2002-03-01  Martin Baulig  <martin@gnome.org>
27115
27116         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
27117         called with invalid arguments rather than just dying with g_assert().
27118         (ves_icall_System_Array_SetValue): Likewise.
27119         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
27120         raise a NotImplementedException instead.
27121         (ves_icall_System_Array_GetLength): Added argument checking.
27122         (ves_icall_System_Array_GetLowerBound): Added argument checking.
27123
27124 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
27125
27126         * object.h (mono_assert): new macros mono_assert and
27127         mono_assert_not_reached
27128
27129 2002-02-28  Martin Baulig  <martin@gnome.org>
27130
27131         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
27132         and "System::String::IsInterned" to "System::String::_IsInterned".
27133
27134 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
27135
27136         * icall.c: remove hacks for typebuilder. Added icall to create a
27137         modified type from a tybebuilder.
27138         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
27139         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
27140         to create a backing MonoClass for a TypeBuilder.
27141
27142 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
27143
27144         * class.c, class.h: more refactoring of class init.
27145         Export mono_class_setup_mono_type() and mono_class_setup_parent().
27146
27147 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
27148
27149         * marshal.c, marshal.h: start of marshaling interface.
27150
27151 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
27152
27153         * icall.c: fix order in assembly qualified name icall.
27154
27155 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
27156
27157         * class.c: do not free str, since we store it in the hash table.
27158         * reflection.h: add label field to MonoILExceptionInfo.
27159         * reflection.c: handle references to more than one assembly. Handle
27160         case when there isn't a module created in the assembly.
27161
27162 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
27163
27164         * class.c: Fix typo. Start refactoring of class init code.
27165
27166 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
27167
27168         * appdomain.c: exit with 1 on error.
27169         * class.c: we already have the name in MonoClassField.
27170         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
27171         MonoStreamHeader instead of an offset of image->raw_metadata.
27172
27173 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
27174
27175         * appdomain.c (mono_init): Be even more descriptive about the error.
27176
27177 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
27178
27179         * appdomain.c: give the user an informative message when corlib can't
27180         be loaded.
27181
27182 2002-02-26  Martin Baulig  <martin@gnome.org>
27183
27184         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
27185         New icall to get the time zone data.
27186
27187 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
27188
27189         * reflection.c: set virtual and raw size of section correctly.
27190         * threads.c: transfer domain information to newly created threads.
27191
27192 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
27193
27194         * class.c: when instancing a class in a domain, load the default
27195         vaules for static fields from the constant table. Fix System.Enum to
27196         not be an enum.
27197         * icall.c: implement Object::GetType() internalcall. Implemented
27198         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
27199         Fixed checking of binding flags in find_members().
27200         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
27201         * reflection.c: handle enumerations when writing to the constant
27202         table. Use a different object cache for types.
27203
27204
27205 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
27206
27207         * object.c (mono_object_isinst): fix for arrays
27208
27209         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
27210
27211 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
27212
27213         * object.c: don't use mprotect ()  and fix intern pool hash table
27214         lookup for big endian systems.
27215
27216 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
27217
27218         * icall.c: change type_is_subtype_of () signature.
27219
27220 2002-02-21  Mark Crichton  <crichton@gimp.org>
27221
27222         * rand.c, rand.h: Added random number generator for
27223         System.Security.Cryptography classes.
27224
27225         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
27226
27227         * icall.c: Added System.Security.Cryptography calls.
27228
27229 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
27230
27231         * class.c, icall.c, metadata.c: better support for pointer types.
27232         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
27233         * reflection.c: Add support for getting custom attrs for properties
27234         and simplify some code.
27235
27236 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
27237
27238         * icall.c: change getToken () and add custom attribute GetBlob()helper
27239         method.
27240         * reflection.h: add custom attrs array to the reflection builder structures.
27241         * reflection.c: encode and emit custom attributes for all the relevant
27242         reflection objects. Cache fieldref and methodref tokens. Change
27243         mono_image_create_token() interface to take a MonoDynamicAssembly.
27244         More complete custom attributes decoder. Load custom attributes for
27245         Assembly, Field, Method and Constructor objects, too. Make the
27246         returned array an Attribute[] one, not object[]. Added
27247         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
27248         custom attribute constructor.
27249
27250 2002-02-20  Dick Porter  <dick@ximian.com>
27251
27252         * icall.c:
27253         * rawbuffer.c:
27254         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
27255         problem code out for now).
27256
27257 2002-02-19  Radek Doulik  <rodo@ximian.com>
27258
27259         * object.c (mono_ldstr): use hash table to avoid multiple swapping
27260
27261 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
27262
27263         * icall.c: register the GetCustomAttributes method.
27264         * object.c, object.h: add mono_string_new_len ().
27265         * reflection.h, reflection.c: added mono_runtime_invoke(),
27266         mono_install_runtime_invoke(). Added
27267         mono_reflection_get_custom_attrs () to load custom attributes and
27268         create the attribute objects.
27269
27270 2002-02-19  Dick Porter  <dick@ximian.com>
27271         * threads-dummy-types.c:
27272         * threads-dummy-types.h:
27273         * threads-dummy.c:
27274         * threads-dummy.h:
27275         * threads-pthread-types.c:
27276         * threads-pthread-types.h:
27277         * threads-pthread.c:
27278         * threads-pthread.h:  Deleted obsolete files
27279
27280 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
27281
27282         * class.c (mono_class_vtable): runtime init the class when we
27283         allocate static class data.
27284
27285         * icall.c (ves_icall_System_Array_SetValue): check for null values.
27286
27287         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
27288         and String - but we will need generic marshalling support in the
27289         future. 
27290         (mono_init): set the domain name in a ms compatible way
27291
27292         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
27293         String[].
27294
27295 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
27296
27297         * object.c (mono_array_clone): use alloca() instead of g_malloc  
27298         for sizes
27299
27300         * appdomain.c (mono_domain_unload): impl.
27301
27302 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
27303
27304         * appdomain.c, object.c: fix intern pool implementation.
27305         * class.c: fix alignment code.
27306
27307 2002-02-16  Radek Doulik  <rodo@ximian.com>
27308
27309         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
27310         and s2 > s1, just copy lower bytes to be compatible with little
27311         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
27312         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
27313
27314         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
27315         force big_endian to be 1 for big endian machines 
27316         (ves_icall_iconv_new_decoder): ditto
27317
27318 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
27319
27320         * socket-io.c (convert_sockopt_level_and_name): If the system
27321         doesn't define SOL_IP or SOL_TCP, get them by hand using
27322         getprotobyname() and caching the values (because this could be a
27323         slow operation).
27324         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
27325         Use the appropriate struct when the system does support it. Ie,
27326         not all systems have struct ip_mreqn so use struct ip_mreq when
27327         appropriate.
27328
27329 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
27330
27331         * reflection.c: handle finally clauses.
27332
27333 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
27334
27335         * socket-io.c: use g_snprintf() instead of snprintf.
27336
27337 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
27338
27339         * reflection.c (mono_param_get_objects): Cast second argument to
27340         mono_method_get_param_names to a const char** to silence the
27341         compiler warning.
27342
27343         * appdomain.c (mono_domain_assembly_open): Put parens around the
27344         truth statement in the for-loop.
27345
27346         * unicode.c (iconv_convert): Got rid of a compiler warning about
27347         int i being unused when the system has a new iconv.
27348         (iconv_get_length): Same.
27349
27350         * image.c (load_class_names): Cast the second argument to
27351         g_hash_table_insert() to char* to hush compiler warnings about the
27352         arg being a const.
27353         (mono_image_open): Same here.
27354
27355         * socket-io.c: Don't conditionally include sys/filio.h or
27356         sys/sockio.h here anymore since we now get them from
27357         io-layer/io-layer.h
27358         (inet_pton): If the system doesn't support inet_aton, implement
27359         using inet_addr and also #define INADDR_NONE if it isn't defined
27360         by the system.
27361
27362 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
27363
27364         * metadata.c, metadata.h: added function to get packing and size info
27365         of a typedef.
27366         * reflection.h, reflection.c: handle field RVA data. Save info about
27367         the table layout if needed. Assign typedef indexes to all the types
27368         before dumping the info about them to avoid forward reference problems.
27369
27370 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
27371
27372         * socket-io.c (convert_sockopt_level_and_name): ifdef
27373         SO_ACCEPTCONN because it is not defined on my system (old debian)
27374
27375 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
27376
27377         * opcode.c: use stddef.h to get NULL.
27378
27379 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
27380
27381         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
27382         for FIONBIO, FIONREAD and SIOCATMARK.
27383         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
27384         define INADDR_NONE and besides, inet_addr() is deprecated and
27385         should not be used. Use inet_pton() instead - it also has the
27386         added bonus that it can easily handle IPv6 addresses as well.
27387         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
27388
27389 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
27390
27391         * decimal.c: remove _MSC_VER conditional.
27392
27393 2002-02-13  Dick Porter  <dick@ximian.com>
27394
27395         * socket-io.c: 
27396         * icall.c: Internal calls for Blocking, Select, Shutdown,
27397         GetSocketOption and SetSocketOption
27398
27399 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
27400
27401         * assembly.cs: better resolver: use it instead of some kludgy
27402         code.
27403
27404 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
27405
27406         * reflection.c: the best way to speed-up the compiler is to avoid
27407         infinite loops.
27408
27409 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
27410
27411         * class.c (mono_class_vtable): changed the object layout
27412         (obj->vtable->class). 
27413         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
27414
27415 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
27416
27417         * assembly.c: look for assemblies in the assembly dir, too.
27418
27419 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
27420
27421         * class.c: fix thinko in mono_class_from_type().
27422
27423 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
27424
27425         * exception.h, exception.c: added TypeLoadException.
27426         * object.h, object.c: added mono_array_clone ().
27427         * icall.c: handle throwOnError in AssemblyGetType().
27428         Added Array.Clone().
27429         * opcode.h, opcode.c: use a single value for the opcode val.
27430         Compile fix for non-gcc compilers.
27431
27432 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
27433
27434         * opcodes.c, opcodes.h: export interesting info about opcodes.
27435
27436 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
27437
27438         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
27439         icalls. 
27440
27441         * class.c (class_compute_field_layout): set element_class for enums
27442         (mono_class_create_from_typedef): set element_class for normal classes
27443
27444         * icall.c (ves_icall_System_Enum_get_value): impl.
27445
27446         * class.c (mono_class_create_from_typedef): do not set valuetype
27447         flag for System.ValueType and System.Enum
27448
27449 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
27450
27451         * unicode.c (iconv_convert): fix big endian problem.
27452
27453 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
27454
27455         * class.c: add asserts if we are ever going to scribble over memory.
27456         * socket-io.c: not all systems have AF_IRDA defined.
27457
27458 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
27459
27460         * class.c (class_compute_field_layout): do not consider static
27461         fields to compute alignment
27462
27463 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
27464
27465         * appdomain.c (mono_appdomain_get): impl.
27466         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
27467
27468 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27469
27470         * icall.c: ignore "file://" prefix when loading an assembly.
27471
27472 2002-01-23  Dick Porter  <dick@ximian.com>
27473
27474         * socket-io.c:
27475         * icall.c:
27476         * Makefile.am: Added socket support
27477
27478 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
27479
27480         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
27481         code back.  This should return the assemblies that are loaded by
27482         the runtime on behalf of an application domain. 
27483
27484         The current implementation is still broken, it just returns every
27485         assembly loaded, but until we get real applications domain this
27486         will do.
27487
27488 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
27489
27490         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
27491         AppDomain object.
27492
27493 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
27494
27495         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
27496         the mono_class_from_name lookup.
27497         (ves_icall_get_parameter_info): ditto.
27498         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
27499         method.
27500         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
27501
27502 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
27503
27504         * class.c: load also nested classes on class init.
27505         System.ValueType instance methods gets passed boxed
27506         values, unless methods in derived classed that get a pointer to the
27507         data.
27508         * icall.c: use better name parsing code in GetType().
27509         * image.c, image.h: add mono_image_loaded ().
27510         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
27511         * reflection.c, reflection.h: added mono_reflection_parse_type().
27512
27513 2002-01-22  Veronica De Santis <veron78@interfree.it>
27514
27515         * icall.c : Added mapping of internal calls for Manual and Auto reset events
27516         * threads.c : Added the implementation of internal calls for events
27517         * threads.h : Added prototypes of internal calls for events
27518         
27519 2002-01-21  Radek Doulik  <rodo@ximian.com>
27520
27521         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
27522
27523 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
27524
27525         * class.c (mono_class_init): set min_align to 1 (instead of 0)
27526         (mono_class_value_size): use min_align
27527
27528 2002-01-20  Dick Porter  <dick@ximian.com>
27529
27530         * threads.h:
27531         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
27532         so it compiles on w32.
27533
27534 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
27535
27536         * metadata.c (mono_type_stack_size): impl.
27537
27538         * class.c (mono_class_get_field): impl. memberref token
27539
27540 2002-01-16 Veronica De Santis <veron78@@interfree.it>
27541
27542         * icall.h : Added the internal calls mapping for CreateMutex_internal
27543                     and ReleaseMutex_internal.
27544         * threads.h : Added the prototype of mutexes internal calls.
27545         * threads.c : Added the implementations of mutexes internal calls.
27546
27547 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
27548
27549         * metaparse.h: removed unused file.
27550         * reflection.c, reflection.h: added stream_data_align () function 
27551         to align data in streams and keep stream aligned. Add support for
27552         exception support in method headers.
27553
27554 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
27555
27556         * unicode.c: make iconv_convert () return the number of bytess written
27557         in the output buffer.
27558
27559 2002-01-15  Dick Porter  <dick@ximian.com>
27560         * threads.c: Make the runtime's idea of infinite timeouts coincide
27561         with the class library's
27562
27563         Fix a particularly egregious bug in mono_thread_cleanup(). That
27564         code was so utterly bogus it must have been written on a Monday.
27565
27566 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
27567
27568         * reflection.h: add subtypes field to TypeBuilder.
27569         * reflection.c: encode constants for literal fields.
27570         Handle subtypes. Fix user string token (and add a zero byte)
27571         at the end.
27572         
27573 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
27574
27575         * class.c (mono_class_init): bug fix: assign slot numbers for
27576         abstract methods.
27577
27578 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
27579
27580         * reflection.c: don't try to output a code RVA for abstract methods.
27581         Small fixes for method header format. Output parameter info to the
27582         ParamDef table. Save method overriding info to MethodImpl table.
27583         Fix property support. Allow typedef.extends to be a type in the
27584         building assembly.
27585         * verify.c: fix off-by-one error.
27586
27587 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
27588
27589         * class.c: fix mono_class_from_mono_type () for szarray types.
27590         Remove unused cache check in mono_class_from_type_spec().
27591         * icall.c: *type_from_name () functions handle simple arrays and byref.
27592         * reflection.c: handle byref and szarray types. Handle methods without
27593         body (gets P/Invoke compilation working). Handle types and fields in
27594         get_token ().
27595         * reflection.h: add rank to MonoTypeInfo.
27596
27597 2002-01-10  Dick Porter  <dick@ximian.com>
27598
27599         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
27600         internal calls
27601
27602 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
27603
27604         * icall.c: initialize class in type_from_handle ().
27605         Loop also in parent classes for get_method ().
27606         * reflection.c: properly encode class and valuetype types.
27607         Start on encoding TypeBuilder types. Handle fieldrefs.
27608         Use correct length when registering a user string.
27609         Handle ConstructorBuilder and MonoMethod in get_token ().
27610         Make mono_type_get_object () aware of cached types.
27611         * object.c: back out change to mono_string_new ().
27612
27613 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
27614         * object.c: mono_string_new should return a NULL when the string 
27615         passed in is NULL -- not try to deference it.
27616         
27617 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
27618
27619         * icall.c: hack to make IsSubType work for TypeBuilders.
27620         * reflection.c: emit constructors before methods.
27621         Retrieve param names in mono_param_get_objects().
27622
27623 2002/01/05  Nick Drochak  <ndrochak@gol.com>
27624
27625         * Makefile.am: fix list of headers and sources so automake 1.5
27626         doesn't complain. Removed \# at end of list.
27627
27628 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
27629
27630         * reflection.c: get token for a method ref. Set return type of
27631         constructor to void.
27632         * loader.c: debug message.
27633         * class.c: typo fix.
27634
27635 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
27636
27637         * icall.c: fix array init with rank > 1. FindMembers
27638         loops in parent class as well.
27639         * image.c: do not insert nested types in name cache.
27640         * reflection.c: warning fix.
27641         * reflection.h: add override method (for interface impl).
27642
27643 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
27644
27645         * metadata.c: fix customattr decoding.
27646
27647 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27648
27649         * rawbuffer.cs: Added native Win32 implementation, avoids using
27650         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
27651
27652 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
27653
27654         * class.c: make the low-level routines handle the cache.
27655
27656 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
27657
27658         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
27659
27660 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
27661
27662         * class.c: fix mono_array_element_size() for objects.
27663         * class.h, class.c: add properties to MonoClass and load them
27664         at init time.
27665         * icall.c: check with isinst() when assigning a value to an array
27666         instead of requiring the classes to match exactly.
27667         Implemented icall for System.Type::GetType().
27668         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
27669         enums. Handle bindingflags when looking for methods and fields.
27670         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
27671         and mono_metadata_methods_from_property().
27672         * reflection.h, reflection.c: added structures for propreties,
27673         parameters and enums. Implemented mono_property_get_object() and
27674         mono_param_get_objects().
27675
27676 2001-12-18  Dick Porter  <dick@ximian.com>
27677
27678         * file-io.c: Use mono_string_to_utf16() instead of
27679         mono_string_chars()
27680
27681         * object.c: Added mono_string_to_utf16(), which copies the non
27682         NULL-terminated MonoString into a new double-null-terminated
27683         buffer.
27684
27685 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
27686
27687         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
27688
27689 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
27690
27691         * file-io.c: raise exceptions if handle is invalid.
27692
27693 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
27694
27695         * assembly.c: yet another check for mscorlib.
27696         * class.c, class.h: load nesting info for classes.
27697         * icall.c: many new functions to support the Reflection classes.
27698         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
27699         * reflection.h, reflection.c: mono_image_create_token(),
27700         mono_assembly_get_object(), mono_type_get_object(),
27701         mono_method_get_object(), mono_field_get_object(): methods to return
27702         objects that parallel the C representation of assemblies, types,
27703         methods, fields.
27704
27705 2001-12-11  Dick Porter  <dick@ximian.com>
27706
27707         * icall.c:
27708         * file-io.c: Internal calls for file IO.
27709
27710 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
27711
27712         * tabledefs.h: missing FileAttributes.
27713         * verify.h, verify.c: use is_valid_string () to simplify and check for
27714         valid strings more correctly. Fix warnings and speeling.
27715         Check more tables: Filed, File, ModuleRef, StandAloneSig.
27716         Check code: branches, maxstack, method calls.
27717
27718 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
27719
27720         * object.c (mono_object_allocate): removed static, so that the jit
27721         can allocate value types.
27722
27723         * icall.c (ves_icall_System_DateTime_GetNow): impl.
27724
27725 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
27726
27727         * class.c: init enum types right away and register the
27728         token->MonoClass map in mono_class_create_from_typedef ().
27729         * verify.h, verify.c: first cut of the verifier.
27730         * pedump.c: add --verify switch to verify metadata tables.
27731         * tabledefs.h: add some missing enums.
27732
27733 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
27734
27735         * class.c (mono_install_runtime_class_init): impl.
27736         (mono_class_init): renamed mono_class_metadata_init to
27737         mono_class_init, also removed the metadata_inited flag
27738
27739         * object.c (mono_object_isinst): use faster algorithm
27740
27741 2001-11-30  Radek Doulik  <rodo@ximian.com>
27742
27743         * mono-endian.h: reverted last change
27744         added function prototypes
27745
27746         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
27747         add mono-endian.c back
27748
27749         * mono-endian.c: returned back, as Paolo pointed out, it's needed
27750         for unaligned access, I've mistaked it with endianess. I am
27751         sorry.
27752         (mono_read16): fix reverted endianess
27753         (mono_read64): ditto
27754         (mono_read32): ditto
27755
27756 2001-11-30  Dick Porter  <dick@ximian.com>
27757
27758         * exception.c: Implement mono_exception_from_name()
27759
27760 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
27761
27762         * metadata.h, metadata.c: remove params_size and locals_size and their
27763         calculation from the metadata code: they are only usefult to the
27764         interp.
27765
27766 2001-11-29  Radek Doulik  <rodo@ximian.com>
27767
27768         * object.c (mono_ldstr): swap bytes here, it's probably not the
27769         best place, but works for me now, I'll redo it once I know mono
27770         better, also note that I add PROT_WRITE and don't reset back, also
27771         note that it's only affects big endians, so x86 should be OK
27772
27773         * mono-endian.h (read16): use just glib macros for both endians
27774
27775         * mono-endian.c: removed as glib macros are used in in
27776         mono-endian.h so we don't need to care about endianess for read
27777         macros as glib does that for us already
27778
27779 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
27780
27781         * class.h, class.h: take minimum alignment into consideration so
27782         that the fields of a class remain aligned also when in an array.
27783
27784 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
27785
27786         * loader.h, loader.c: add mono_method_get_param_names().
27787         * class.c: 0-init class fields.
27788
27789 2001-11-26  Dick Porter  <dick@ximian.com>
27790
27791         * icall.c:
27792         * threads-types.h:
27793         * threads.c: New file that handles System.Threading on all platforms
27794
27795         * object.c: 
27796         * object.h: Remove the synchronisation struct from MonoObject,
27797         replace it with a pointer that gets initialised on demand
27798
27799         * Makefile.am: Replace all the system-specific threading code with
27800         a single file that uses the new wrapper library
27801
27802 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
27803
27804         * class.c, class.h: add mono_install_trampoline() so that the runtime
27805         can register a function to create a trampoline: removes the ugly
27806         requirement that a runtime needed to export arch_create_jit_trampoline.
27807         * object.h, object.c: added mono_install_handler() so that the runtime
27808         can install an handler for exceptions generated in C code (with
27809         mono_raise_exception()). Added C struct for System.Delegate.
27810         * pedump.c: removed arch_create_jit_trampoline.
27811         * reflection.c: some cleanups to allow registering user strings and
27812         later getting a token for methodrefs and fieldrefs before the assembly
27813         is built.
27814         * row-indexes.h: updates and fixes from the new ECMA specs.
27815
27816 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
27817
27818         * class.h, class.c: add enum_basetype field to MonoClass.
27819         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
27820         to get index in the constant table reated to a field, param or
27821         property.
27822         * reflection.h, reflection.c: handle constructors. Set public-key and
27823         version number of the built assembly to 0.
27824         * row-indexes.h: update from new ECMA spec.
27825
27826 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
27827
27828         * class.h, class.c: add a max_interface_id to MonoClass.
27829         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
27830         since it's used to do that. Added mono_type_type_from_obj().
27831         Make GetType() return NULL instead of segfaulting if the type was not
27832         found. Handle simple arrays in assQualifiedName.
27833         * object.h: add a struct to represent an Exception.
27834         * reflection.c: output call convention in method signature.
27835         Add code to support P/Invoke methods and fixed offsets for fields.
27836
27837 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
27838
27839         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
27840         the value.
27841         * icall.c: use mono_array_addr instead of array->vector: fixes the
27842         reflection image writing.
27843         * reflection.c: init call convention byte to 0 in method signature.
27844         Encode the property signature. Don't output property-related methods
27845         twice. Really process the properties for a type (don't cast a field to
27846         a property, my mom always told me that).
27847         Fix 64 bit issues in pointer alignment in a different and more
27848         readable way.
27849
27850 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
27851
27852         * loader.h: Removed type class from MonoDefaults, added monotype
27853
27854         * loader.c: Loaded MonoType, removed loading of Type
27855
27856         * icall.c (my_mono_new_object): Now returns a System.MonoType,
27857         and fills in System.Type._impl with a RuntimeTypeHandle rather
27858         than the actual MonoClass *
27859
27860         (ves_icall_type_from_handle): change from type_class to
27861         monotype_class
27862
27863         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
27864         implemented
27865
27866         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
27867         implemented
27868
27869         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
27870
27871         (ves_icall_System_Reflection_Assembly_GetType): implemented
27872
27873         (ves_icall_System_MonoType_assQualifiedName): implemented
27874
27875         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
27876
27877 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27878
27879         * assembly.c (mono_assembly_open): Implement a cache for the
27880         assemblies. 
27881
27882         (mono_assembly_close): only destroy the assembly when the last
27883         reference is gone.
27884         
27885 2001-11-09  Dick Porter  <dick@ximian.com>
27886
27887         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
27888
27889 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
27890
27891         * class.c (mono_class_metadata_init): bug fix: compute the right slot
27892
27893 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
27894
27895         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
27896         from Martin Weindel.
27897         * object.h: add mono_string_chars ().
27898
27899 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
27900
27901         * reflection.c (build_compressed_metadata): Eliminates warnings
27902         and uses 64-bit clean code.
27903
27904         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
27905         (mono_type_equal): Change signature to eliminate warnings.
27906
27907 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
27908
27909         * icall.c, loader.c: remove the internalcall array constructors.
27910         Changes to match the new MonoArray structure.
27911         * object.h, object.c: an array object doesn't allocate an extra
27912         vector. Add mono_array_new_full () to create jagged arrays easily.
27913
27914 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
27915
27916         * metadata.h, metadata.c: add mono_metadata_field_info () to
27917         retreive all the info about a field from vairous tables.
27918         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
27919         * class.h, class.c: augment MonoClassField with more info.
27920         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
27921         policy and load a field's RVA if needed.
27922
27923 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
27924
27925         * class.c (mono_class_metadata_init): create a trampoline for all
27926         virtual functions instead of actually compiling them.
27927
27928 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
27929
27930         * class.h, class.c: include name in MonoClassField.
27931         * class.c: fix fundamental type of System.Object and System.String.
27932         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
27933         tokens in ldtoken.
27934         * icall.c: remove internalcalls for the Reflection stuff that is now
27935         done in C# code.
27936         * loader.c: mono_field_from_memberref () implementation.
27937         * mono-endian.c: thinko (s/struct/union/g).
27938         * object.c, object.h: make the mono_string_* prototypes actually use
27939         MonoString instead of MonoObject.
27940         * reflection.c, reflection.h: updates for changes in the reflection
27941         code in corlib: we use C structures that map to the actual C# classes.
27942         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
27943         fat method header if needed and use the info from the ILGenerator for
27944         methods. Handle fields in types. Misc fixes.
27945
27946 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
27947
27948         * class.c (mono_class_metadata_init): bug fix: always allocate
27949         space for static class data
27950
27951 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
27952
27953         * class.c (mono_compute_relative_numbering): use relative
27954         numbering to support fast runtime type checks.
27955
27956 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
27957
27958         * class.c (mono_class_create_from_typeref): added debugging output
27959         to print class name when MonoDummy is returned instead of real class
27960
27961 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
27962
27963         * class.c (mono_class_metadata_init): interface offset table now
27964         contains pointers into the vtable - this is more efficient for the jit
27965
27966 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
27967
27968         * class.c (mono_class_metadata_init): use a temporary vtable (the
27969         old algorithm only worked for the interpreter, but not for the jit)
27970
27971 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
27972
27973         * loader.c (method_from_memberref): use mono_class_get to get the
27974         class of an array instead of using System.Array directly.
27975         (mono_get_method): also add MEMBERREF methods to the method cache
27976         which usefull for arrays.
27977
27978 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
27979
27980         * pedump.c (arch_compile_method): added to compute vtable entry
27981
27982         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
27983         number of interfaces.
27984         
27985         * class.h: merged MonoArrayClass into MonoClass
27986
27987         * class.c (mono_class_create_from_typedef): compute the vtable size and
27988         allocate space to include the vtable inside MonoClass
27989         (mono_class_metadata_init): initialize the vtable
27990
27991 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
27992
27993         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
27994         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
27995         * image.c: endian fixes by Laurent Rioux.
27996         * object.h, object.c: rename MonoStringObject to MonoString and
27997         MonoArrayObject to MonoArray. Change some function names to conform to
27998         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
27999         guint16* as first argument, so don't use char*.
28000         Provide macros to do the interesting things on arrays in a portable way.
28001         * threads-pthread.c: updates for the API changes and #include <sched.h>
28002         (required for sched_yield()).
28003         * icall.c: updates for the API changes above.
28004         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
28005         platforms that need them.
28006
28007 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
28008
28009         * class.c: set the correct type for all the fundamental
28010         type when loading the class.
28011
28012 2001-10-05  Dick Porter  <dick@ximian.com>
28013
28014         * threads-pthread.c (pthread_mutex_timedlock): Simple
28015         compatibility version for C libraries that lack this call.
28016
28017 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
28018
28019         * class.c: MonoTypes stored in MonoClass are stored as
28020         fundamental MonoTypes when the class represents a
28021         fundamental type (System.Int32, ...).
28022         The TypeHandle return by ldtoken is a MonoType*.
28023         * icall.c: ves_icall_get_data_chunk () write out all the
28024         PE/COFF stuff. Implement ves_icall_define_method (),
28025         ves_icall_set_method_body (), ves_icall_type_from_handle ().
28026         * image.c: properly skip unknown streams.
28027         * loader.h, loader.c: add type_class to mono_defaults.
28028         * metadata.c, metadata.h: export compute_size () as
28029         mono_metadata_compute_size () with a better interface.
28030         Typo and C&P fixes.
28031         * pedump.c: don't try to print the entry point RVA if there is no entry point.
28032         * reflection.c, reflection.h: many cleanups, fixes, output method
28033         signatures and headers, typedef and typeref info, compress the metadata
28034         tables, output all the heap streams, cli header etc.
28035         * row-indexes.h: typo fixes.
28036
28037 2001-10-04  Dick Porter  <dick@ximian.com>
28038
28039         * object.h: Add a synchronisation mutex struct to MonoObject
28040
28041         * object.c (mono_new_object): Initialise the object
28042         synchronisation mutexes
28043
28044         * icall.c: System.Threading.Monitor internal calls
28045         
28046         * threads-pthread.h:
28047         * threads-pthread.c: System.Threading.Monitor internal calls
28048
28049         * threads-types.h: New file, includes the system-specific thread
28050         structures
28051         
28052         * threads-pthread-types.h:
28053         * threads-pthread-types.c: New files, handle pthread-specific
28054         synchronisation types
28055
28056         * threads-dummy-types.h: 
28057         * threads-dummy-types.c: New files of dummy support for
28058         thread-specific types
28059
28060         * metadata.c:
28061         * image.c:
28062         * pedump.c: include mono-endian.h not endian.h
28063         
28064         * Makefile.am: More threads files.
28065         Name mono-endian.h not endian.h
28066
28067 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
28068
28069         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
28070         stuff and implement a few more bits.
28071         * icall.c: a field needs to be dereferenced twice. Do not use the same
28072         name for two variables in the same scope.
28073         * image.c, image.h: cleanups.
28074
28075 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
28076
28077         * class.c (mono_class_metadata_init): bug fix: compute the right size
28078
28079 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
28080
28081         * icall.c: implemented some of the Reflection internalcalls.
28082         * image.c, image.h: start writing out the PE/COFF image.
28083         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
28084         that does the reverse than decode_blob_size ().
28085         * object.c: use mono_metadata_encode_value (). Move here
28086         temporary implementation of mono_string_to_utf8 ().
28087         * rawbuffer.c: make malloc_map static.
28088
28089 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
28090
28091         * metadata.c: fix type comparison for arrays.
28092         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
28093         Added a couple of new classes to monodefaults.
28094         * icall.c: added a couple of Reflection-related internalcalls.
28095         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
28096         Added a byval_arg MonoType to MonoClass.
28097
28098 2001-09-28  Dick Porter  <dick@ximian.com>
28099
28100         * icall.c:
28101         * threads-pthread.h: 
28102         * threads-pthread.c: Implemented internal calls for
28103         LocalDataStoreSlot operations.  Applied mutexes around all shared
28104         data.  Reworked the thread creation and Start() operations to
28105         avoid a race condition.
28106         
28107         * threads-dummy.h:
28108         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
28109
28110 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
28111
28112         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
28113
28114 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
28115
28116         * class.c, loader.c: warn and return NULL instead of erroring out.
28117         * icall.c: added System.AppDomain::getCurDomain().
28118         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
28119
28120 2001-09-25  Dick Porter  <dick@ximian.com>
28121
28122         * threads-pthread.h:
28123         * threads-pthread.c: Implemented timed thread joining and added
28124         System.Threading.Thread::Join_internal internal call
28125
28126         * icall.c: Added System.Threading.Thread::Join_internal internal call
28127
28128         * threads-dummy.h:
28129         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
28130
28131 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
28132
28133         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
28134         mono_string_intern () to implement the semantics of the ldstr opcode
28135         and the interning of System.Strings.
28136         * icall.c: provide hooks to make String::IsIntern and String::Intern
28137         internalcalls.
28138
28139 2001-09-23  Dick Porter  <dick@ximian.com>
28140
28141         * threads-dummy.c: 
28142         * threads-dummy.h: New files of dummy threading routines
28143
28144         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
28145         support code based on system specifics
28146
28147         Rename PTHREAD_LIBS to THREAD_LIBS
28148         
28149 2001-09-23  Dick Porter  <dick@ximian.com>
28150
28151         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
28152         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
28153         internal calls.
28154         (mono_thread_init): Set up a Thread object instance to return when
28155         the main thread calls Thread.CurrentThread
28156         (mono_thread_cleanup): Wait for all subthreads to exit
28157
28158         * icall.c: New internal calls for System.Threading.Thread::Sleep
28159         (including Schedule) and CurrentThread
28160
28161         * threads.h: New file, to insulate thread-specific stuff from the
28162         rest of the code
28163
28164 2001-09-21  Dick Porter  <dick@ximian.com>
28165
28166         * threads-pthread.h: 
28167         * threads-pthread.c: New file, for handling pthreads-style
28168         threading support.  Start() now starts a new thread and executes
28169         the ThreadStart delegate instance.
28170
28171         * icall.c: Added the internalcall for
28172         System.Threading.Thread::Start_internal
28173
28174         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
28175
28176 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
28177
28178         * loader.c: work around the different signatures for delegates
28179         constructors csc generates in compiled code vs the ones compiled in mscorlib.
28180
28181 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
28182
28183         * class.h, class.c: add mono_class_get_field_from_name ().
28184         * *: Fix C comments and other ANSI C issues.
28185
28186 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
28187
28188         * endian.h, assembly.c: fix some endianness issues.
28189
28190 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
28191
28192         * loader.h, load.c: add delegate_class to mono_defaults.
28193         Handle runtime provided methods in mono_get_method ().
28194
28195 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
28196
28197         * loader.c (mono_get_method): use pinvoke for internal call
28198
28199         * icall.c: use pinvoke for internal call
28200
28201         * loader.c (method_from_memberref): set the method name
28202
28203 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
28204
28205         * metadata.c: help the compiler generate better code for
28206         mono_class_from_mono_type ().
28207
28208 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
28209
28210         * class.c (mono_class_metadata_init): delayed computing of the
28211         class size to mono_class_metadata_init ()
28212
28213 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
28214
28215         * class.c, class.h: add an interfaces member to MonoClass.
28216         * image.c, image.h: add assembly_name field to MonoImage
28217         from the assembly table.
28218         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
28219
28220 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
28221
28222         * class.c: Handle Array in mono_class_from_mono_type ().
28223         * metadata.c, pedump.c: some endian fixes.
28224
28225 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
28226
28227         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
28228         * metadata.c: fix small problem introduced with the latest commit.
28229
28230 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
28231
28232         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
28233         We don't need a MonoMetadata pointer anymore to compare signatures in
28234         mono_metadata_signature_equal (), update callers.
28235         Reduced memory usage an number of allocations for MonoMethodHeader and
28236         MonoMethodSignature.
28237
28238 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
28239
28240         * metadata.c: added compare for szarray.
28241
28242 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
28243
28244         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
28245         and add a couple more types to it and mono_defaults. Give an hint on
28246         classes that need implementing in our corlib and are referenced
28247         in mscorlib.
28248
28249 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
28250
28251         * class.h, class.c: keep track if a class is also an Enum.
28252         * loader.c: Implement a couple more types for use in libffi
28253         marshalling. Gives better diagnostics when failing to dlopen
28254         a library. Set method->klass for P/Invoke methods, too.
28255
28256 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
28257
28258         * class.c, class.h: add a MonoType this_arg to MonoClass that
28259         represents a pointer to an object of the class' type that
28260         can be used by the interpreter and later the type cache.
28261         Add best guess alignment info for valuetype objects.
28262
28263 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
28264
28265         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
28266         into MonoType: one less level of indirection and allocation and
28267         simplifies quite a bit of code. Added cache for MonoTypes that are
28268         used frequently, so that we don't need to allocate them all the time.
28269
28270 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
28271
28272         * class.c (mono_class_create_from_typedef): System.Enum is also a
28273         value type, although it does not derive from System.ValueType
28274         (maybe a bug in the ms compiler?)
28275
28276         * metadata.c (mono_type_size): return the right size for value types
28277
28278         * loader.c (mono_get_method): only initialize method header if not abstract
28279
28280         * class.c (mono_class_from_mono_type): use mono_default values. 
28281
28282 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
28283
28284         * *: use MonoClass pointers instead of <type_tokens>
28285         
28286         * class.h: new flag: metadata_inited.
28287
28288         * class.c (mono_class_metadata_init): impl.
28289         (mono_class_instance_size): impl.
28290         (mono_class_data_size): impl.
28291
28292 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
28293
28294         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
28295         MonoClass now has the name and name_space fields. 
28296         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
28297         mono_get_method () takes and optional MonoClass as argument.
28298         Removed mono_typedef_from_name() and added mono_class_token_from_name()
28299         instead that takes advantage of a map from class names to typedef
28300         tokens in MonoImage.
28301
28302 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
28303
28304         * metadata.c: zero is not a valid alignment boundary.
28305         Merge MONO_TYPE_VOID in default decoding code.
28306
28307 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
28308
28309         * image.h: merged MonoMetadata into MonoImage
28310
28311         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
28312         identify the type of elements.
28313
28314 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
28315
28316         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
28317         * cil-coff.h: split MonoMSDOSHeader and add size info.
28318         * image.c: add some consistency checks.
28319         * metadata.c: fix row size computation: one programmer
28320         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
28321         add explanation for the locator routine.
28322         Fix decoding of size in method header.
28323         
28324 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
28325
28326         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
28327         (g_concat_dir_and_file): Bring g_concat_dir_and_file
28328         function from gnome-libs.  This uses the right path separator
28329         based on the OS, and also works around a bug in some systems where
28330         a double slash is not allowed. 
28331         (default_assembly_name_resolver): Use g_concat_dir_and_file
28332         (mono_assembly_open): ditto.
28333
28334 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
28335
28336         * metadata.c (mono_metadata_signature_equal): impl.
28337
28338         * *: void is now a realy MonoType (instead of using NULL)
28339         
28340         * metadata.c (do_mono_metadata_parse_type): use
28341         mono_metadata_parse_type to parse void value.
28342
28343 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
28344
28345         * metadata.c, metadata.h: in the signature and method header store
28346         only the space required for holding the loca vars and incoming arguments.
28347
28348 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
28349
28350         * metadata.c (do_mono_metadata_parse_type): treat void like any
28351         other type (instead of assigning NULL);
28352
28353 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
28354
28355         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
28356
28357 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
28358
28359         * image.c (do_mono_image_open): added a cache for arrays.
28360
28361 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
28362
28363         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
28364         decode a single column from a row in a metadata table and changes
28365         to take advantage of it in the typedef locator (gives a nice speed up).
28366         Store offset info for function params.
28367
28368 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
28369
28370         * image.h (MONO_IMAGE_IS_CORLIB): removed 
28371
28372 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
28373
28374         * assembly.c: how could mono_assembly_close () had ever worked?
28375         * metadata.c, metadata.h: provide offset info for local vars.
28376         Implement mono_type_size () to take care of alignment as well
28377         as size (it was mono_field_type_size in cli/class.c before).
28378
28379 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
28380
28381         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
28382
28383         * assembly.h (CORLIB_NAME): set to corlib.dll
28384
28385         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
28386
28387 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
28388
28389         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
28390         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
28391         tokentype.h: massive namespace cleanup.
28392
28393 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
28394
28395         * metadata.h, metadata.c: decode exception clauses when parsing method header.
28396
28397 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
28398
28399         * metadata.c (mono_metadata_free_type): added check for type !=
28400         NULL (void) before calling mono_metadata_free_type()
28401
28402 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
28403
28404         * metadata.h, row_indexes.h: added header with enumerations to use
28405         to index in the columns from tables in metadata and to decode coded
28406         tokens: we should start using this instead of embedding magic numbers
28407         all over the code.
28408
28409 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
28410
28411         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
28412         Move metadata_t info from cli_image_info_t to MonoImage, where
28413         it's easily accessible. Changed all the uses accordingly.
28414         Added the method and class caches to MonoImage.
28415         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
28416         and mono_metadata_decode_value () signature to be more consistent
28417         with the other parse functions (and simplify code). Taken advantage
28418         of zero-length array allocation with GCC. Removed reduntant (and
28419         wrong) MonoFieldType struct and use MonoParam instead. Changed
28420         mono_metadata_parse_field_type () to use common code for parsing.
28421         Added mono_metadata_typedef_from_field () and
28422         mono_metadata_typedef_from_method () to lookup a typedef index from a
28423         field or method token.
28424         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
28425
28426 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
28427
28428         * metadata.c (mono_metadata_parse_field_type): Implement. 
28429         (do_mono_metadata_parse_type): Split engine from
28430         mono_metadata_parse_type, so that we can create smaller structures
28431         for things that just have one pointer to the MonoType (look at
28432         the MonoFieldType)
28433
28434 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
28435
28436         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
28437         as Jan Gray found out, it is incorrect. 
28438
28439 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
28440
28441         * assembly.c: Implement asssembly loading.  This loads an image
28442         and loads all the referenced assemblies.  Come to think of it, we
28443         could always do lazy loading of the assemblies. 
28444
28445         * image.c (mono_image_open): Keep loaded images in a hashtable.
28446
28447         * image.h (MonoImage): Add reference count.
28448
28449 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
28450
28451         * assembly.c (mono_assembly_open): Keep track of the file name in
28452         case the assembly has no ASSEMBLY table.
28453
28454         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
28455         from get.c here.
28456
28457 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
28458
28459         * metadata.c, metadata.h: decode local vars in method header
28460         parse function. Change callers accordingly.
28461
28462 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
28463
28464         * metadata.h, cil-coff.h: protect against multiple inclusion.
28465         Added some new structures to hold information decoded from metadata:
28466         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
28467         and relevant decoding/free functions.
28468         * metadata.c: implement decoding functions. Add warning for out of bounds
28469         index in mono_metadata_locate(). Implement mono_get_method () to retreive
28470         all the info about a method signature and invocation. Remove check on
28471         uninitialized local var in parse_mh() and fix memory leak.
28472
28473 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
28474
28475         * metadata.h: More macros.
28476
28477         * tokentype.h: New file.
28478
28479 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
28480
28481         * assembly.c: added a consistency check and initialize
28482         some structures with g_new0().
28483         * metadata.c: fixed a couple more bugs in table size computation
28484         and add other checks for out-of bound access to metadata.
28485
28486 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
28487
28488         * metatada.c: fix bugs computing table sizes. Spew a
28489         warning when index in string heap is out of bounds.
28490
28491 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
28492
28493         * metadata.h: Add a couple of macros to manipulate tokens. 
28494
28495 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
28496
28497         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
28498         cli_section_tables).
28499
28500 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
28501
28502         * metadata.c (mono_metadata_user_string): New function, provides
28503         access to the UserString heap. 
28504
28505 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
28506
28507         * metadata.c: Add inline documentation.
28508
28509 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
28510
28511         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
28512         files. 
28513
28514 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
28515
28516         * typeattr.h: New file, TypeAttribute flags. 
28517
28518 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
28519
28520         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
28521         mono_assembly_ensure_section): Section loading code.
28522         (load_section_tables): Load the sections.
28523
28524         * mono/metadata/metadata.c (mono_metadata_locate_token,
28525         mono_metadata_locate): Functions to locate the information
28526         definition given a token or a table and an index.
28527         (mono_metadata_compute_table_bases): New.
28528         (compute_size): New function to compute the sizes of the various
28529         tables.
28530
28531         * mono/metadata/metadata.h: Finish listing the different index
28532         types. 
28533
28534         * mono/metadata/pedump.c: Improve to dump new information.
28535
28536 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
28537
28538         * mono/metadata/metadata.c: Entered all the tables matching
28539         Beta2. 
28540
28541         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
28542
28543
28544